Hi,
I have a big problem with Newton ...
When I start my game, my object falls on the floor directly.
But when I stop my game(in order to restart the level) my object doesn't fall directly on the floor.
With 1 restart, I must shoot on it 1 second and he falls.
With 2 restart 2 secconds, with 3 restarts 4 seconds ...
I use this functions to release Newton:
NewtonDestroyAllBodies(nWorld);
// release the collision tree
NewtonReleaseCollision(nWorld, g_newtonmap);
for (int i=0; i<numNewtonObject; i++)
NewtonReleaseCollision(nWorld, newtonObject->collision);
// destory the newton world object
NewtonDestroy(nWorld);
Can you help me please ???
Newton problem when reloading level
Maybe a Newton forum can help you !?!?!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
I found the problem :
lasttick was not reinitialized at the restart, so the newton world was not updated directly.
I add that at the restart :
lasttick=0;
And now it's working !!!
Code: Select all
//NEWTON
// Update newton 100 times / second
if (device->getTimer()->getTime() > lasttick + 10)
{
lasttick = device->getTimer()->getTime();
NewtonUpdate(nWorld, 0.01f);
}
I add that at the restart :
lasttick=0;
And now it's working !!!