[ODE] Copying/Cloning Composite Objects

john rieffel jrieffel at gmail.com
Thu Aug 4 22:08:48 MST 2005


Hi Folks,

I'm getting back into ODE after a brief sabbatical from hacking. 
Here's my question:

I've learned (thanks to matt hancher) how to create a single composite
object given a set of individual bodies, by using a dGeomTransform. 
Now that I've created such a composite, I can place it in the world
and watch it behave, which is quite satisfying.

Now I'd like to be able to "clone" said composite object.  For
instance, say that I've encapsulated a bunch of fobs into a "widget"
object, and now I'd like to place 10 geometrically identical such
widgets throughout the world - what's the best way to do this?

Are there any utility functions or obvious shortcuts for how to make
copies of such a dGeomTransform?  Or, do I have to hand-write a
function which, given a target dGeomTransform, creates a new body in
the world (corresponding to the clone), copy the object's mass and
then copy each of the geoms to the clone, etc etc etc?

Now that I've listed it all out it doesn't seem that bad after all,
but I get the impression that someone else must have come across this
problem (and solved it elegantly) - so I'd rather not repeat someone
else's work.

Thanks,
John Rieffel



More information about the ODE mailing list