Sign in to follow this  
Timjanmannen

Newton Game Dynamics behaves wierd

Recommended Posts

Hi, im currently making a project with Irrlicht and Newton Game Dynamics. I'm using the timer object that is accessible from my IrrlichtDevice to get the delta-time to pass to NewtonUpdate. I noticed that newton behaves wierd, for example a freely falling object falls at a somewhat constant speed, which varies up and down a little, but it should accelerate and go faster all the time =S When i changed the delta-time source to GetTickCount it worked fine. I noticed that the smallest delta-time i could get with GetTickCount was around 15 ms(It returned the same value until ~15 ms had passed, anybody know why?) while the irrlicht-timer was capable of delivering delta-times of 1-2 ms. I then made the least acceptable delta-time 15 ms, and it behaved quite normal, so my questions are these: Does anybody knoq why NewtonUpdate behaves wierd with to small detla-time? And does anyone know why GetTickCount's delta-time is ~15 ms? Thanks in advance Pierre

Share this post


Link to post
Share on other sites
I don't know whether Newton does this for you, but mabye you should keep each step size the same length. This means that each update will have the same delta time, but might be run more or less than once every frame, depending on the framerate. This *might* make it work better.

Share this post


Link to post
Share on other sites
Quote:
Original post by Timjanmannen
And does anyone know why GetTickCount's delta-time is ~15 ms?


Because that is the resolution of the timer - it only measures to about that accuracy. If you need better accuracy, use a different timer.

Share this post


Link to post
Share on other sites
Actually, this is because newton quantizises the delta time that is passed to NewtonUpdate. You can get normal behaviour if you just update newton with a constant time but just call the function when that time has passed. there's lotsa info on that in the newton forums!

Share this post


Link to post
Share on other sites
My account at the newton forum is currently disabled and my email banned because i didn't post anything myself(Which is why i'm asking ere on gamedev :)). I recently sent an email to the admins and asked them to enable my account again.
Thanks for the replies, i think i get it now =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this