[ODE] ODE - Constant speed in different qualities boxes
Jon Watte
hplus-ode at mindcontrol.org
Wed Mar 17 13:18:56 MST 2004
The canonical game loop:
http://www.mindcontrol.org/~hplus/graphics/game_loop.html
Cheers,
/ h+
-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Megan
Fox
Sent: Wednesday, March 17, 2004 9:42 AM
To: Ode
Subject: RE: [ODE] ODE - Constant speed in different qualities boxes
> > If I was doing it properly, I would be running my entire game loop at a
> > fixed rate (so I would update EVERYTHING in the loop, once per
> loop, then
> > render at the end), but I'm not :)
> >
> > I do run the collision system once per loop, but I don't communicate the
> > position of the geoms to the "real" entities in my systems
> until the looping
> > has stopped. I think I might adjust this in the "real" engine
> such that I
> > run the entire system at a fixed rate - it would make it easier
> to retrofit
> > the engine to allow replays.
> >
>
> I tried this, both with clearing all the collision contacts after the
> first small ODE update and without. In both cases the result was
> terrible. My simulation jumped around and was in general much more
> unstable than it was before :(
Here is exactly how my update physics loop looks (apologies for that last
email, apparently there exists a button combo for "send mail" that I
accidentally pressed, meh):
(physTime is the time since the last frame passed into my UpdatePhysics
method)
while (physTime > PHYSICS_STEPSIZE)
{
// Update the collision data
nOpende::JointGroupEmpty(this->physColJointGroupId);
this->refPhysColSpace->Collide(this, this->PhysCollisionCallback);
// Step the world by frameTime (the amount of time since the last frame)
this->refPhysWorld->Step(PHYSICS_STEPSIZE);
physTime -= PHYSICS_STEPSIZE;
}
This results in no instability at all, and lets me tune exactly how often I
run physical steps - I typically have PHYSICS_STEPSIZE at 0.01. After this
is complete, I update the positions and orientations of the objects in my
side of the code and continue with the logic/rendering systems.
Incidentally, I'm using the wrapper for Nebula 2, thus the class-based
interface with ODE.
-Megan Fox
Lead Developer, Elium Project (http://www.elium.tk)
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list