JV-ODE Physics Thread 9

Blitz3D Forums/Blitz3D Userlibs/JV-ODE Physics Thread 9

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.

You can cycle through your body/joints using the following functions...

dBodyGetNumJoints(body)
dBodyGetJoint(body,index)
dJointGetBody(joint,index)
dAreConnected(body1,body2)


The best way is to use an array or type 'beforehand' so that you don't have to iterate through loads of bodies and joints, thus wasting precious processing time.

For example, in the rope demo you know that all bodies in the Sphere(1...10) array are connected using joints in the Joint(1...10) array. If you disconnect any of the joints, set the joint array value to zero for that joint. Now iterate through the arrays until you hit zero, then you have your list of connected bodies both direct and indirect.