New To Bullet - HingeConstraints

Wing_Zero
Posts: 2
Joined: Wed Dec 09, 2009 5:48 am

New To Bullet - HingeConstraints

Post by Wing_Zero »

Can anyone break down for me the process/what goes on within the method btHingeConstraints? :?

I need to know this because I've been asked to create a method that does the following:

btHingeConstraint* makeHingeConstraint(const btVector3& btPivot, const btVector3& btAxis, btRigidBody& rbA, btRigidBody& rbB)
{
// Finds RigidBody Dimensions and uses them
float x = ????
float y = ?????
float z = ?????
// Takes global co-ordinates of the Pivot (btPivot) and creates the following vectors:
btVector3 btPivot12(btPivot[0], btPivot[1]+y/2, btPivot[2])
btVector3 btPivot21(btPivot[0], btPivot[1]-y/2, btPivot[2])

// Find axis in a similar fasion

return new btHingeConstraint(*plink1, *plink2, btPivot12, btPivot21, btAxis12, btAxis21);

}

Help would be greatly appreciated