FPS independent Movement
Where is a good place to find information on Famerate independent movement?
A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.
A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.
bump
A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.
Tell ya what.. I''ll send you $100 if you can''t find any information relating to this subject on the search page of this message board.. Ah stuff the $100, you WILL find what you''re looking for if you click that little ''search'' button on the top right hand corner of the message board screen and type in ''fps move'' for the criteria and select ''Nehe Productions'' from the search forum list.
Please try the archives first before posting a question which would probably have been asked 1000 times before.
"You are just as irritating to me as an irrational term that accidentially creeps into your equation and cannot be factorized out."
Please try the archives first before posting a question which would probably have been asked 1000 times before.
"You are just as irritating to me as an irrational term that accidentially creeps into your equation and cannot be factorized out."
July 11, 2001 10:04 PM
This is a FAQ, so a search should suffice, but here is the basic idea:
Keep track of your loop time (millisecond accuracy).
At the beginning of each loop, calculate the time it took for the last loop pass. This is your time delta.
In your physics portion of your code, multiply all your movement by this time delta. Use floating point (or fixed point) or this method will not work.
An alternate method, that doesn''t used floating (or fixed) point math, is to decide on a minimum timestep (like 10 milliseconds) and only perform physics when a timestep has passed. Basically you''d do this:
|
You''d also need to keep track of how much time_delta was left over (if your time_step was 10, and the time_delta was 15, you''d perform physics once, and have 5 milliseconds left over)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement