UNPKG

arx-level-generator

Version:
21 lines 699 B
import { Vector3 } from './Vector3.js'; import { uniq } from './faux-ramda.js'; import { getNonIndexedVertices } from './tools/mesh/getVertices.js'; export class Vectors extends Array { static fromThreejsGeometry(geometry) { const vectors = new Vectors(); getNonIndexedVertices(geometry).forEach(({ vector }) => { vector.y *= -1; vectors.push(vector); }); return vectors; } uniq() { const vectors = new Vectors(); uniq(this.map((vector) => vector.toString())).forEach((coords) => { vectors.push(Vector3.fromString(coords)); }); return vectors; } } //# sourceMappingURL=Vectors.js.map