I’m trying to create a WebXR app for the Meta Quest 2. I used the sample project from raanan to set up babylon.js locally and everything works fine. Next I wanted to try out the AR hit test sample (which works when I start it in the playground) as a new scene and tried to translate the javascript code to typescript. But on this part…
xrTest.onHitTestResultObservable.add((results) => {
if (results.length) {
marker.isVisible = true;
const hitTest = results[0];
hitTest.transformationMatrix.decompose(
marker.scaling,
marker.rotationQuaternion,
marker.position
);
} else {
marker.isVisible = false;
}
});
…intellisense tells me on xrTest “Property ‘onHitTestResultObservable’ does not exist on type ‘IWebXRFeature’.” I don’t really understand the problem, since it works in javascript. What exactly is the problem and how should I fix it?
Also, is there a way to save a playground as a typescript file? Or generally speaking, how should I proceed if I wanted to save a playground scene as a typescript file, which I can then use in my project?