[ODE] Jitters

Tim Rightnour root at garbled.net
Mon Nov 8 11:05:30 MST 2004

On 08-Nov-2004 Jon Watte wrote:
>> > Basically the *= -0.01 on each of the
>> shouldnt that be -= 0.01 ???
> You could also get current velocity/avelocity and apply a torque 
> or force that's that *= -0.01. I find this preferrable to slamming 
> the velocities directly.

There seems to be a bit of confusion here as to what I was doing, so I'll post
the code I used:

void apply_damping(dBodyID body) {
    dReal *v = dBodyGetLinearVel(body);
    dReal *x = dBodyGetAngularVel(body);

    v[0] *= -0.01f;
    v[1] *= -0.01f;
    v[2] *= -0.01f;
    dBodyAddForce(body, v[0], v[1], v[2]);
    x[0] *= -0.01f;
    x[1] *= -0.01f;
    x[2] *= -0.01f;
    dBodyAddTorque(body, x[0], x[1], x[2]);

I tried applying this to all bodies prior to calling dWorldStep for each cycle
of the loop.  I also tried applying it after dWorldStep instead, with the same
results.  Or was I supposed to do this in my nearCallBack?

Tim Rightnour <root at garbled.net>
NetBSD: Free multi-architecture OS http://www.netbsd.org/
NetBSD supported hardware database: http://mail-index.netbsd.org/cgi-bin/hw.cgi

More information about the ODE mailing list