Chipmunk 2D Physics Module

BlitzMax Modules Forums/Brucey's Modules/Chipmunk 2D Physics Module

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Now to just figure out how to get the rotation

Have a look at main2.bmx - drawPolyShape(). Shows getting the body position and angle.
Angle is returned in degrees, for your convenience.


Notes :
Objects like Body and Shape are reference counted for you, so you don't have to keep a reference to all of them yourself if you don't want to. Therefore, when you want to remove an object from the space you need to "free()" it. This will remove it properly from the space.
Note too, that you also need to free() all related shapes/joints too... perhaps this is an enhancement we can have later - whereby the module will free the related parts for you. At the moment, it mirrors the functionality of the library...
You also need to be wary *when* you free() something. For example, freeing an object from a collision function is not advised, since the library is still using them at that point. You should rather flag up that something needs freed and deal with it at the end of the DoStep()/update process.