-
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 4 replies
-
Browser: [Edge] I understand this is supposed to be part of the browser API like document or window. However, there definitions can still be located. Neither Visual Studio or ng build can located the definition for XRRigidTransform. It shows up as an import from three, but then complains that it can't be found during build. I just need a confirmation that I'm not the only one seeing this problem and some suggestions (from your vast knowledge) on some things to try next. |
Beta Was this translation helpful? Give feedback.
-
If I paste this code in a new angular project, I get the same build error, so its nothing related to three or angular-three. What am I missing? |
Beta Was this translation helpful? Give feedback.
-
Have you had a chance to check the above code works in any of your angular projects? The following works <html lang="en">
<body>
<script type="module">
let transform = new XRRigidTransform();
console.warn(transform)
</script>
</body>
</html> but not when the same two lines of code are added to a new angular project. |
Beta Was this translation helpful? Give feedback.
-
I tried this. It didn't help. Did this work for you? |
Beta Was this translation helpful? Give feedback.
-
I used the following work-around for now. I created a Javascript XRUtils file function RigidTransformXR(args) {
return new XRRigidTransform(args);
} Updated angular.json to reference file in scripts "scripts": [
"src/assets/XRUtils.js"
] Then in component where I want to call, I added declaration declare var RigidTransformXR: any;
...
const offsetPosition = { x: 0, y: 0, z: 0, w: 1 };
const offsetRotation = { x: 0, y: 0, z: 0, w: 1 };
const transform = new RigidTransformXR(offsetPosition, offsetRotation); |
Beta Was this translation helpful? Give feedback.
-
can you zip your project and share? |
Beta Was this translation helpful? Give feedback.
-
Apparently adding `types: ["webxr"] to tsconfig doesn't work, but adding to tsconfig.app.json does work. |
Beta Was this translation helpful? Give feedback.
Apparently adding `types: ["webxr"] to tsconfig doesn't work, but adding to tsconfig.app.json does work.