pawka
28-05-2008 16:42:58
Hi, I've changed second demo of OgreNewt (Demo02_Joints). This is that change:
As you can see i've changed only type of joints (from OgreNewt::BasicJoints::BallAndSocket to OgreNewt::BasicJoints::Hinge) but only first joint works as hinge, other work like they were ballAndSocket:( Does anyone know what's going on??
if (parent)
{
//joint = new OgreNewt::BasicJoints::BallAndSocket( m_World, child, parent, pos-Ogre::Vector3(size.x/2,0,0) );
joint = new OgreNewt::BasicJoints::Hinge( m_World, child, parent, pos-Ogre::Vector3(size.x/2,0,0), pos-Ogre::Vector3(0,0,1) );
}
else
{
// no parent, this is the first joint, so just pass NULL as the parent, to stick it to the "world"
//joint = new OgreNewt::BasicJoints::BallAndSocket( m_World, child, NULL, pos-Ogre::Vector3(size.x/2, 0, 0) );
joint = new OgreNewt::BasicJoints::Hinge( m_World, child, NULL, pos-Ogre::Vector3(size.x/2,0,0), pos-Ogre::Vector3(0,0,1) );
}
As you can see i've changed only type of joints (from OgreNewt::BasicJoints::BallAndSocket to OgreNewt::BasicJoints::Hinge) but only first joint works as hinge, other work like they were ballAndSocket:( Does anyone know what's going on??