[ODE] Possible solution to unstable rotating bodies problem

Adam D. Moss adam at gimp.org
Thu Apr 7 19:23:50 MST 2005


Erin Catto wrote:
> In my engine I don't include the inertia torque term: cross(omega, I*omega).
> Without this term you get conservation of angular velocity rather than
> conservation of angular momentum. This leads to greatly increased stability
> at the cost of decreased accuracy.

I think (but am not entirely certain) that the attached
patch to ODE properly omits the inertial torque (for QuickStep).

--Adam
-- 
Adam D. Moss   -   adam at gimp.org
-------------- next part --------------
Index: ode/src/quickstep.cpp
===================================================================
--- ode/src/quickstep.cpp	(revision 4041)
+++ ode/src/quickstep.cpp	(working copy)
@@ -551,8 +551,8 @@
 		dMULTIPLY2_333 (tmp,body[i]->invI,body[i]->R);
 		dMULTIPLY0_333 (invI+i*12,body[i]->R,tmp);
 		// compute rotational force
-		dMULTIPLY0_331 (tmp,I+i*12,body[i]->avel);
-		dCROSS (body[i]->tacc,-=,body[i]->avel,tmp);
+		////dMULTIPLY0_331 (tmp,I+i*12,body[i]->avel);
+                ////dCROSS (body[i]->tacc,-=,body[i]->avel,tmp);
 	}
 
 	// add the gravity force to all bodies


More information about the ODE mailing list