nartc / angular-three

🧊 THREE.js integration for Angular 🧊
https://angular-three.netlify.app/
MIT License
306 stars 26 forks source link

Error: export 'XRRigidTransform' (imported as 'XRRigidTransform') was not found in 'three' #126

Closed IRobot1 closed 2 years ago

IRobot1 commented 2 years ago

I'm trying to convert the following VR teleport example to NGT.

Build fails when referencing XRRigidTransform from Angular project

import { XRInputSource, XRRigidTransform } from "three";
...
      const offsetPosition = { x: 0, y: 0, z: 0, w: 1 };
      const offsetRotation = new Quaternion();
      const transform = new XRRigidTransform(offsetPosition, offsetRotation);

XRInputSource (interface) is found, but XRRigidTransform (class) is not.

Any suggestions is appreciated.

nartc commented 2 years ago

XRRigidTransform is WebXR API and not part of three APIs. https://developer.mozilla.org/en-US/docs/Web/API/XRRigidTransform

IRobot1 commented 2 years ago

Understood. If you add the following code to any sandbox project

        const offsetPosition = { x: 0, y: 0, z: 0, w: 1 };
        const offsetRotation = { x: 0, y: 0, z: 0, w: 1 };
        const transform = new XRRigidTransform(offsetPosition, offsetRotation);

Can you confirm you get the following error? I'm using Visual Studio Professional.

image

ng build shows the following error image

IRobot1 commented 2 years ago

Why do you close an issue before the person asking the question has confirmed your answer? That really bugs me when you do that.

nartc commented 2 years ago

Because there's no actionable item from the library's perspective. There is nothing that I can add to Angular Three API to fix your issue. If you like, you can convert this to a discussion instead. As a maintainer, Issue shows the number of issues whereas Discussion does not, it gives me less stress on maintaining the library.