iversons
24-10-2006 17:31:44
In ogrenewt, it is not recommend to use setPosition and setVelocity to move any bodies.
But, how can we move the body so? :
But, how can we move the body so? :
iversons
24-10-2006 17:31:44
ProfesorX
24-10-2006 20:48:00
void Body::standardForceCallback( OgreNewt::Body* me )
{
//apply a simple gravity force.
Ogre::Real mass;
Ogre::Vector3 inertia;
me->getMassMatrix(mass, inertia);
Ogre::Vector3 force(0,-9.8,0);
force *= mass;
me->addForce( force );
}
Ogre::Real mass;
Ogre::Vector3 inertia;
me->getMassMatrix(mass, inertia);
Ogre::Vector3 m_direction(0, 0, -1)
Ogre::Vector3 V0 = me->getVelocity();
Ogre::Vector3 V1(m_direction * m_MyVel);
Ogre::Vector3 force = (V1 - V0);
force *= mass;
me->addForce(force1);
iversons
25-10-2006 16:41:12