On Sun, 2005-04-03 at 20:25 -0700, Sean Lynch wrote:
> I have separated the physics simulation step from begin_round, having
> the simulation store all its bodies and call a method on each body to
> update its position each step. However, it just occurred to me that
> there are certain things that must be done each step, such as collision
> detection and response and adding forces to the force accumulators for
> each body. Doing this separately from begin_round/end_round would
> require adding another Python method to each body that would need to be
> called each time step. Since begin_round and end_round are already
> called each round, this hurts performance.
> 
> I really don't think that coupling round time to physics step time is
> that big of a restriction. It does make sense to move all the movement
> to advance_time and use interpolation, however. If anyone can think of a
> good reason not to do the physics simulation step in begin_round (or
> end_round?) and all the actual updating of positions in advance_time,
> please let me know.

Ok, I put the simulation step back into begin_round and moved all
movement to advance_time. I now store the previous position and
quaternion from the simulation for each body and interpolate to get the
current position and orientation, so motion should appear very smooth
now even with a large physics timestep! One gotcha: I'm using linear
interpolation of the quaternions, which is fast but not perfectly
accurate, so very fast moving objects may appear to "jitter" slightly.
However, the results can never be worse than not interpolating at all,
so I think people should be able to live with that.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to