Time Delta, collision detection

Sage
Posts: 1,482
Joined: 2002.09
Post: #16
(Sep 4, 2010 07:58 PM)Skorche Wrote:  You could do a small step at the end to use up the rest of the time for the frame, but one of the benefits... (blah blah blah)

And I meant to end with: but if your game is simple enough this all probably doesn't matter. So yeah, as AnotherJake say, go ahead and try it. Nothing is hurt by experimenting.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 30
Joined: 2010.08
Post: #17
It does work fine for my simple physics code. But if I used your chipmunk library, it would be a lot better with a fixed timestep right? But how would I interpolate between states when chipmunk manages all the objects ?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #18
Chipmunk works better with fixed size timesteps yes.

Same way you would if you were managing the physics state. You only interpolate when drawing, not when updating the state. You don't have to store the interpolated values anywhere.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 30
Joined: 2010.08
Post: #19
So should I just pass the previous and current game state and the alpha value to the renderer? Or should have a method of the Game class that creates a new interpolating instance based on the previous current and alpha and then pass that to the renderer?
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #20
I call my states alpha, beta, and the interpolated one iota. Alpha is the newest tick, beta is the previous tick. I pass alpha and beta to my interpolator to create the new state, iota. iota is the one that the renderer reads to draw.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Optimize the collision detection alaslipknot 1 2,253 May 12, 2013 08:02 PM
Last Post: SethWillits
  Collision detection tutorial ThemsAllTook 7 21,595 Nov 5, 2011 05:20 PM
Last Post: SethWillits
  Help with Collision Detection..(i'm almost there) carmine 1 4,318 Jun 29, 2011 12:33 PM
Last Post: ThemsAllTook
  Collision detection for pinball game johncmurphy 0 4,509 Sep 6, 2009 02:46 PM
Last Post: johncmurphy
  Phases of Collision Detection Ingemar 5 6,946 Aug 24, 2009 06:11 AM
Last Post: Skorche