my Custom Force And Torque Callback is called only once :(

maroxe

25-10-2008 22:51:26

Hi,
i use a Custom Force Callback for my body. but, this fuction is called only once :?
my code:
robot->setCustomForceAndTorqueCallback< FrameListener >(&FrameListener::move,(FrameListener*) mFrameListener);

call back function:

void move(OgreNewt::Body* B)
{
Ogre::LogManager::getSingleton().logMessage( "Callback called" );
if( mMoveUp )
mRobot->addForce(Vector3(0, 1000, 0));
}

micken

26-10-2008 01:58:35

make sure your body isn't frozen. OgreNewt doesn't call CustomForceAndTorqueCallbacks for bodies that are frozen. If your body is going to be moved around a lot then when you initialize it you should set it's autofreeze to false.

maroxe

26-10-2008 13:05:23

thanks, that resolved my problem :D