Reset all froces at once

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Reset all froces at once

Postby Lax » Mon Dec 17, 2018 4:19 pm


is it somehow possible to reset all forces at once?
I'm writing a level editor, in which the user can press play/stop. When pressing play, the physics is updated. Now I encounter issues, between stop/play/stop/play again the simulation, as the bodies have forces applied. I set all forces to 0 and also called: 'NewtonInvalidateCache' etc. but nothing does work.
As soon as I press play (updating newton), the bodies are move a bit in the scene.

Best Regards
Posts: 124
Joined: Sat Jan 08, 2011 8:24 am

Re: Reset all froces at once

Postby JernejL » Tue Dec 18, 2018 2:25 am

I think besides invalidating cache, you need to set velocity, omega and torque to zeroes ( NewtonBodySetTorque, NewtonBodySetOmega, NewtonBodySetForce ) on all bodies.
Help improving the Newton Game Dynamics WIKI
User avatar
Posts: 1525
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest