Problem with callback

luffy

13-02-2006 12:03:53

Hi, i im having problems with callback.

This is what i have done

1: Create the newton world and add the entities
2: Add the callback to the body of the entity

nwtBody->setCustomForceAndTorqueCallback(Entidad::_callBackMovimiento);

3: In my NewtonFrameListener call to update function

the problem is that the callback only is invoked in the first update. does i have to "update" the setCustomForceAndTorqueCallback every "update" call?

Horizon

13-02-2006 16:57:45

No, you shouldn't have to call setCustomForceAndTorqueCallback() repeatedly. Could you post your callback to see if that's correct?

Further you might want to see if the object isn't autofreezing or freezing because it leaves the NewtonWorld.

Are you sure you have attached an Ogre Node to the OgreNewt Body?

pfo

16-02-2006 04:27:39

Your symptoms suggest that maybe the body is frozen? Try calling NewtonWorldUnfreezeBody and NewtonSetBodyFreezeState to 0. Also make sure your object is within NewtonWorld size.

walaber

16-02-2006 05:46:41

most likely you are creating a body outside the world limits, to it gets called once, realizes the body is outside the world, and stops updating the body.