NewtonGetTimeStep for game fps limiter?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

NewtonGetTimeStep for game fps limiter?

Postby ulao » Tue Apr 28, 2009 8:35 pm

I'm trying to find a way to limit my code cycles to match the update for newton. I'm under the impression newton updates on an interval to stay constant over system to system. Please correct me if I'm wrong.

Assuming this is true, then NewtonGetTimeStep returning 0.0166667 would tell me that every 0.0166667ms is = to one frame? FYI, I'm running at 60 FPS.

I'm also going to guess that this means my system is to slow, and that would explain why my game seems to appear jumpy?

Can someone please confirm this.

Can I help the engine to match my system speed, or have I met my first minimum requirement.
ulao
 
Posts: 9
Joined: Tue Apr 28, 2009 9:27 am

Re: NewtonGetTimeStep for game fps limiter?

Postby JernejL » Wed Apr 29, 2009 3:57 am

Newton itself does not perform simulation on it's own, only when your application calls newtonupdate the simulation is advanced forward in time and it depends on the time you pass to newtonupdate.

If you get really weird and unexplainable strange jumpy behavour in more games other than just your newton simulation and you use windows performance counter on amd cpu, i suggest you make sure you have AMD's cpu driver which corrects this (it has to do with each core running it's own performance counter and not being in sync).
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonGetTimeStep for game fps limiter?

Postby ulao » Wed Apr 29, 2009 8:33 am

thank you for that amd info, had no idea.

Newton itself does not perform simulation on it's own, only when your application calls newtonupdate the simulation is advanced forward in time and it depends on the time you pass to newtonupdate.


Now that I look deeper, the code for my update allows two methods, one with timeStep and one with out. I was calling the one with out and its attempting to run the update when time > time step. So to get more control over this I can call the update that takes a time step and it simply passes that to the actual newton function.I then can sync this with my engine time and pass it a time step.
Last edited by ulao on Wed Apr 29, 2009 10:48 am, edited 2 times in total.
ulao
 
Posts: 9
Joined: Tue Apr 28, 2009 9:27 am

Re: NewtonGetTimeStep for game fps limiter?

Postby JernejL » Wed Apr 29, 2009 8:36 am

There is no callback that tells you when did your program called newtonupdate, i suggest you ask whoever wrote the particular wrapper that you use how it works, and how it is integrated.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonGetTimeStep for game fps limiter?

Postby ulao » Wed Apr 29, 2009 8:42 am

Sorry, I edited my post on you. You were too fast. But I see your point.
ulao
 
Posts: 9
Joined: Tue Apr 28, 2009 9:27 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 24 guests

cron