[ODE] center of mass

Geoff Carlton gcarlton at iinet.net.au
Thu Jan 12 19:44:31 MST 2006


Its a bit of a trick.

I noticed that geom "pos" and "R" pointers always point to elements of 
an implicit posr structure.  I combined the pointers into one, making a 
saving of one pointers worth of space.  The geom now has two posr 
pointers: the final transform, and any offset transform (or null for 
none).  So memory is back to square one.  Anything that wants to grab 
the geom position always uses the "final" posr without any extra checks.

The change propagates through a fair lot of code, and looks a bit 
scary.  However g->posr->R[4] isn't actually an extra indirection, its 
just an additional constant offset from the pointer address.

Geoff


More information about the ODE mailing list