[ODE] Simulations running in real time?

Megan Fox shalinor at gmail.com
Mon Mar 28 10:25:49 MST 2005


Just use code something like this:

    // Make sure time is accrued properly for the phys step count
    this->totalTime += deltaTime;

    // Then advance the world up to present time
    unsigned int iters = 0;
    while(this->totalTime > PHYS_STEPSIZE)
    {
         // ... entity processing

        nOpende::JointGroupEmpty(this->physContactJointGroupID);
        nOpende::SpaceCollide(this->physColSpaceID, this,
this->PhysCollisionCallback);

        nOpende::WorldQuickStep(this->physWorldID, PHYS_STEPSIZE);

        this->totalTime -= PHYS_STEPSIZE;

        iters++;
    }


Very simple.  It runs ODE in real-time with a fixed timestep, without
loosing those fractions of a timestep you'll drop if you're just doing
"if deltatime > X"

-Megan Fox

On Mon, 28 Mar 2005 22:45:21 +0700, Hampus Soderstrom <hampus at sxp.se> wrote:
> You could also lock he framerate to 60 pfs or something. On a computer
> that is too slow and can't keep up with the framerate you selected it
> will run slower though.
> 
> 2005-03-28 kl. 20.28 skrev George Birbilis:
> 
> > use multiple threads
> > see a paper at the Novodex website (now called Ageia or something),
> > search for Novodex SDK papers and at see the PDF about multithreading.
> > You can apply similar technique to ODE I suppose
> >
> > -----
> > George Birbilis (birbilis at kagi.com)
> > Microsoft Most Valuable Professional
> > MVP J# for 2004 & 2005
> > http://www.kagi.com/birbilis
> > --------------
> > ----- Original Message ----- From: "Chris Royce" <croyce at ntlworld.com>
> > To: "ode" <ode at q12.org>
> > Sent: Monday, March 28, 2005 4:10 PM
> > Subject: [ODE] Simulations running in real time?
> >
> >
> > Hello there I'm trying to get my simulation to run in real time,
> >
> > Basically the problem I'm having at the moment is that the simulation
> > is running at different speeds on different computers. I'm working in
> > C++ and using the drawStuff interface.
> >
> > I'm also noticing that by changing the dWorldStep value the motion
> > varies quite considerably, whereas I'd expected to run simply faster
> > or slower ?
> >
> > Thanks for any advice
> >
> > Chris
> >
> >
> > -----------------------------------------------------------------------
> > ---------
> >
> >
> >> _______________________________________________
> >> ODE mailing list
> >> ODE at q12.org
> >> http://q12.org/mailman/listinfo/ode
> >
> > _______________________________________________
> > ODE mailing list
> > ODE at q12.org
> > http://q12.org/mailman/listinfo/ode
> >
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>


More information about the ODE mailing list