UNPKG

arx-convert

Version:

Converts various Arx Fatalis formats to JSON or YAML and back

18 lines 579 B
import { BinaryIO } from '../common/BinaryIO.js'; export class Vertex { static readFrom(binary) { // y before x is not a typo! const [y, x, z, u, v] = binary.readFloat32Array(5); return { x, y, z, u, v }; } static accumulateFrom({ x, y, z, u, v }) { const buffer = new ArrayBuffer(Vertex.sizeOf()); const binary = new BinaryIO(buffer); binary.writeFloat32Array([y, x, z, u, v]); return buffer; } static sizeOf() { return BinaryIO.sizeOfFloat32Array(5); } } //# sourceMappingURL=Vertex.js.map