[ODE] Composite geometry
Klaus.Backert at t-online.de
Tue Oct 3 08:58:22 MST 2006
Am 03.10.2006 um 13:34 schrieb Tommy Persson:
> The manual (for 0.5) says that if you want two bodies glued together
> it is better to represent them as one body. But how do you do that?
> Are there example code anywhere?
> I want to have a geometry consisting of five geometry boxes. So I
> thought I could use geometry transform and add more than one geometry
> to a body but the manual indicates that only one geometry can be added
> to a body.
In the ODE 0.5 user guide I read in chapter 9.5:
"No extra functions are needed to manage composite objects: simply
create each component geom and
attach it to the same body. To move and rotate the separate geoms
with respect to each other in the same
object, geometry transforms can be used to encapsulate
them. ... ... ... However there is one caveat: You should never
create a composite object that will result in collision points being
generated very close together."
BTW the references between the body and its geoms and from one geom
to the next are internally managed by means of these instance variables:
in the dxBody struct:
dGeomID geom; // first collision geom associated with body
in the dxGeom struct:
dxGeom *body_next; // next geom in body's linked list of associated
(notice: typedef dxGeom *dGeomID;)
IMHO, according to documentation and to code, attaching several
geometries to a body should work. Isn't this the same in versions 0.6
> I tried to join together five bodies but it seems that if the geometry
> fits to closely you get a system that behaves strangely (in my case
> rotated by itself).
> /Tommy Persson
More information about the ODE