You can reply here, or at the ShatteredRuby list (linked below) -- if you want to answer here, we could keep clutter off the list, but fortunately or unfortunately this little forum is more active than the ShatteredRuby group.
My first question was,
http://groups.google.com/group/shattere ... 91e4ec4845Given an instance of Space, how can I get a list of all of the shapes/
bodies I've added to it? ... in the demo code, the drawing loop accesses the space->activeShapes hash.
...
But with chipmunk.so, I can't find analogues for any of those
Of course, since I added them myself, I could always keep track of them at the time when I add them to my Space ... and risk my model getting out of sync with Chipmunk's, but that's doable.
My second question, though, has me kind of gnashing my teeth here.
http://groups.google.com/group/shattere ... 91e4ec4845With chipmunk.so, how do I loop through the vertices of a poly shape?
...
In C, shape->verts appears to be an array of vectors, which makes
sense.
In Ruby, poly.verts is a method that apparently expects the same
arguments as the Poly.new, which doesn't make sense. I initially
assumed that from the plural name and similarity to the C property
that it would let me get at the vertices. Instead, it says that I need
to give it 3 args: a Body, an array, and a vector.
In the C demos, looping through poly->verts is the method used to draw
the poly shapes.
In Ruby, I don't know how to do this.
THIS one is confusing.
All I can draw right now are the bounding boxes. It's almost as if all of the properties in the extension objects that are lists/arrays/hashes in C, like space.activeShapes, space.bodies, or poly->verts, are missing or inaccessible. Bounding boxes work, and if I had to guess I'd say that's because they have discrete L, R, T, B properties instead of a list of vectors.
And I *do* have to guess, because I am mightily confused!
If anyone can shed some light or throw me a life preserver, I'd appreciate it!
edit: and just editing to say, I am NOT experienced with Ruby extensions, so it is absolutely possible that I'm missing something glaringly obvious to people in the know.