[ODE] Copying/Cloning Composite Objects

Jaroslav Sinecky jsinecky at tiscali.cz
Fri Aug 5 09:17:58 MST 2005

I'm pretty sure, there are no cloning functions in ODE. As you say, it
shouldn't be problem to write them using Get/Set functions + dGeomGetClass.
Maybe someone has done it?

Eh ... actually the most simple way is just to call your creation routine
more times ;-) It works nice for me but I understand it could not be a good
solution for your scenario.


> -----Original Message-----
> From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf
> Of john rieffel
> Sent: Friday, August 05, 2005 4:09 AM
> To: ode at q12.org
> Subject: [ODE] Copying/Cloning Composite Objects
> 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
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode

More information about the ODE mailing list