I have a question about timers.

35 views
Skip to first unread message

hironori takai

unread,
Dec 5, 2020, 6:51:08 PM12/5/20
to ode-users
I want to display the simulation in real time when drawing the screen with drawstuff. Is there a function related to the timer in Open Dynamics Engine?

Also, please tell me the location of the concretely implemented functions and sample source code on how to measure the real time and put weights and sleeps on the simulation.

I'm worried that the MFR-LQ can display the actual time accurately, so I'd like to know how to verify it.

by hironori takai
e-mail: hironori....@gmail.com
e-mail: hironori...@cock.li

Vaillancourt

unread,
Feb 8, 2021, 1:19:32 PM2/8/21
to ode-users
> I want to display the simulation in real time when drawing the screen with drawstuff.

What does it mean "in real time" in your context?

Keep in mind that the drawStuff related projects are conveniences to validate that the physics engine works as expected. They're not really there to show how to create a real-time simulation tied to graphics.

If you do want to match the rendering to the simulation, you might want to check the `simLoop (int pause)` functions, and put some kind of timer there: at the beginning of the function, store the time, and at the end of the function, check how long it took to process the physics and the rendering. Then either Sleep or busy-loop until the time it took matches the time specified to the `dWorldQuickStep` or `dWorldStep` functions. That's probably not perfect, but that's the first thing I'd try.
Reply all
Reply to author
Forward
0 new messages