[ODE] Damping

david@csworkbench.com david at csworkbench.com
Thu Mar 27 15:39:02 2003


Hmmm, I thought air resistance varies with the square of the velocity.... 
In any case, using the square of the velocity is probably close enough
with all the other approximations this makes, and it's a lot faster to
calculate the square of the velocity than the cube (you save a square root
and multiply per body, since you'll have the square to start with).

Do any of the geometric primitives in ODE have a separate cross-sectional
and physical center?  I don't think so, since they're all symmetric along
all 3 axes.  Might be worth pointing out if I'm not mistaken.

The area of the silhouette of the object (as viewed by the wind) should
probably be factored in, though that's a bit expensive to calculate for
complex objects (my shadow caster does it every frame, though, at least
computes the silhouette, not the area).

David

>
> The following question comes up quite a bit, so I think the answer
> should go into the Wiki FAQ.
>
> --
>
> Q: How do I stop things from rolling off into infinity, or pendulums
> from swinging forever?
>
> A: You can accomplish that pretty well with damping.  It works about
> like this:
>
> 1) Compute the velocity of the object that's supposed to slow down.
>
> 2) Multiply that velocity by a "damping coefficient." This is typically
> a small number, like 0.01 for example.
>
> 3) Change the sign on the velocity vector, and you get your damping
> force.
>
> 4) Apply that force with dBodyAddForce.
>
> Tweak the damping coefficient to get the object to slow down at the rate
> you want.
>
> You can also do the same thing with angular velocity rather than plain
> old linear velocity, and dBodyAddTorque rather than dBodyAddForce.
>
> For air resistance, it would be better to use the cube of the velocity,
> because that's how drag works in reality.  The force should also be
> applied at the objects, aerodynamic center rather than at the body
> location.  The center of the object's cross section would probably be
> close to the aerodynamic center, at least for non-engineering purposes.
>  In any case, dBodyAddForceAtRelPos will allow you to apply the force at
> a specific point in the body's frame of reference.
>
> --
>
> Did I get it right? :-) Any comments before I put this into the FAQ?
>
> --
>
> Nate Waddoups
> Redmond WA USA
> http://www.natew.com
>
>
>
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode