avee
16-07-2006 07:02:26
Hi all,
In my app, I created a custom force and torque callback, which has a conditional statement like this:
The problem is, the callback is called only once, when the object is created.
When I study more about this, I found out that when a callback doesn't affect the body in the simulation, it will only be called once. Even when at the next iteration, the callback will affect the simulation...
I conclude the statement above because, when I erased the if statement, the callback works just fine, it is called each time the world updates..
Can anyone help me with this?
Does this behaviour come from Newton or OgreNewt?
How can we overcome this?
Thanks guys..
In my app, I created a custom force and torque callback, which has a conditional statement like this:
void callback(OgreNewt::Body* me)
{
if(This->_status == OBJ_STATUS_MOVING)
{
me->addForce(Vector3(10,0,0));
}
}
The problem is, the callback is called only once, when the object is created.
When I study more about this, I found out that when a callback doesn't affect the body in the simulation, it will only be called once. Even when at the next iteration, the callback will affect the simulation...
I conclude the statement above because, when I erased the if statement, the callback works just fine, it is called each time the world updates..
Can anyone help me with this?
Does this behaviour come from Newton or OgreNewt?
How can we overcome this?
Thanks guys..