Nox587
12-08-2007 02:25:20
I've created a body using the OgreNewt::CollisionPrimitives::ConvexHull collision (passing it a scene node). The collision is displayed properly (with debug lines) on my object, but I can not get a customForceAndTorqueCallback to work with the object.
The CCmpProp::standardForceCallback is a static member function:
Neither the custom callback I assign, or the standard callback are working for the object, and I can't seem to find what I'm doing wrong.
//...
//Inertia
convex->calculateInertialMatrix(m_Inertia, m_Offset);
//Center of mass, mass matrix
m_Body->setCenterOfMass(Ogre::Vector3(m_Offset.x, m_Offset.y, m_Offset.z));
m_Body->setMassMatrix(m_Mass, m_Inertia);
//I set the callback like this -
m_Body->setCustomForceAndTorqueCallback(&CCmpProp::standardForceCallback);
//Even replacing the above with this won't work
//m_Body->setStandardForceCallback();
//...
The CCmpProp::standardForceCallback is a static member function:
class CCmpNode : public ICmpNode
{
public:
//...
static void standardForceCallback(OgreNewt::Body *me);
//...
};
Neither the custom callback I assign, or the standard callback are working for the object, and I can't seem to find what I'm doing wrong.