[ODE] About angular damping

Jacob Ole Juul Kolding dacobi at gmail.com
Fri Apr 13 17:23:05 MST 2007


On 4/13/07, Jon Watte (ODE) <hplus-ode at mindcontrol.org> wrote:
>
> In the analytic case, yes; you get the angular velocity, multiply by the
> mass, and divide by the time step, negate it, and that's your necessary
> torque.


Ok, I have the following code:

    if(fAngularDamp > 0){

        if(!theEngine->chronos()){ // milisecs since last frame
            return;
        }

        const dReal *curAVel = dBodyGetAngularVel(odeBody);
        dVector3 dCurAVel;

        dCurAVel[0] = curAVel[0] * odeMassf;
        dCurAVel[1] = curAVel[1] * odeMassf;
        dCurAVel[2] = curAVel[2] * odeMassf;

        dCurAVel[0] = dCurAVel[0] / (theEngine->chronos() / 1000);
        dCurAVel[1] = dCurAVel[1] / (theEngine->chronos() / 1000);
        dCurAVel[2] = dCurAVel[2] / (theEngine->chronos() / 1000);

        if((dCurAVel[0] != 0) || (dCurAVel[1] != 0) || (dCurAVel[2] != 0))
        dBodyAddRelTorque(odeBody, -dCurAVel[0] * fAngularDamp, -dCurAVel[1]
* fAngularDamp, -dCurAVel[2] * fAngularDamp);
    }

The problem is that whenever fAngularDamp is above Zero, All rotation stops
permanently and my shell is full of this:

ODE Message 2: vector has zero size in dNormalize4() File odemath.cpp Line
129

ODE Message 2: vector has zero size in dNormalize4() File odemath.cpp Line
129

ODE Message 2: vector has zero size in dNormalize4() File odemath.cpp Line
129

What am I doing wrong?

In the integrator case, there is always some behavior of the integrator
> that may get in the way, but I haven't analyzed the ODE integrator
> enough to correct for that -- I do what's outlined above, and it works
> pretty well as-is.
>
> Cheers,
>
>           / h+
>
>
> Jacob Ole Juul Kolding wrote:
> > Hello List
> >
> > I'm reading about resistance and angular damping in the FAQ but it
> > didn't answer my question.
> > I'm looking for at formula to determine the exact amount of torque
> > required to put a rotating body to rest.
> > The body in question having no contacts/joints attached nor being
> > affected by gravity.
> > Can this be computed from the angular velocity and mass of the body?
> >
> > Any help appreciated!
> >
> > /Jacob Kolding
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ODE mailing list
> > ODE at ode.org
> > http://mooshika.org/mailman/listinfo/ode
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mooshika.org/pipermail/ode/attachments/20070414/cc56ad3e/attachment.htm


More information about the ODE mailing list