UNPKG

arx-level-generator

Version:
24 lines 719 B
import { Euler, MathUtils } from 'three'; export class Rotation extends Euler { static fromArxRotation({ a, b, g }) { return new Rotation(MathUtils.degToRad(a), MathUtils.degToRad(b), MathUtils.degToRad(g), 'XYZ'); } static fromThreeJsEuler(euler) { return new Rotation(euler.x, euler.y, euler.z); } reorder(newOrder) { const { x, y, z } = super.reorder(newOrder); this.x = x; this.y = y; this.z = z; return this; } toArxRotation() { return { a: MathUtils.radToDeg(this.x), b: MathUtils.radToDeg(this.y), g: MathUtils.radToDeg(this.z), }; } } //# sourceMappingURL=Rotation.js.map