[SOLVED] Move and rotate child spatial from parent node affecting local translation

Hello :smiley: I was wondering, is there a way you can move and rotate a spatial from it’s parent node, but affecting it’s local translation?

Let’s say I have a box, I set it’s rotation/pivot point with a node on the corner of the box, I rotate it, it doesn’t affect it’s local translation.

I’ve searched everywhere and couldn’t find anything :frowning:



Thanks!

You mean it doesn’t affect the local translation of the box or the node? The box’s translation should be updated (rotation and translation), but the node’s should remain the same.



Maybe I’m misunderstanding.

The box. From what I’ve read here https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:scenegraph_for_dummies I don’t think it can affect it’s local translation. :frowning:

I’m trying to make a spatial orbit around another spatial with lookAt() but I need to get it’s local XYZ coordinates but they never change because moving/rotating a node doesn’t affect it’s child’s local translation.

use lookAt with the child’s world translation.



Theres 2 principle ways to do the rotating that come to mind

  • Offset the child and rotate the parent node (like what ur trying)
  • Offset the child and use that as a direction vector, and multiply a quaternion by this



    Read the math for dummies for this

I solved it! All I had to do was subtract the spatial’s world translation that the other spatial orbits around. Thanks for the help guys! :wink: