diff --git a/src/Rotation.ts b/src/Rotation.ts index 42fb12fe..ee939b89 100644 --- a/src/Rotation.ts +++ b/src/Rotation.ts @@ -6,6 +6,10 @@ export class Rotation extends Euler { return new Rotation(MathUtils.degToRad(a), MathUtils.degToRad(b), MathUtils.degToRad(g), 'XYZ') } + static fromThreeJsEuler(euler: Euler) { + return new Rotation(euler.x, euler.y, euler.z) + } + reorder(newOrder: EulerOrder) { const { x, y, z } = super.reorder(newOrder) diff --git a/src/Vector3.ts b/src/Vector3.ts index 16584081..a6290507 100644 --- a/src/Vector3.ts +++ b/src/Vector3.ts @@ -11,6 +11,10 @@ export class Vector3 extends ThreeJsVector3 { return new Vector3(parseFloat(x) || 0, parseFloat(y) || 0, parseFloat(z) || 0) } + static fromThreeJsVector3(vector: ThreeJsVector3) { + return new Vector3(vector.x, vector.y, vector.z) + } + toArxVector3(): ArxVector3 { return { x: this.x, y: this.y, z: this.z } }