[ODE] center of mass

Geoff Carlton gcarlton at iinet.net.au
Thu Jan 12 15:50:33 MST 2006


Yes, it can exist perfectly happily with geomTransform.  You can even 
use geomTransforms on some objects, and proper offsets on others.

Generally there was support for the change last time.  The main 
objection was from Jon Watte, who thought that there might be a 
significant memory and performance overhead, and also that geomTransform 
is "good enough" not to warrent a change.  In making up a clean patch, 
I've found the memory is certainly _less_ than currently, and 
performance, while being difficult to measure, seems both theoretically 
and practically no different.

The only place that may be an issue is that when objects collide, they 
now do a check to see if they need to update their final positions (if 
offset), which boils down to an inline flag check.  This is the only 
place that may be a possible problem, but its actually a very trivial 
addition.

As for usability, I started to write a demo using both techniques, where 
you could change an object's centre of mass on the fly.  You can do that 
by offsetting the geom, and then moving the body around to compensate, 
such that the geom ends up in the same position as before.  I gave up 
writing it for geomTransform though, its too much work, besides which 
you can't manipulate transform objects safely while iterating through a 
space.  The sample code is here (with functionality missing in the 
geomTransform case):

  http://www.hotboxgames.com/downloads/offset_posr/test.cpp

Geoff


J. Perkins wrote:

>On 1/11/06, Geoff Carlton <gcarlton at iinet.net.au> wrote:
>  
>
>>This is the re-surfacing of a very old discussion about being able to
>>offset geoms from bodies without using geomTransform.  Over Chrismas I
>>made a patch from a new version (of UNSTABLE), and wrote up a summary
>>about why I think its much better than the current way of doing things.
>>    
>>
>
>This looks like an improvement to me. This is similar to how Novodex
>handles offsets. What are the objections to this approach? Could this
>approach coexist with GeomTransform over the short term, to give folks
>time to switch?
>
>Jason
>
>  
>



More information about the ODE mailing list