ARVRController nodes & mesh translation vis script discarding parent's rotation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Constannnnnt

Hi, I am interested in translating the ARVRController nodes by an offset via gdscript, like teleporting these controller nodes to a specific location without changing the camera’s position. Since ARVRContoller nodes’ position is managed by the ARVRServer, I don’t know whether there is an approach where I can access ARVRServer and apply the transformation there to update the ARVRController nodes’ positions directly.

My initial thought was to only translate the children mesh instances to achieve the visual effect via


However, it seemed that these offsets were scaled or multiplied by the mesh’s parent’s (i.e. controller nodes) transformation so what I can see is that the translated mesh’s position moves a large extent (probably the offset is multiplied by the rotation matrix of mesh’s parent) when I am trying to rotate the controller a little bit.

For example, without offset, the mesh’s position and rotation is a 1-to-1 mapping to those of controller nodes. With such offset, the expected result is only the mesh being translated to (x, y,z) but the rotation is still a 1-to-1 mapping, however, the current result was when I rotating 30 degrees (either clockwise or counter-clockwise), the mesh’s position was translated horizontally or vertically.

I also tried to translate the object locally, but it did not work well.


Besides this approach, is there any other way that I can solve this question. Some math thoughts are also helpful.

Any help appreciated, thanks.

:bust_in_silhouette: Reply From: Constannnnnt

Well, to avoid the scale effect from the parent (basically through the matrix multiplication), I created ghost(dummy) objects and manipulate these objects directly instead of using parent-child relationship.