The Oculus Go SDK, under the hood, calculates a position for the controller based on some IK model of the body, shoulder, and arm, which updates in mysterious ways. For example, if I turn my head quickly or by small amounts, the virtual arm stays put, but if I turn more slowly or by a greater amount, then the arm rotates in a way that indicates the invisible body is rotating too.
I'd like to get that body rotation, so I can draw a bit of a body model, an opposite arm, etc.
Does anybody know how/whether it is possible to get the transform (rotation) of the body?
If not, I can probably calculate something usable from the position and orientation of the tracked controller, but if there's a more direct way to get it, I'd love to hear about it.
Go and Gear controllers only report orientation, so the controller position that is reported by VrApi is generated using a simulation model where the only input is the current rotation of the controller. The model maintains additional state, which includes a representation of the torso, clavicle, shoulder, elbow and wrist.
Because we only know the current orientation of the controller, this model's output is just a guess. The model is intentionally simplified and tweaked to work for a UI-heavy experience where the user's upper arm is mostly held at a rest position against their torso. There are many potential variations on the model and its parameters that could provide better simulation for other scenarios.
The reason you see the body rotation is that the model essentially starts its torso out facing the headset direction. When the head turns more than some threshold (I think it's 30 degrees by default) then the torso is "pulled" along with the head rotation. The controller rotation only affects the arm joints and not the torso direction.
We don't provide a way to see the joint positions and orientations for this model for several reasons: - with just an orientation, there was no way we could make an arm model that satisfied all possible use cases. - we expect developers in many cases will want to use their own model or a variation of our model - developers who need specific behaviors should write their own arm model. - we consider the current model an implementation detail (it could change at any time)
However, all is not lost. If you check in the VrController sample code that comes in the Oculus Mobile SDK, the entire arm model is there for you to use. The code is C++, so you may need to transcribe it into another language, but it should be straight forward. The code should not be expensive from a performance perspective, so it's recommended you just execute it from your code, passing in the orientation of the controller each frame and using the resulting position instead of the one returned by VrApi.