I have been playing around with the VR Demo Model and expand on some of its functionalities for our own uses, but I have stumbled on to a problem. When picking up one of the operator figurines from the table the figuring will of course rotate around as I rotate my virtual hand to simulate that its actually being held. This however only works as long as the view z-rotation is 0 (standing right in from of the table). But with the ability to teleport around the likelihood that the rotation remains 0 is rather small. If the figurines are picked up while facing in any other direction that the initial 0 rotation. The behavior of the objects held becomes rather weird.
This is natural since the function to get the hand rotation 'stick(controllerNum, STICK_VR_HAND_WORLD_ROTATION)' returns the real world rotation of the and in the flexsim environment, but it does not take into account that we might be facing in another direction. I hav tried to solve this by projecting the rotation of the hand into the coordinate space of the view using Vec3.project() but it is still not enough. I'm missing some king of Quaternion transform functionality as I have seen it in various game development environments, but I'm affraid my math-skills aren't quite up to the task. Can anyone help here?