Make a complete clone of an Object3D

Started by hytparadisee, June 14, 2007, 08:39:02 PM

Previous topic - Next topic

hytparadisee

Is it possible to clone an Object3D that is fully independent from the source object (don't share mesh etc.)? I want it cloned to the extent that it looks like loading the object twice from the model file?
Today I finally found a problem to my soluuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuution

EgonOlsen

You may get the mesh of the clone, clone it and set it again. That way, they don't share the same mesh.

hytparadisee

Thanks, the cloning works. But it doesn't seem to reset the location/orientation of the object. I know that's not required. Just want to ask how to properly reset the translation/origin/orientation of a cloned object.
Today I finally found a problem to my soluuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuution

hytparadisee

Arrrgghh. What a misconception i've made.

LOL, i mixed up the Object3D.translate() with the Node.setLocalTranslation() in jME. Object3D.translate() is actually doing the offset right?
Today I finally found a problem to my soluuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuution

EgonOlsen

Actually yes. But it depends a little bit on how you define offset. There also a setOrigin() which does basically the same as translate() but doesn't have an influence on child objects where translate() has.

Kearnan

#5
This looks like the best place to post this question, it's of a similar topic:

Question: Is there a better way to clone?


Kearnan

Err, nevermind.  Lame question.  I can just check to see if I've already loaded it, copy the Mesh and go from there.  I don't know why that seemed too obscure yesterday.