Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Jan 2005
Offline Last Active Sep 26 2014 10:38 AM

Posts I've Made

In Topic: Physics Engine Timing Suggestions?

06 October 2012 - 02:54 PM

I have one last simple question, and I believe I know the answer. I assume the safest way to handle passing the data from Physics to Rendering would be all at once in a structure. For example, have a PhysicsFrame class that holds the ObjectID, its transformation, and the Matrix of every changed object in the physics frame. Then pass that to the Renderer, and have it apply the percentage of interpolation between the new matrix and the old matrix per object. Does that make sense?

Thanks again for all the effort you guys have put into helping me.

In Topic: Physics Engine Timing Suggestions?

04 October 2012 - 09:07 PM

Alright, taking it out of the thread is no problem. It really shouldn't be necessary anyway considering this is a 2D game using Shaders for all of my rendering, so rendering should be quick. So, I could essentially multiply my change in X by the percentage, and my change in Y by the percentage and that should be the translation that I actually apply to my geometry.

In Topic: Physics Engine Timing Suggestions?

04 October 2012 - 02:54 PM

Ok, I see what you are saying. So basically I set each Physical step to simulate a fixed amount of in-game time, which in this case is 33.3 ms. and I run as many of them per frame that is necessary to make sure it is caught up to current time. Then I take the difference between real-time and the next step-time, and use that difference to interpolate between the last 2 simulated times, to get the final rendered time? Does that make sense?

In Topic: Physics Engine Timing Suggestions?

04 October 2012 - 01:53 PM

I don't understand how that could work though. I thought the point of this was to make sure that physics ticks at an exact interval.

In Topic: Physics Engine Timing Suggestions?

04 October 2012 - 12:38 PM

@L. Spiro Thanks for the links. I read through your post and I am still a bit confused. The interpolation part is where I get a little thrown off. How do we ensure that physics will update every 33.3 ms? From what I understand, looking at your graph we SHOULD be at 48.0 seconds, but we actually interpolate in between 0.0 and 33.3 in order to get our position at an exact 33.3 seconds of lag. If that is correct, then my only question is, how do we know that physics will run every 33.3 seconds? Also, when it comes time to render, who does the interpolation, the renderer, or the physics engine? I ask because my system is multi-threaded.