hspace->activeShapes in the ruby extension?

2 views
Skip to first unread message

LucJ

unread,
Oct 23, 2007, 6:17:52 PM10/23/07
to ShatteredRuby
Before my question: phenomenal job, guys; your work has spawned both
ogre.rb and now Chipmunk.so, and that's more than enough to validate
ShatteredRuby on its own.

My question:

I'm trying to translate one of the Chipmunk demos directly into ruby,
as a means of exploring the chipmunk.so extension and learning to use
it. But in the C demos, the space object has the "activeShapes,"
"staticShapes" and "bodies" properties.

This is my first day playing with the extension, so this is probably
obvious, but:

Given an instance of Space, how can I get a list of all of the shapes/
bodies I've added to it?

As far as I can tell, in C, the cpSpace struct has (cpSpace)Hashes for
active/static shapes, and an array of bodies. And 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, and
after spending an hour irb-ing around I still can't find them ...

Many thanks from a newbie!

Reply all
Reply to author
Forward
0 new messages