[ODE] Reducing jitter when using QuickStep?
Jon Watte
hplus-ode at mindcontrol.org
Sat Jul 17 00:03:02 MST 2004
Try this on for size:
void DampenBody( dBodyID body, float vScale, float aScale )
{
if( !dBodyIsEnabled( body ) ) {
return;
}
dReal const * V = dBodyGetLinearVel( body );
dBodyAddForce( body, vScale*V[0], vScale*V[1], vScale*V[2] );
dReal const * A = dBodyGetAngularVel( body );
dBodyAddTorque( body, aScale*A[0], aScale*A[1], aScale*A[2] );
}
I call this for each body, with "scale" values in the range
of 0.01f or so. This will get rid of a lot of jitter and
sudden explosions, and as an extra bonus, will make rolling
spheres eventually stop rolling ;-)
It's important that you dampen both linear and angular
velocities, btw.
Cheers,
/ h+
-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Megan
Fox
Sent: Friday, July 16, 2004 6:52 PM
To: Ode
Subject: [ODE] Reducing jitter when using QuickStep?
When using QuickStep and usable gravity (-9.8 to -20.0), is it possible to
reduce or remove the jiggly effect most objects seem to suffer from without
compromising the integrity simulation (eg. without reducing gravity to an
unusable value like 0.5, or making objects so soft as to make the collisions
seem completely incorrect, etc)?
I'm using 1x1x1 blocks on a 20x1x20 floor board, default values across the
board for CFM/etc, dInfinity / 2.0f static friction.
-Megan Fox / "Shalinor"
Lead Developer, Elium Project (http://www.elium.tk)
More information about the ODE
mailing list