UNPKG

arx-level-generator

Version:
51 lines 1.33 kB
import { Vector3 } from './Vector3.js'; export class Path { name; points; constructor(props) { this.name = props.name; this.points = props.points; } clone() { return new Path({ name: this.name, points: this.points.map((point) => { return { position: point.position.clone(), type: point.type, time: point.time, }; }), }); } static fromArxPath(path) { return new Path({ name: path.name, points: path.points.map((point) => { return { position: Vector3.fromArxVector3(point.pos), type: point.type, time: point.time, }; }), }); } toArxPath() { return { name: this.name, points: this.points.map((point) => { return { pos: point.position.toArxVector3(), type: point.type, time: point.time, }; }), }; } move(offset) { this.points.forEach((point) => { point.position.add(offset); }); } } //# sourceMappingURL=Path.js.map