[ODE] multihreading and ODE
cesar pachon
cesarpachon at yahoo.es
Mon Jan 24 14:45:26 MST 2005
hello! I put a separate thread (timer) for
fixed-stepping ODE, and a Main thread with
update-paint code.. the problem is that periodically
my car (a simple car simulation) vibrates. it quicky
becomes stable, but graphically looks bad. my code is:
timer_func(){
stepping_ode = true;
dWorldQuickStep (dWorldID, fixedstepsize);
stepping_ode = false;
}
this method runs a 30 fps. My Update and Paint thread
runs at 120 fps (no constant rate) and I check the
flag:
update(){
//calculate actual framerate..
if(!stepping_ode){
//query ODE and update graphic objects.. pos and
rot.
}
paint();
}
my question is.. is something bad with the flag? do I
need sync also the reading method? If I do that, it
would affect the fixed framerate of ODE stepping
function?
thanks by the help!
______________________________________________
Renovamos el Correo Yahoo!: ¡250 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es
More information about the ODE
mailing list