Help on combining objests

Hello, guys
I am a new in jME, recently I want to combine different objects in right order. Exactly, I want put one object into the very place of another objects, how do I make sure the fomer objets is added to the exact coordinate of the later one. I wonder If I can put a node in the later objects? So I just need attach fomer objects in the node.

you mean the Pivot Node?

Assuming the two objects are represented by spatials with the same parent Node:

        Vector3f offset1 = object1.getLocalTranslation().clone();

If they’re parented by different nodes, you might have to do arithmetic to compensate for the offset/rotation/scaling between the parents.

…and note: the clone is unnecessary in this case.

Clone is unnecessary? So what else can I do?

Remove the clone() maybe? :wink:


Thanks, I will try this