Author Topic: Make a complete clone of an Object3D  (Read 4939 times)

Offline hytparadisee

  • int
  • **
  • Posts: 86
    • View Profile
    • http://peterhi.com
Make a complete clone of an Object3D
« 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?
Today I finally found a problem to my soluuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuution

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Make a complete clone of an Object3D
« Reply #1 on: June 14, 2007, 11:37:48 pm »
You may get the mesh of the clone, clone it and set it again. That way, they don't share the same mesh.

Offline hytparadisee

  • int
  • **
  • Posts: 86
    • View Profile
    • http://peterhi.com
Re: Make a complete clone of an Object3D
« Reply #2 on: June 15, 2007, 04:47:57 am »
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

Offline hytparadisee

  • int
  • **
  • Posts: 86
    • View Profile
    • http://peterhi.com
Re: Make a complete clone of an Object3D
« Reply #3 on: June 15, 2007, 05:18:20 am »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Make a complete clone of an Object3D
« Reply #4 on: June 15, 2007, 08:59:10 am »
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

  • Guest
Re: Make a complete clone of an Object3D
« Reply #5 on: October 09, 2007, 01:31:23 am »
This looks like the best place to post this question, it's of a similar topic:

Question: Is there a better way to clone?

« Last Edit: October 17, 2007, 04:26:08 am by Kearnan »

Kearnan

  • Guest
Re: Make a complete clone of an Object3D
« Reply #6 on: October 10, 2007, 02:41:52 am »
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.