I’ve looked around the docs, but just can’t seem to find a good observable to plug into so that I can have the XR controller’s orientation on every frame.
For example, I can easily plug into the xr.input.onControllerAddedObservable which gives me the inputSource. I want a similar one that will be called on every frame.
Or maybe there is a better observable that will only be called when the XR controller’s orientation changes (aka the user turns the controller).
EDIT:
So here’s a code snippet of what I was talking about earlier, but I need it to be happening on every frame though:
xr.input.onControllerAddedObservable.add(inputSource => {
const ray = new Ray(inputSource.pointer.absolutePosition, inputSource.pointer.forward, Infinity);
inputSource.getWorldPointerRayToRef(ray);
// The ray will supposedly give me the position and orientation of the pointer
});
Any help or even pointers to the appropriate docs will be appreciated. I know @RaananW probably knows the answer. Thanks for accepting my pull request BTW.