www.jpct.net
jPCT - a 3d engine for Java => Support => Topic started by: hytparadisee on June 14, 2007, 08:39:02 pm
-
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?
-
You may get the mesh of the clone, clone it and set it again. That way, they don't share the same mesh.
-
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.
-
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?
-
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.
-
This looks like the best place to post this question, it's of a similar topic:
Question: Is there a better way to clone?
-
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.