[ODE] Material and triangle index

Geoff Carlton gcarlton at iinet.net.au
Sat Jan 15 17:24:28 MST 2005

I believe a single index for each geom in the contact structure would be 
best - thus, two integers.  This would be the triangle index for 
trimeshes, and the "side" for the other primitives (for boxes, it would 
be a number from 0 to 5).  Using this information, we can do whatever we 
want.  As soon as we discard this and instead return an ode-specific 
"material", we lose generality.

Materials are really an app side concept.  We already have the userdata 
pointer for each geom that is very capable of holding whatever app 
specific data we would ever need.  If its a int, so be it.  Or it could 
be a complex struct with sound information, bump or whatever.  The fact 
that we are talking about making a "material" into a void* indicates 
that we are converging back to the userdata concept, which we already 
have now!

As pointed out, we may want one material associated with a box geom.  
However we may want surface properties depending on the side of a box 
that was hit.  Both of these can be dealt with by examining the geom 
(and its userdata) and the "side" index.  The concept of a single 
material would fail here.  Similarly the implementation of trimesh 
materials can be done in a number of ways.  In all cases, it is simple 
to go from the "side" index to the material on the app side, but 
difficult if the inappropriate implemenation is already integrated with 
ode itself.


More information about the ODE mailing list