Does LocalRotation influence LocalTranslation?


I have got three objects A, B, C. B is child spatial of A and C is child spatial of B.


A is positioned somewehere in 3D space.

B is positioned to A with setlocalTranslation

C is positioned to B with setlocalTranslation

Now I want to get the translationVector between A and C.


public static final Vector3f getTranslationRelativeTo(Spatial parent, Spatial child) {

return child.getWorldTranslation().subtract(parent.getWorldTranslation());




is this the correct way? Does the rotation of C relative to B and the rotation of B relative to A influence the result?




You will miss out on rotations between them in that case. The best way is probably to go local to world on the child and then world to local on the parent.,%20com.jme3.math.Vector3f),%20com.jme3.math.Vector3f)