[ODE] XODE - finalisation

William Denniss lists at omegadelta.net
Mon Mar 29 22:42:01 MST 2004


Royce,

I have updated the explanations with the mass - it was done in a rush.

To answer your questions, as you are probably aware, mass is stored by
ODE in a struct with the total mass, center of gravity and inertia
tensor 3x3 matrix.

http://opende.sourceforge.net/ode-latest-userguide.html#ref67

XODE can store these values directly - this so one can serialize an ODE
scene in XODE.

When building objects in code, the methods such as dMassSetBox are more
commonly used to create the mass struct values.  Hence, many editors
will have similar options (for example ODEEd).

This is why we have two representations for the mass in XODE.

The 'shape' representation as I call it can either set a total mass or
density.  Depending on which one is used, the relevent 
dMassSetBox or dMassSetBoxTotal ode method will be called by the reader.

As for your question about valid shape attributes - this line of the
docs explains it: "Valid shapes are cylinder, sphere, box and
cappedCylinder whose attributes are specified in section 2.1.2".  If you
look at section 2.1.2 all valid attributes are explained.

Thank you for pointing out the need for the transform element in the
'shape' mass mode - it was needed.

In a few minutes I shall upload the updated version.

Cheers,

Will.

On Fri, 2004-03-26 at 10:47, Royce Mitchell III wrote:
> I apologize if I'm sounding stupid here, but...
> 
> what's the difference between...
> 
> <body mass="5">
> ...
> </body>
> 
> and...
> 
> <body>
>    <mass density="5">
>    </mass>
> </body>
> 
> Is that redundant, or is my inexperience in ODE showing?
>
> And I hope I'm not bothering anyone but what does <mass total="1"> do 
> exactly (I can't tell from the document) ?
>
> Finally....
> 
> I don't see a way to combine masses that are not all at the same center 
> of gravity...
> 
> Is that supposed to be done like this?
> 
> <mass density="1" total="1">
>   <cylinder radius="1" length="2">
>     <transform>
>       <position x="0" y="0" z="0" />
>       <rotation x="0" y="90" z="0" aformat="degrees" />
>       <scale x="1" y="1" z="1" />        
>     </transform>
>   </cylinder>
> </mass>
> 
> If so, that invalidates using <cylinder radius="1" length="1" />, or, 
> rather, you could use this shortened form when no sub-elements are needed..
> 
> I.e., if no transform or anything else is needed inside it, you could use:
> 
> <cylinder radius="1" length="1" />
> 
> but if you do need transform, use what I pasted above.
> 
> Should there be some sort of documentation as to which arguments and 
> elements are mandatory? I.e. I think radius and length should both be 
> mandatory for <cylinder>
> 
> Sorry I got so long-winded :)
> 
-- 
William Denniss - will@ http://tanksoftware.com/



More information about the ODE mailing list