@bis-toolkit/p3d 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +58 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2265 -0
- package/dist/index.js.map +7 -0
- package/dist/mlod/Face.d.ts +19 -0
- package/dist/mlod/FaceFlags.d.ts +8 -0
- package/dist/mlod/Mlod.d.ts +39 -0
- package/dist/mlod/MlodLod.d.ts +30 -0
- package/dist/mlod/Point.d.ts +26 -0
- package/dist/mlod/PointFlags.d.ts +9 -0
- package/dist/mlod/Tagg.d.ts +53 -0
- package/dist/mlod/TaggReader.d.ts +18 -0
- package/dist/mlod/Vector3.d.ts +29 -0
- package/dist/mlod/Vertex.d.ts +12 -0
- package/dist/mlod/index.d.ts +15 -0
- package/dist/odol/Animation.d.ts +48 -0
- package/dist/odol/Animations.d.ts +12 -0
- package/dist/odol/Materials.d.ts +51 -0
- package/dist/odol/ModelInfo.d.ts +71 -0
- package/dist/odol/Odol.d.ts +47 -0
- package/dist/odol/OdolLod.d.ts +75 -0
- package/dist/odol/OdolReader.d.ts +30 -0
- package/dist/odol/PackedColor.d.ts +14 -0
- package/dist/odol/VertexData.d.ts +52 -0
- package/dist/odol/auxiliaryStructures.d.ts +49 -0
- package/dist/odol/enums.d.ts +104 -0
- package/dist/odol/index.d.ts +14 -0
- package/dist/odol/math.d.ts +46 -0
- package/dist/odol/structures.d.ts +66 -0
- package/dist/shared/Lod.d.ts +5 -0
- package/dist/shared/P3d.d.ts +19 -0
- package/dist/shared/Resolution.d.ts +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/mlod/index.ts", "../../utils/src/BinaryReader.ts", "../../utils/src/Lz4.ts", "../../utils/src/Lzo.ts", "../../utils/src/Lzss.ts", "../src/mlod/Vector3.ts", "../src/mlod/PointFlags.ts", "../src/mlod/Point.ts", "../src/mlod/Vertex.ts", "../src/mlod/Face.ts", "../src/mlod/TaggReader.ts", "../src/shared/Resolution.ts", "../src/mlod/MlodLod.ts", "../src/mlod/Mlod.ts", "../src/mlod/FaceFlags.ts", "../src/odol/index.ts", "../src/odol/math.ts", "../src/odol/Animation.ts", "../src/odol/Animations.ts", "../src/odol/OdolReader.ts", "../src/odol/enums.ts", "../src/odol/PackedColor.ts", "../src/odol/auxiliaryStructures.ts", "../src/odol/Materials.ts", "../src/odol/structures.ts", "../src/odol/VertexData.ts", "../src/odol/OdolLod.ts", "../src/odol/ModelInfo.ts", "../src/odol/Odol.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * MLOD (Bohemia Interactive model format) reader library\n */\n\nexport { Mlod } from './Mlod';\nexport { MlodLod } from './MlodLod';\nexport { Face } from './Face';\nexport { Vertex } from './Vertex';\nexport { Point } from './Point';\nexport { Vector3 } from './Vector3';\nexport { FaceFlags } from './FaceFlags';\nexport { PointFlags } from './PointFlags';\nexport { TaggReader } from './TaggReader';\nexport {\n\ttype Tagg,\n\ttype AnimationTagg,\n\ttype LockTagg,\n\ttype MassTagg,\n\ttype PropertyTagg,\n\ttype SelectedTagg,\n\ttype SharpEdgesTagg,\n\ttype UVSetTagg,\n\ttype NamedSelectionTagg,\n\ttype EndOfFileTagg\n} from './Tagg';\nexport { getLodName } from '../shared/Resolution';\n\n// Re-export utilities for convenience\nexport { BinaryReader } from '@bis-toolkit/utils';\n", "/**\n * Binary reader utility for reading binary data from a buffer\n * Works with both Node.js Buffer and browser Uint8Array\n */\nexport class BinaryReader {\n protected buffer: Uint8Array;\n protected view: DataView;\n protected position = 0;\n\n constructor(buffer: Buffer | Uint8Array) {\n // Ensure we have a Uint8Array - Buffer extends Uint8Array so instanceof check covers both\n this.buffer = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);\n this.view = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength);\n }\n\n get length(): number {\n return this.buffer.length;\n }\n\n get pos(): number {\n return this.position;\n }\n\n seek(offset: number, origin: 'begin' | 'current' | 'end' = 'begin'): void {\n switch (origin) {\n case 'begin':\n this.position = offset;\n break;\n case 'current':\n this.position += offset;\n break;\n case 'end':\n this.position = this.buffer.length + offset;\n break;\n }\n }\n\n readByte(): number {\n const value = this.view.getUint8(this.position);\n this.position += 1;\n return value;\n }\n\n readUInt16(): number {\n const value = this.view.getUint16(this.position, true); // true = little endian\n this.position += 2;\n return value;\n }\n\n readUInt32(): number {\n const value = this.view.getUint32(this.position, true);\n this.position += 4;\n return value;\n }\n\n readInt32(): number {\n const value = this.view.getInt32(this.position, true);\n this.position += 4;\n return value;\n }\n\n readInt24(): number {\n const b1 = this.view.getUint8(this.position);\n const b2 = this.view.getUint8(this.position + 1);\n const b3 = this.view.getUint8(this.position + 2);\n this.position += 3;\n return b1 | (b2 << 8) | (b3 << 16);\n }\n\n readBytes(count: number): Uint8Array {\n const bytes = this.buffer.subarray(this.position, this.position + count);\n this.position += count;\n return bytes;\n }\n\n readRawString(length: number): string {\n const bytes = this.buffer.subarray(this.position, this.position + length);\n this.position += length;\n return String.fromCharCode(...bytes);\n }\n\n readFloat(): number {\n const value = this.view.getFloat32(this.position, true);\n this.position += 4;\n return value;\n }\n\n readBoolean(): boolean {\n return this.readByte() !== 0;\n }\n\n /**\n * Read a null-terminated C-style string\n */\n readCString(): string {\n const start = this.position;\n let end = start;\n \n // Find null terminator\n while (end < this.buffer.length && this.buffer[end] !== 0) {\n end++;\n }\n \n const bytes = this.buffer.subarray(start, end);\n this.position = end + 1; // Skip null terminator\n \n // Decode as UTF-8\n const decoder = new TextDecoder('utf-8');\n return decoder.decode(bytes);\n }\n\n /**\n * Alias for readRawString for compatibility\n */\n readString(length: number): string {\n return this.readRawString(length);\n }\n}\n", "import { BinaryReader } from './BinaryReader';\n\n/**\n * Decompresses an LZ4 block with the declared size from the reader.\n * This implementation supports LZ4 chain decoder which maintains a dictionary across chunks.\n * \n * @param reader - Binary reader positioned at the start of the LZ4 block\n * @param declaredSize - The declared size of the LZ4 block (including headers)\n * @returns Decompressed data as Uint8Array\n */\nexport function decompressLz4Block(reader: BinaryReader, declaredSize: number): Uint8Array {\n const startPos = reader.pos;\n const targetSize = reader.readUInt32();\n const target = new Uint8Array(targetSize);\n let targetIdx = 0;\n\n // LZ4 chain decoder - maintains dictionary across chunks\n const LzBlockSize = 65536;\n const dict = new Uint8Array(LzBlockSize);\n let dictSize = 0;\n\n // Each chunk is: compressedSize (int24), flags (byte), compressedData\n while (true) {\n const compressedSize = reader.readInt24();\n const flags = reader.readByte();\n if ((flags & ~0x80) !== 0) {\n throw new Error(`Unknown LZ4 flags 0x${flags.toString(16)}`);\n }\n\n const compressed = reader.readBytes(compressedSize);\n const decoded = decompressLz4BlockWithDict(compressed, dict, dictSize);\n if (targetIdx + decoded.length > target.length) {\n throw new Error('Decoded LZ4 data overruns target buffer');\n }\n target.set(decoded, targetIdx);\n targetIdx += decoded.length;\n\n // Update dictionary with decoded data\n if (decoded.length >= LzBlockSize) {\n // Copy last LZ_BLOCK_SIZE bytes\n dict.set(decoded.subarray(decoded.length - LzBlockSize));\n dictSize = LzBlockSize;\n } else {\n // Append to dictionary, possibly overflowing\n const available = LzBlockSize - dictSize;\n if (decoded.length <= available) {\n dict.set(decoded, dictSize);\n dictSize += decoded.length;\n } else {\n // Shift and append\n const shift = decoded.length - available;\n dict.copyWithin(0, shift);\n dict.set(decoded, LzBlockSize - decoded.length);\n dictSize = LzBlockSize;\n }\n }\n\n if ((flags & 0x80) !== 0) {\n break;\n }\n }\n\n if (startPos + declaredSize !== reader.pos) {\n throw new Error('LZ4 block length mismatch');\n }\n if (targetIdx !== targetSize) {\n throw new Error(`LZ4 decoded size mismatch (expected ${targetSize}, got ${targetIdx})`);\n }\n\n return target;\n}\n\n/**\n * Decompresses an LZ4 block with dictionary support.\n * \n * @param compressed - Compressed data\n * @param dict - Dictionary buffer for LZ4 chain decoder\n * @param dictSize - Current size of valid data in dictionary\n * @returns Decompressed data as Uint8Array\n */\nfunction decompressLz4BlockWithDict(compressed: Uint8Array, dict: Uint8Array, dictSize: number): Uint8Array {\n const output: number[] = [];\n let src = 0;\n\n while (src < compressed.length) {\n const token = compressed[src++];\n let literalLength = token >> 4;\n if (literalLength === 15) {\n let len = 0;\n do {\n len = compressed[src++];\n literalLength += len;\n } while (len === 255 && src < compressed.length);\n }\n\n // Copy literals\n for (let i = 0; i < literalLength; i++) {\n output.push(compressed[src++]);\n }\n\n if (src >= compressed.length) {\n break; // No more matches\n }\n\n const offset = compressed[src] | (compressed[src + 1] << 8);\n src += 2;\n\n let matchLength = token & 0x0f;\n if (matchLength === 15) {\n let len = 0;\n do {\n len = compressed[src++];\n matchLength += len;\n } while (len === 255 && src < compressed.length);\n }\n matchLength += 4;\n\n // LZ4 chain decoder: offset can reference into dictionary or output\n if (offset === 0) {\n throw new Error('Invalid LZ4 offset');\n }\n\n // Copy from dictionary and/or output\n const totalAvailable = dictSize + output.length;\n if (offset > totalAvailable) {\n throw new Error('Invalid LZ4 offset');\n }\n\n for (let i = 0; i < matchLength; i++) {\n const backPos = output.length - offset;\n if (backPos >= 0) {\n // Copy from output\n output.push(output[backPos]);\n } else {\n // Copy from dictionary\n const dictPos = dictSize + backPos;\n output.push(dict[dictPos]);\n }\n }\n }\n\n return Uint8Array.from(output);\n}\n", "/**\n * LZO1X compression and decompression\n * Based on https://github.com/thaumictom/lzo-ts\n * @license GPL-3.0\n */\n\nexport interface LzoDecompressResult {\n data: Uint8Array;\n bytesRead: number;\n}\n\n/**\n * Compress and decompress data using the LZO1X-1 algorithm.\n */\nexport class LZO {\n private _blockSize = 128 * 1024;\n\n public get blockSize(): number {\n return this._blockSize;\n }\n\n public set blockSize(value: number) {\n if (value <= 0) throw new Error('Block size must be a positive integer');\n this._blockSize = value;\n }\n\n private _minNewSize = this.blockSize;\n\n private _out = new Uint8Array(256 * 1024);\n private _cbl = 0;\n private _t = 0;\n\n private _inputPointer = 0;\n private _outputPointer = 0;\n private _matchPosition = 0;\n\n private _skipToFirstLiteralFunc = false;\n\n private _buffer!: Uint8Array;\n\n private _extendBuffer(): void {\n const newBuffer = new Uint8Array(\n this._minNewSize + (this.blockSize - (this._minNewSize % this.blockSize))\n );\n\n newBuffer.set(this._out);\n\n this._out = newBuffer;\n this._cbl = this._out.length;\n }\n\n private _matchNext(): void {\n this._minNewSize = this._outputPointer + 3;\n\n if (this._minNewSize > this._cbl) this._extendBuffer();\n\n this._out[this._outputPointer++] = this._buffer[this._inputPointer++];\n\n if (this._t > 1) {\n this._out[this._outputPointer++] = this._buffer[this._inputPointer++];\n if (this._t > 2) {\n this._out[this._outputPointer++] = this._buffer[this._inputPointer++];\n }\n }\n\n this._t = this._buffer[this._inputPointer++];\n }\n\n private _matchDone(): number {\n this._t = this._buffer[this._inputPointer - 2] & 3;\n return this._t;\n }\n\n private _copyMatch(): void {\n this._t += 2;\n this._minNewSize = this._outputPointer + this._t;\n if (this._minNewSize > this._cbl) {\n this._extendBuffer();\n }\n\n do {\n this._out[this._outputPointer++] = this._out[this._matchPosition++];\n } while (--this._t > 0);\n }\n\n private _copyFromBuffer(): void {\n this._minNewSize = this._outputPointer + this._t;\n if (this._minNewSize > this._cbl) {\n this._extendBuffer();\n }\n\n do {\n this._out[this._outputPointer++] = this._buffer[this._inputPointer++];\n } while (--this._t > 0);\n }\n\n private _match(): boolean | Uint8Array {\n while (true) {\n if (this._t >= 64) {\n this._matchPosition =\n this._outputPointer -\n 1 -\n ((this._t >> 2) & 7) -\n (this._buffer[this._inputPointer++] << 3);\n this._t = (this._t >> 5) - 1;\n\n this._copyMatch();\n } else if (this._t >= 32) {\n this._t &= 31;\n\n if (this._t === 0) {\n while (this._buffer[this._inputPointer] === 0) {\n this._t += 255;\n this._inputPointer++;\n }\n\n this._t += 31 + this._buffer[this._inputPointer++];\n }\n\n this._matchPosition =\n this._outputPointer -\n 1 -\n (this._buffer[this._inputPointer] >> 2) -\n (this._buffer[this._inputPointer + 1] << 6);\n this._inputPointer += 2;\n\n this._copyMatch();\n } else if (this._t >= 16) {\n this._matchPosition = this._outputPointer - ((this._t & 8) << 11);\n\n this._t &= 7;\n\n if (this._t === 0) {\n while (this._buffer[this._inputPointer] === 0) {\n this._t += 255;\n this._inputPointer++;\n }\n\n this._t += 7 + this._buffer[this._inputPointer++];\n }\n\n this._matchPosition -=\n (this._buffer[this._inputPointer] >> 2) +\n (this._buffer[this._inputPointer + 1] << 6);\n this._inputPointer += 2;\n\n // End reached\n if (this._matchPosition === this._outputPointer) {\n return this._out.subarray(0, this._outputPointer);\n } else {\n this._matchPosition -= 0x4000;\n this._copyMatch();\n }\n } else {\n this._matchPosition =\n this._outputPointer - 1 - (this._t >> 2) - (this._buffer[this._inputPointer++] << 2);\n\n this._minNewSize = this._outputPointer + 2;\n\n if (this._minNewSize > this._cbl) {\n this._extendBuffer();\n }\n\n this._out[this._outputPointer++] = this._out[this._matchPosition++];\n this._out[this._outputPointer++] = this._out[this._matchPosition];\n }\n\n if (this._matchDone() === 0) {\n return true;\n }\n\n this._matchNext();\n }\n }\n\n private _decompressBuffer(buffer: Uint8Array): Uint8Array {\n this._buffer = buffer;\n\n this._cbl = this._out.length;\n\n this._t = 0;\n this._inputPointer = 0;\n this._outputPointer = 0;\n this._matchPosition = 0;\n\n this._skipToFirstLiteralFunc = false;\n\n if (this._buffer[this._inputPointer] > 17) {\n this._t = this._buffer[this._inputPointer++] - 17;\n\n if (this._t < 4) {\n this._matchNext();\n\n const matched = this._match();\n\n if (matched !== true) return matched as Uint8Array;\n } else {\n this._copyFromBuffer();\n this._skipToFirstLiteralFunc = true;\n }\n }\n\n while (true) {\n if (!this._skipToFirstLiteralFunc) {\n this._t = this._buffer[this._inputPointer++];\n\n if (this._t >= 16) {\n const matched = this._match();\n\n if (matched !== true) return matched as Uint8Array;\n\n continue;\n } else if (this._t === 0) {\n while (this._buffer[this._inputPointer] === 0) {\n this._t += 255;\n this._inputPointer++;\n }\n\n this._t += 15 + this._buffer[this._inputPointer++];\n }\n\n this._t += 3;\n this._copyFromBuffer();\n } else this._skipToFirstLiteralFunc = false;\n\n this._t = this._buffer[this._inputPointer++];\n\n if (this._t < 16) {\n this._matchPosition = this._outputPointer - (1 + 0x0800);\n this._matchPosition -= this._t >> 2;\n this._matchPosition -= this._buffer[this._inputPointer++] << 2;\n\n this._minNewSize = this._outputPointer + 3;\n\n if (this._minNewSize > this._cbl) {\n this._extendBuffer();\n }\n\n this._out[this._outputPointer++] = this._out[this._matchPosition++];\n this._out[this._outputPointer++] = this._out[this._matchPosition++];\n this._out[this._outputPointer++] = this._out[this._matchPosition];\n\n if (this._matchDone() === 0) continue;\n else this._matchNext();\n }\n\n const matched = this._match();\n\n if (matched !== true) return matched as Uint8Array;\n }\n }\n\n /**\n * Decompresses the given buffer using the LZO1X-1 algorithm.\n * @param buffer The buffer to decompress.\n * @returns The decompressed buffer.\n */\n static decompress(buffer: Uint8Array | number[]): Uint8Array {\n return new LZO()._decompressBuffer(buffer as Uint8Array);\n }\n\n /**\n * Decompresses the given buffer and returns both the decompressed data and bytes read.\n * @param buffer The buffer to decompress.\n * @returns Object containing decompressed data and number of bytes consumed from input.\n */\n static decompressWithSize(buffer: Uint8Array | number[]): LzoDecompressResult {\n const lzo = new LZO();\n const decompressed = lzo._decompressBuffer(buffer as Uint8Array);\n return {\n data: decompressed,\n bytesRead: lzo._inputPointer\n };\n }\n}\n\n/**\n * Simple decompression helper\n */\nexport function lzoDecompress(src: Uint8Array | Buffer, expectedSize: number): Uint8Array {\n const input = src instanceof Uint8Array ? src : new Uint8Array(src);\n const decompressed = LZO.decompress(input);\n\n if (decompressed.length !== expectedSize) {\n throw new Error(`LZO decompression size mismatch: expected ${expectedSize}, got ${decompressed.length}`);\n }\n\n return decompressed;\n}\n\n/**\n * Decompression with size tracking\n */\nexport function lzoDecompressWithSize(src: Uint8Array | Buffer, expectedSize: number): LzoDecompressResult {\n const input = src instanceof Uint8Array ? src : new Uint8Array(src);\n const result = LZO.decompressWithSize(input);\n\n if (result.data.length !== expectedSize) {\n throw new Error(`LZO decompression size mismatch: expected ${expectedSize}, got ${result.data.length}`);\n }\n\n return result;\n}\n", "/**\n * LZSS (Lempel-Ziv-Storer-Szymanski) decompression\n */\n\nconst N = 4096;\nconst F = 18;\nconst THRESHOLD = 2;\n\n/**\n * Decompress LZSS compressed data\n * @param input Input stream containing compressed data\n * @param expectedSize Expected size of decompressed output\n * @param useSignedChecksum Whether to use signed checksum calculation\n * @returns Object containing decompressed data and bytes read\n */\nexport function lzssDecompress(\n input: Buffer | Uint8Array,\n inputOffset: number,\n expectedSize: number,\n useSignedChecksum = false\n): { data: Uint8Array; bytesRead: number } {\n const buffer = new Array<number>(N + F - 1);\n const dst = new Uint8Array(expectedSize);\n\n if (expectedSize <= 0) {\n return { data: new Uint8Array(0), bytesRead: 0 };\n }\n\n const startPos = inputOffset;\n let inPos = inputOffset;\n let iDst = 0;\n\n let calculatedChecksum = 0;\n let r = N - F;\n \n // Initialize buffer with spaces\n for (let i = 0; i < r; i++) {\n buffer[i] = 0x20; // space character\n }\n\n let flags = 0;\n while (expectedSize > 0) {\n if (((flags >>>= 1) & 256) === 0) {\n const c = input[inPos++];\n flags = c | 0xff00;\n }\n\n if ((flags & 1) !== 0) {\n // Literal byte\n const c = input[inPos++];\n calculatedChecksum = (calculatedChecksum + (useSignedChecksum ? (c << 24 >> 24) : c)) | 0;\n dst[iDst++] = c;\n expectedSize--;\n \n // Update ring buffer\n buffer[r] = c;\n r = (r + 1) & (N - 1);\n } else {\n // Match (backreference)\n const i = input[inPos++];\n const j = input[inPos++];\n const offset = i | ((j & 0xf0) << 4);\n const length = (j & 0x0f) + THRESHOLD;\n\n if (length + 1 > expectedSize + length - THRESHOLD) {\n throw new Error('LZSS overflow');\n }\n\n let ii = r - offset;\n const jj = length + ii;\n \n for (; ii <= jj; ii++) {\n const c = buffer[ii & (N - 1)];\n calculatedChecksum = (calculatedChecksum + (useSignedChecksum ? (c << 24 >> 24) : c)) | 0;\n \n // Save byte\n dst[iDst++] = c;\n expectedSize--;\n \n // Update ring buffer\n buffer[r] = c;\n r = (r + 1) & (N - 1);\n }\n }\n }\n\n // Read and verify checksum using DataView\n const view = new DataView(input.buffer, input.byteOffset, input.byteLength);\n const checksum = view.getInt32(inPos, true); // true = little endian\n inPos += 4;\n\n if (checksum !== calculatedChecksum) {\n throw new Error(`Checksum mismatch: expected ${checksum}, got ${calculatedChecksum}`);\n }\n\n return {\n data: dst,\n bytesRead: inPos - startPos\n };\n}\n\n/**\n * Calculate CRC/checksum for data\n */\nexport function calculateChecksum(data: Buffer, signed = false): number {\n let checksum = 0;\n for (const byte of data) {\n checksum = (checksum + (signed ? (byte << 24 >> 24) : byte)) | 0;\n }\n return checksum;\n}\n", "/**\n * 3D Vector class\n */\nexport class Vector3 {\n constructor(\n public x: number = 0,\n public y: number = 0,\n public z: number = 0\n ) {}\n\n get length(): number {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n }\n\n static fromReader(reader: { readFloat(): number }): Vector3 {\n return new Vector3(\n reader.readFloat(),\n reader.readFloat(),\n reader.readFloat()\n );\n }\n\n /**\n * Returns a new Vector3 with the X coordinate flipped.\n * Useful for converting between coordinate systems (e.g., MLOD to Three.js)\n */\n flipX(): Vector3 {\n return new Vector3(-this.x, this.y, this.z);\n }\n\n /**\n * Returns a new Vector3 with the Y coordinate flipped.\n * Useful for converting between coordinate systems\n */\n flipY(): Vector3 {\n return new Vector3(this.x, -this.y, this.z);\n }\n\n /**\n * Returns a new Vector3 with the Z coordinate flipped.\n * Useful for converting between coordinate systems\n */\n flipZ(): Vector3 {\n return new Vector3(this.x, this.y, -this.z);\n }\n\n toArray(): [number, number, number] {\n return [this.x, this.y, this.z];\n }\n}\n", "/**\n * Point flags enum\n */\nexport enum PointFlags {\n None = 0,\n Selected = 1,\n Hidden = 2,\n Locked = 4\n}\n", "import { Vector3 } from './Vector3';\nimport { PointFlags } from './PointFlags';\nimport { BinaryReader } from '@bis-toolkit/utils';\n\n/**\n * Represents a vertex point in 3D space with flags\n */\nexport class Point extends Vector3 {\n public flags: PointFlags;\n\n constructor(x: number = 0, y: number = 0, z: number = 0, flags: PointFlags = PointFlags.None) {\n super(x, y, z);\n this.flags = flags;\n }\n\n static fromReader(reader: BinaryReader): Point {\n const x = reader.readFloat();\n const y = reader.readFloat();\n const z = reader.readFloat();\n const flags = reader.readUInt32() as PointFlags;\n return new Point(x, y, z, flags);\n }\n\n /**\n * Returns a new Point with the X coordinate flipped.\n * Useful for converting between coordinate systems (e.g., MLOD to Three.js)\n */\n flipX(): Point {\n return new Point(-this.x, this.y, this.z, this.flags);\n }\n\n /**\n * Returns a new Point with the Y coordinate flipped.\n * Useful for converting between coordinate systems\n */\n flipY(): Point {\n return new Point(this.x, -this.y, this.z, this.flags);\n }\n\n /**\n * Returns a new Point with the Z coordinate flipped.\n * Useful for converting between coordinate systems\n */\n flipZ(): Point {\n return new Point(this.x, this.y, -this.z, this.flags);\n }\n}\n", "import { BinaryReader } from '@bis-toolkit/utils';\n\n/**\n * Represents a face vertex with point/normal indices and UV coordinates\n */\nexport class Vertex {\n constructor(\n public pointIndex: number,\n public normalIndex: number,\n public u: number,\n public v: number\n ) {}\n\n static fromReader(reader: BinaryReader): Vertex {\n const pointIndex = reader.readInt32();\n const normalIndex = reader.readInt32();\n const u = reader.readFloat();\n const v = reader.readFloat();\n return new Vertex(pointIndex, normalIndex, u, v);\n }\n}\n", "import { BinaryReader } from '@bis-toolkit/utils';\nimport { Vertex } from './Vertex';\nimport { FaceFlags } from './FaceFlags';\n\n/**\n * Represents a face (polygon) in the model\n */\nexport class Face {\n public sidesCnt: number;\n public vertices: Vertex[];\n public flags: FaceFlags;\n public texture: string;\n public material: string;\n\n constructor(\n sidesCnt: number,\n vertices: Vertex[],\n flags: FaceFlags,\n texture: string,\n material: string\n ) {\n this.sidesCnt = sidesCnt;\n this.vertices = vertices;\n this.flags = flags;\n this.texture = texture;\n this.material = material;\n }\n\n static fromReader(reader: BinaryReader): Face {\n const sidesCnt = reader.readInt32();\n const vertices: Vertex[] = [];\n \n // Always read 4 vertices (padding with unused vertices if sidesCnt < 4)\n for (let i = 0; i < 4; i++) {\n vertices.push(Vertex.fromReader(reader));\n }\n\n const flags = reader.readInt32() as FaceFlags;\n const texture = reader.readCString();\n const material = reader.readCString();\n\n return new Face(sidesCnt, vertices, flags, texture, material);\n }\n\n /**\n * Get only the used vertices (based on sidesCnt)\n */\n getUsedVertices(): Vertex[] {\n return this.vertices.slice(0, this.sidesCnt);\n }\n}\n", "import { BinaryReader } from '@bis-toolkit/utils';\nimport { Face } from './Face';\nimport { Vector3 } from './Vector3';\nimport {\n type AnimationTagg,\n type EndOfFileTagg,\n type LockTagg,\n type MassTagg,\n type NamedSelectionTagg,\n type PropertyTagg,\n type SelectedTagg,\n type SharpEdgesTagg,\n type Tagg,\n type UVSetTagg\n} from './Tagg';\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class TaggReader {\n static readTaggs(reader: BinaryReader, verticesLength: number, faces: Face[]): Tagg[] {\n const taggSignature = reader.readString(4);\n if (taggSignature !== 'TAGG') {\n throw new Error('TAGG section expected');\n }\n\n const taggs: Tagg[] = [];\n while (reader.pos < reader.length) {\n const isActive = reader.readBoolean();\n if (!isActive) {\n throw new Error('Deactivated TAGG encountered');\n }\n\n const taggName = reader.readCString();\n const tagg = this.readTaggByName(reader, taggName, verticesLength, faces);\n taggs.push(tagg);\n\n if (tagg.name === '#EndOfFile#') {\n break;\n }\n }\n\n return taggs;\n }\n\n private static readTaggByName(reader: BinaryReader, taggName: string, verticesLength: number, faces: Face[]): Tagg {\n switch (taggName) {\n case '#Animation#':\n return this.readAnimationTagg(reader);\n case '#Lock#':\n return this.readLockTagg(reader, verticesLength, faces.length);\n case '#Mass#':\n return this.readMassTagg(reader);\n case '#Property#':\n return this.readPropertyTagg(reader);\n case '#Selected#':\n return this.readSelectedTagg(reader, verticesLength, faces.length);\n case '#SharpEdges#':\n return this.readSharpEdgesTagg(reader);\n case '#UVSet#':\n return this.readUvSetTagg(reader, faces);\n case '#EndOfFile#':\n return this.readEndOfFileTagg(reader);\n default:\n return this.readNamedSelectionTagg(reader, taggName, verticesLength, faces.length);\n }\n }\n\n private static readAnimationTagg(reader: BinaryReader): AnimationTagg {\n const dataSize = reader.readUInt32();\n const endPos = reader.pos + dataSize;\n\n const frameTime = reader.readFloat();\n const remainingBytes = endPos - reader.pos;\n const frameCount = Math.max(0, Math.floor(remainingBytes / 12));\n const framePoints: Vector3[] = new Array<Vector3>(frameCount);\n\n for (let i = 0; i < frameCount; i++) {\n framePoints[i] = Vector3.fromReader(reader);\n }\n\n this.ensureSectionEnd(reader, endPos, '#Animation#');\n return { kind: 'Animation', name: '#Animation#', frameTime, framePoints };\n }\n\n private static readLockTagg(reader: BinaryReader, verticesLength: number, facesLength: number): LockTagg {\n const dataSize = reader.readUInt32();\n const endPos = reader.pos + dataSize;\n\n const lockedPoints = new Array<boolean>(verticesLength);\n for (let i = 0; i < verticesLength; i++) {\n lockedPoints[i] = reader.readBoolean();\n }\n\n const lockedFaces = new Array<boolean>(facesLength);\n for (let i = 0; i < facesLength; i++) {\n lockedFaces[i] = reader.readBoolean();\n }\n\n this.ensureSectionEnd(reader, endPos, '#Lock#');\n return { kind: 'Lock', name: '#Lock#', lockedPoints, lockedFaces };\n }\n\n private static readMassTagg(reader: BinaryReader): MassTagg {\n const dataSize = reader.readUInt32();\n const endPos = reader.pos + dataSize;\n const entryCount = Math.max(0, Math.floor(dataSize / 4));\n const mass = new Array<number>(entryCount);\n\n for (let i = 0; i < entryCount; i++) {\n mass[i] = reader.readFloat();\n }\n\n this.ensureSectionEnd(reader, endPos, '#Mass#');\n return { kind: 'Mass', name: '#Mass#', mass };\n }\n\n private static readPropertyTagg(reader: BinaryReader): PropertyTagg {\n const dataSize = reader.readUInt32();\n if (dataSize !== 128) {\n throw new Error(`Unexpected #Property# data size: ${dataSize}`);\n }\n\n const endPos = reader.pos + dataSize;\n const propName = this.readFixedString(reader, 64);\n const propValue = this.readFixedString(reader, 64);\n\n this.ensureSectionEnd(reader, endPos, '#Property#');\n return { kind: 'Property', name: '#Property#', propName, propValue };\n }\n\n private static readSelectedTagg(reader: BinaryReader, verticesLength: number, facesLength: number): SelectedTagg {\n const dataSize = reader.readUInt32();\n const endPos = reader.pos + dataSize;\n\n const weightedPoints = reader.readBytes(verticesLength);\n const faces = new Array<boolean>(facesLength);\n for (let i = 0; i < facesLength; i++) {\n faces[i] = reader.readBoolean();\n }\n\n this.ensureSectionEnd(reader, endPos, '#Selected#');\n return { kind: 'Selected', name: '#Selected#', weightedPoints, faces };\n }\n\n private static readSharpEdgesTagg(reader: BinaryReader): SharpEdgesTagg {\n const dataSize = reader.readUInt32();\n const endPos = reader.pos + dataSize;\n const pairCount = Math.max(0, Math.floor(dataSize / 8));\n const pointIndices = new Array<[number, number]>(pairCount);\n\n for (let i = 0; i < pairCount; i++) {\n pointIndices[i] = [reader.readUInt32(), reader.readUInt32()];\n }\n\n this.ensureSectionEnd(reader, endPos, '#SharpEdges#');\n return { kind: 'SharpEdges', name: '#SharpEdges#', pointIndices };\n }\n\n private static readUvSetTagg(reader: BinaryReader, faces: Face[]): UVSetTagg {\n const dataSize = reader.readUInt32();\n const endPos = reader.pos + dataSize;\n const uvSetNr = reader.readUInt32();\n\n const faceUVs = new Array<[number, number][]>(faces.length);\n for (let faceIdx = 0; faceIdx < faces.length; faceIdx++) {\n const vertexCount = faces[faceIdx].sidesCnt;\n const uvs = new Array<[number, number]>(vertexCount);\n for (let uvIdx = 0; uvIdx < vertexCount; uvIdx++) {\n uvs[uvIdx] = [reader.readFloat(), reader.readFloat()];\n }\n faceUVs[faceIdx] = uvs;\n }\n\n this.ensureSectionEnd(reader, endPos, '#UVSet#');\n return { kind: 'UVSet', name: '#UVSet#', uvSetNr, faceUVs };\n }\n\n private static readNamedSelectionTagg(reader: BinaryReader, taggName: string, verticesLength: number, facesLength: number): NamedSelectionTagg {\n const dataSize = reader.readUInt32();\n const endPos = reader.pos + dataSize;\n\n const points = new Array<boolean>(verticesLength);\n for (let i = 0; i < verticesLength; i++) {\n points[i] = reader.readBoolean();\n }\n\n const faces = new Array<boolean>(facesLength);\n for (let i = 0; i < facesLength; i++) {\n faces[i] = reader.readBoolean();\n }\n\n this.ensureSectionEnd(reader, endPos, taggName);\n return { kind: 'NamedSelection', name: taggName, points, faces };\n }\n\n private static readEndOfFileTagg(reader: BinaryReader): EndOfFileTagg {\n const dataSize = reader.readUInt32();\n const endPos = reader.pos + dataSize;\n this.ensureSectionEnd(reader, endPos, '#EndOfFile#');\n return { kind: 'EndOfFile', name: '#EndOfFile#' };\n }\n\n private static readFixedString(reader: BinaryReader, length: number): string {\n const raw = reader.readRawString(length);\n const nullIndex = raw.indexOf('\\0');\n return nullIndex >= 0 ? raw.slice(0, nullIndex) : raw;\n }\n\n private static ensureSectionEnd(reader: BinaryReader, expectedEnd: number, taggName: string): void {\n if (reader.pos !== expectedEnd) {\n throw new Error(`TAGG ${taggName} length mismatch (expected end ${expectedEnd}, actual ${reader.pos})`);\n }\n }\n}\n", "\nexport function getLodName(resolution: number): string {\n if (approxEqual(resolution, 1000)) return 'View-Gunner';\n if (approxEqual(resolution, 1100)) return 'View-Pilot';\n if ((resolution > 1200 || approxEqual(resolution, 1200)) && resolution < 1300) {\n return `View-Cargo ${toFixedNumber(resolution, 1200)}`;\n }\n\n if (approxEqual(resolution, 1300)) return 'View-Cargo Fire Geom. [obsolete]';\n if ((resolution > 10000 || approxEqual(resolution, 10000)) && resolution < 20000) {\n return `ShadowVolume ${toFixedNumber(resolution, 10000)}`;\n }\n\n if ((resolution > 20000 || approxEqual(resolution, 20000)) && resolution < 30000) {\n return `Edit ${toFixedNumber(resolution, 20000)}`;\n }\n\n if (approxEqual(resolution, 1e13)) return 'Geometry';\n if (approxEqual(resolution, 2e13)) return 'Geometry Buoyancy';\n if (approxEqual(resolution, 3e13)) return 'Geometry Phys Old';\n if (approxEqual(resolution, 4e13)) return 'Geometry Phys';\n if (approxEqual(resolution, 100e13)) return 'Memory';\n if (approxEqual(resolution, 200e13)) return 'LandContact';\n if (approxEqual(resolution, 300e13)) return 'RoadWay';\n if (approxEqual(resolution, 400e13)) return 'Paths';\n if (approxEqual(resolution, 500e13)) return 'Hit-Points';\n if (approxEqual(resolution, 600e13)) return 'View Geometry';\n if (approxEqual(resolution, 700e13)) return 'Fire Geometry';\n if ((resolution > 800e13 || approxEqual(resolution, 800e13)) && resolution < 900e13) {\n return `View-Cargo Geom. ${toFixedNumber(resolution, 800e13)}`;\n }\n\n if (approxEqual(resolution, 900e13)) return 'View-Cargo Fire Geom. [obsolete]';\n if (approxEqual(resolution, 1000e13)) return 'View-Commander [obsolete]';\n if (approxEqual(resolution, 1100e13)) return 'View-Commander Geom. [obsolete]';\n if (approxEqual(resolution, 1200e13)) return 'View-Commander Fire Geom. [obsolete]';\n if (approxEqual(resolution, 1300e13)) return 'View-Pilot Geom.';\n if (approxEqual(resolution, 1400e13)) return 'View-Pilot Fire Geom. [obsolete]';\n if (approxEqual(resolution, 1500e13)) return 'View-Gunner Geom.';\n if (approxEqual(resolution, 1600e13)) return 'View-Gunner Fire Geom. [obsolete]';\n if (approxEqual(resolution, 1700e13)) return 'Sub Parts [obsolete]';\n if ((resolution > 1800e13 || approxEqual(resolution, 1800e13)) && resolution < 1900e13) {\n return `ShadowVolume - View Cargo ${toFixedNumber(resolution, 1800e13)}`;\n }\n\n if (approxEqual(resolution, 1900e13)) return 'ShadowVolume - View Pilot';\n if (approxEqual(resolution, 2000e13)) return 'ShadowVolume - View Gunner';\n if (approxEqual(resolution, 2100e13)) return 'Wreck';\n\n return resolution.toFixed(3);\n\n function toFixedNumber(value: number, subtract: number): string {\n return Math.max(0, value - subtract).toFixed(3)\n }\n\n function approxEqual(a: number, b: number, tolerance: number = 1e-5): boolean {\n if (Math.abs(a) > 1e10 || Math.abs(b) > 1e10) {\n const maxVal = Math.max(Math.abs(a), Math.abs(b));\n return Math.abs(a - b) <= maxVal * tolerance;\n }\n // For smaller numbers\n return Math.abs(a - b) <= tolerance;\n }\n}\n", "import { BinaryReader } from '@bis-toolkit/utils';\nimport { type Tagg } from './Tagg';\nimport { Point } from './Point';\nimport { Vector3 } from './Vector3';\nimport { Face } from './Face';\nimport { TaggReader } from './TaggReader';\nimport { getLodName } from '../shared/Resolution';\nimport { ILod } from '../shared/Lod';\n\n/**\n * Represents a single LOD (Level of Detail) in an MLOD model\n */\nexport class MlodLod implements ILod {\n public resolution: number = 0;\n public flags: number = 0;\n public vertices: Point[] = [];\n public normals: Vector3[] = [];\n public faces: Face[] = [];\n public taggs: Tagg[] = [];\n\n get resolutionName(): string {\n return getLodName(this.resolution);\n }\n\n get verticesCount(): number {\n return this.vertices.length;\n }\n\n get facesCount(): number {\n return this.faces.length;\n }\n\n /**\n * Get unique textures used in this LOD\n */\n get textures(): string[] {\n const uniqueTextures = new Set<string>();\n for (const face of this.faces) {\n if (face.texture) {\n uniqueTextures.add(face.texture);\n }\n }\n return Array.from(uniqueTextures);\n }\n\n /**\n * Get unique materials used in this LOD\n */\n get materials(): string[] {\n const uniqueMaterials = new Set<string>();\n for (const face of this.faces) {\n if (face.material) {\n uniqueMaterials.add(face.material);\n }\n }\n return Array.from(uniqueMaterials);\n }\n\n\n get namedSelections(): string[] {\n const selections = this.taggs\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .filter((tagg): tagg is Extract<Tagg, { kind: 'NamedSelection' }> => ((tagg as any) as Tagg).kind === 'NamedSelection')\n .map(tagg => tagg.name);\n return selections;\n }\n\n static fromReader(reader: BinaryReader): MlodLod {\n const lod = new MlodLod();\n\n // Check P3DM signature\n const signature = reader.readString(4);\n if (signature !== 'P3DM') {\n const bytes = signature.split('').map(c => c.charCodeAt(0).toString(16).padStart(2, '0')).join(' ');\n throw new Error(`Unsupported LOD type: \"${signature}\" (0x${bytes}) at position ${reader.pos - 4}`);\n }\n\n // Read version info\n const majorVersion = reader.readUInt32();\n const minorVersion = reader.readUInt32();\n\n if (majorVersion !== 28 || minorVersion !== 256) {\n throw new Error(`Unknown P3DM version: ${majorVersion}.${minorVersion}`);\n }\n\n // Read counts\n const pointsCnt = reader.readInt32();\n const normalsCnt = reader.readInt32();\n const facesCnt = reader.readInt32();\n lod.flags = reader.readUInt32();\n\n // Read vertices\n lod.vertices = new Array<Point>(pointsCnt);\n for (let i = 0; i < pointsCnt; i++) {\n lod.vertices[i] = Point.fromReader(reader);\n }\n\n // Read normals\n lod.normals = new Array<Vector3>(normalsCnt);\n for (let i = 0; i < normalsCnt; i++) {\n lod.normals[i] = Vector3.fromReader(reader);\n }\n\n // Read faces\n lod.faces = new Array<Face>(facesCnt);\n for (let i = 0; i < facesCnt; i++) {\n lod.faces[i] = Face.fromReader(reader);\n }\n\n // Parse TAGGs section\n lod.taggs = TaggReader.readTaggs(reader, lod.vertices.length, lod.faces);\n\n // Read resolution (float at end of LOD)\n lod.resolution = reader.readFloat();\n\n return lod;\n }\n}\n", "import { BinaryReader } from '@bis-toolkit/utils';\nimport { MlodLod } from './MlodLod';\nimport { P3D } from '../shared/P3d';\n\n/**\n * Main MLOD (Model LOD) file reader\n * MLOD is the editable source format for Bohemia Interactive 3D models\n */\nexport class Mlod implements P3D {\n public version: number = 0;\n public lods: MlodLod[] = [];\n\n public static readonly SUPPORTED_VERSION = 257;\n\n /**\n * Read MLOD from a buffer\n */\n static fromBuffer(buffer: Buffer | Uint8Array): Mlod {\n const reader = new BinaryReader(buffer);\n return Mlod.fromReader(reader);\n }\n\n /**\n * Read MLOD from a BinaryReader\n */\n static fromReader(reader: BinaryReader): Mlod {\n const mlod = new Mlod();\n\n // Read and check signature\n const signature = reader.readString(4);\n if (signature !== 'MLOD') {\n throw new Error(`Expected MLOD signature, got: ${signature}`);\n }\n\n // Read version\n mlod.version = reader.readInt32();\n if (mlod.version !== Mlod.SUPPORTED_VERSION) {\n throw new Error(`Unsupported MLOD version: ${mlod.version} (expected ${Mlod.SUPPORTED_VERSION})`);\n }\n\n // Read LOD count\n const lodCount = reader.readInt32();\n mlod.lods = new Array<MlodLod>(lodCount);\n\n // Read each LOD\n for (let i = 0; i < lodCount; i++) {\n mlod.lods[i] = MlodLod.fromReader(reader);\n }\n\n return mlod;\n }\n\n /**\n * Get all unique textures across all LODs\n */\n get allTextures(): string[] {\n const textures = new Set<string>();\n for (const lod of this.lods) {\n for (const texture of lod.textures) {\n textures.add(texture);\n }\n }\n return Array.from(textures);\n }\n\n /**\n * Get all unique materials across all LODs\n */\n get allMaterials(): string[] {\n const materials = new Set<string>();\n for (const lod of this.lods) {\n for (const material of lod.materials) {\n materials.add(material);\n }\n }\n return Array.from(materials);\n }\n\n /**\n * Get statistics about the model\n */\n getStats(): {\n version: number;\n lodCount: number;\n totalVertices: number;\n totalFaces: number;\n textures: string[];\n materials: string[];\n } {\n return {\n version: this.version,\n lodCount: this.lods.length,\n totalVertices: this.lods.reduce((sum, lod) => sum + lod.vertices.length, 0),\n totalFaces: this.lods.reduce((sum, lod) => sum + lod.faces.length, 0),\n textures: this.allTextures,\n materials: this.allMaterials\n };\n }\n}\n", "/**\n * Face flags enum\n */\nexport enum FaceFlags {\n None = 0,\n FlatShaded = 1,\n UserValue = 128\n}\n", "// Main ODOL classes\nexport { Animation } from './Animation';\nexport { Animations } from './Animations';\nexport { Odol } from './Odol';\nexport { OdolLod } from './OdolLod';\nexport { ModelInfo } from './ModelInfo';\nexport { OdolReader } from './OdolReader';\nexport { getLodName } from '../shared/Resolution';\n\n// Math structures\nexport {\n Vector3,\n Matrix3,\n Matrix4\n} from './math';\n\nexport { PackedColor } from './PackedColor';\n\n// Enums\nexport {\n ClipFlags,\n SpecialFlags,\n ShadowBufferSource,\n MapType,\n AnimationType\n} from './enums';\n\n// Structures\nexport {\n Face,\n Polygons,\n Section,\n NamedSelection,\n UVSet\n} from './structures';\n\n// Vertex table and related\nexport {\n AnimationRTPair,\n AnimationRTWeight,\n VertexNeighborInfo,\n STPair,\n VertexData\n} from './VertexData';\n\n// Auxiliary structures\nexport {\n Skeleton,\n ProxyObject,\n Keyframe,\n SubSkeletonIndexSet,\n LodMetadata\n} from './auxiliaryStructures';\n\nexport {\n Color,\n EmbeddedMaterial,\n StageTexture,\n StageTransform\n} from './Materials';\n", "import { BinaryReader } from '@bis-toolkit/utils';\n\nexport class Vector3 {\n constructor(\n public x: number = 0,\n public y: number = 0,\n public z: number = 0\n ) {}\n\n get length(): number {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n }\n\n static fromReader(reader: BinaryReader): Vector3 {\n return new Vector3(\n reader.readFloat(),\n reader.readFloat(),\n reader.readFloat()\n );\n }\n\n static readCompressed(reader: BinaryReader): Vector3 {\n const compressed = reader.readInt32();\n\n return Vector3.fromInt32(compressed);\n }\n\n static fromInt32(compressed: number): Vector3 {\n const scaleFactor = -1.0 / 511;\n let x = compressed & 0x3FF;\n let y = (compressed >> 10) & 0x3FF;\n let z = (compressed >> 20) & 0x3FF;\n\n if (x > 511) x -= 1024;\n if (y > 511) y -= 1024;\n if (z > 511) z -= 1024;\n\n return new Vector3(\n x * scaleFactor,\n y * scaleFactor,\n z * scaleFactor\n );\n }\n\n distance(v: Vector3): number {\n const dx = this.x - v.x;\n const dy = this.y - v.y;\n const dz = this.z - v.z;\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n }\n\n normalize(): Vector3 {\n const len = this.length;\n if (len === 0) return new Vector3(0, 0, 0);\n return new Vector3(this.x / len, this.y / len, this.z / len);\n }\n\n toArray(): [number, number, number] {\n return [this.x, this.y, this.z];\n }\n}\n\nexport class Matrix3 {\n constructor(\n public m00 = 0, public m01 = 0, public m02 = 0,\n public m10 = 0, public m11 = 0, public m12 = 0,\n public m20 = 0, public m21 = 0, public m22 = 0\n ) {}\n\n static fromReader(reader: BinaryReader): Matrix3 {\n return new Matrix3(\n reader.readFloat(), reader.readFloat(), reader.readFloat(),\n reader.readFloat(), reader.readFloat(), reader.readFloat(),\n reader.readFloat(), reader.readFloat(), reader.readFloat()\n );\n }\n}\n\n/**\n * Matrix4 (stored as 3x3 orientation + 3D position)\n */\nexport class Matrix4 {\n // 3x3 orientation matrix\n constructor(\n public m00 = 0, public m01 = 0, public m02 = 0,\n public m10 = 0, public m11 = 0, public m12 = 0,\n public m20 = 0, public m21 = 0, public m22 = 0,\n // Position vector\n public px = 0, public py = 0, public pz = 0\n ) {}\n\n static fromReader(reader: BinaryReader): Matrix4 {\n // Read 3x3 orientation matrix + position vector (12 floats total, not 16)\n return new Matrix4(\n reader.readFloat(), reader.readFloat(), reader.readFloat(),\n reader.readFloat(), reader.readFloat(), reader.readFloat(),\n reader.readFloat(), reader.readFloat(), reader.readFloat(),\n reader.readFloat(), reader.readFloat(), reader.readFloat()\n );\n }\n}\n", "import { Vector3 } from './math';\nimport { OdolReader } from './OdolReader';\n\nexport enum AnimType {\n Rotation = 0,\n RotationX = 1,\n RotationY = 2,\n RotationZ = 3,\n Translation = 4,\n TranslationX = 5,\n TranslationY = 6,\n TranslationZ = 7,\n Direct = 8,\n Hide = 9\n}\n\n\nexport class Animation {\n kind: AnimType = 0;\n animName: string = '';\n source: string = '';\n minValue: number = 0;\n maxValue: number = 0;\n minPhase: number = 0;\n maxPhase: number = 0;\n sourceAddress: number = 0;\n\n protected read(reader: OdolReader, kind: AnimType): void {\n this.kind = kind;\n this.animName = reader.readCString();\n this.source = reader.readCString();\n this.minPhase = reader.readFloat();\n this.maxPhase = reader.readFloat();\n this.minValue = reader.readFloat();\n this.maxValue = reader.readFloat();\n this.sourceAddress = reader.readUInt32();\n }\n}\n\nexport class AnimationRotation extends Animation {\n angle0: number = 0;\n angle1: number = 0;\n\n static fromReader(reader: OdolReader, kind: AnimType): AnimationRotation {\n const anim = new AnimationRotation();\n anim.read(reader, kind);\n anim.angle0 = reader.readFloat();\n anim.angle1 = reader.readFloat();\n return anim;\n }\n}\n\nexport class AnimationTranslation extends Animation {\n offset0: number = 0;\n offset1: number = 0;\n\n static fromReader(reader: OdolReader, kind: AnimType): AnimationTranslation {\n const anim = new AnimationTranslation();\n anim.read(reader, kind);\n anim.offset0 = reader.readFloat();\n anim.offset1 = reader.readFloat();\n return anim;\n }\n}\n\nexport class AnimationDirect extends Animation {\n axisPos: Vector3 = new Vector3();\n axisDir: Vector3 = new Vector3()\n angle: number = 0;\n axisOffset: number = 0;\n\n static fromReader(reader: OdolReader, kind: AnimType): AnimationDirect {\n const anim = new AnimationDirect();\n anim.read(reader, kind);\n anim.axisPos = Vector3.fromReader(reader);\n anim.axisDir = Vector3.fromReader(reader);\n anim.angle = reader.readFloat();\n anim.axisOffset = reader.readFloat();\n return anim;\n }\n}\n\nexport class AnimationHide extends Animation {\n hideValue: number = 0;\n\n static fromReader(reader: OdolReader, kind: AnimType): AnimationHide {\n const anim = new AnimationHide();\n anim.read(reader, kind);\n anim.hideValue = reader.readFloat();\n return anim;\n }\n}\n\nexport function isAnimationDirect(anim: Animation): anim is AnimationDirect {\n return anim.kind === AnimType.Direct;\n}\n\nexport function isAnimationHide(anim: Animation): anim is AnimationHide {\n return anim.kind === AnimType.Hide;\n}\n", "import { Animation, AnimationDirect, AnimationHide, AnimationRotation, AnimationTranslation, AnimType, isAnimationDirect, isAnimationHide } from './Animation';\nimport { Vector3 } from './math';\nimport { OdolReader } from './OdolReader';\n\nexport class Animations {\n public animations: Animation[] = [];\n public bonesToAnims: number[][][] = [];\n public animsToBones: { boneIdx: number; axisData?: [Vector3, Vector3] }[][] = [];\n\n static fromReader(reader: OdolReader): Animations {\n const animations = new Animations();\n\n // Read animations\n const animationCount = reader.readInt32();\n\n if (animationCount < 0 || animationCount > 10000) {\n throw new Error(`Invalid animations count: ${animationCount}`);\n }\n\n animations.animations = new Array<Animation>(animationCount);\n for (let i = 0; i < animationCount; i++) {\n const kind = reader.readUInt32() as AnimType;\n switch (kind) {\n case AnimType.Rotation:\n case AnimType.RotationX:\n case AnimType.RotationY:\n case AnimType.RotationZ:\n animations.animations[i] = AnimationRotation.fromReader(reader, kind);\n break;\n case AnimType.Translation:\n case AnimType.TranslationX:\n case AnimType.TranslationY:\n case AnimType.TranslationZ:\n animations.animations[i] = AnimationTranslation.fromReader(reader, kind);\n break;\n case AnimType.Direct:\n animations.animations[i] = AnimationDirect.fromReader(reader, kind);\n break;\n case AnimType.Hide:\n animations.animations[i] = AnimationHide.fromReader(reader, kind);\n break;\n default:\n throw new Error(`Unknown AnimType encountered: ${kind as number}`);\n }\n }\n\n // Read bones to anims mapping table\n const animLodsCount = reader.readInt32();\n animations.bonesToAnims = new Array<number[][]>(animLodsCount);\n for (let animLodIdx = 0; animLodIdx < animLodsCount; animLodIdx++) {\n const length = reader.readUInt32();\n animations.bonesToAnims[animLodIdx] = new Array<number[]>(length);\n for (let i = 0; i < length; i++) {\n const length2 = reader.readUInt32();\n animations.bonesToAnims[animLodIdx][i] = new Array<number>(length2);\n for (let j = 0; j < length2; j++) {\n animations.bonesToAnims[animLodIdx][i][j] = reader.readUInt32();\n }\n }\n }\n\n // Read anims to bones mapping table and axis data\n animations.animsToBones = new Array<{ boneIdx: number; axisData?: [Vector3, Vector3] }[]>(animLodsCount);\n for (let lodIdx = 0; lodIdx < animLodsCount; lodIdx++) {\n animations.animsToBones[lodIdx] = new Array<{ boneIdx: number; axisData?: [Vector3, Vector3] }>(animationCount);\n for (let animIdx = 0; animIdx < animationCount; animIdx++) {\n const boneIdx = reader.readInt32();\n\n // Read axis data if needed\n if (boneIdx !== -1 &&\n !isAnimationHide(animations.animations[animIdx]) &&\n !isAnimationDirect(animations.animations[animIdx])\n ) {\n const axisData: [Vector3, Vector3] = [\n Vector3.fromReader(reader),\n Vector3.fromReader(reader)\n ];\n animations.animsToBones[lodIdx][animIdx] = { boneIdx, axisData };\n } else {\n animations.animsToBones[lodIdx][animIdx] = { boneIdx };\n }\n }\n }\n\n return animations;\n }\n}\n", "import { BinaryReader, lzoDecompressWithSize } from '@bis-toolkit/utils';\nimport { Vector3 } from './math';\n\n/**\n * Extended BinaryReader with ODOL-specific functionality\n * Handles compression and compressed arrays\n */\nexport class OdolReader extends BinaryReader {\n public version: number = 0;\n\n /**\n * Read an array of elements\n */\n readArray<T>(readElement: (reader: OdolReader) => T, size?: number): T[] {\n const count = size ?? this.readInt32();\n const array = new Array<T>(count);\n for (let i = 0; i < count; i++) {\n array[i] = readElement(this);\n }\n return array;\n }\n\n /**\n * Read a compressed array of elements\n */\n readCompressedArray<T>(readElement: (reader: OdolReader) => T, elemSize: number): T[] {\n const size = this.readInt32();\n const compressed = this.readCompressed(size * elemSize);\n const tempReader = new OdolReader(compressed);\n tempReader.version = this.version;\n\n const array = new Array<T>(size);\n for (let i = 0; i < size; i++) {\n array[i] = readElement(tempReader);\n }\n\n return array;\n }\n\n /**\n * Read a compressed fill array (optimized for arrays with many repeated values)\n */\n readCompressedFillArray<T>(readElement: (reader: OdolReader) => T, sizeOfT: number): T[] {\n const size = this.readInt32();\n const isFilled = this.readBoolean();\n\n if (isFilled) {\n // All elements are the same\n const value = readElement(this);\n return new Array<T>(size).fill(value);\n }\n\n // Array is compressed\n const compressed = this.readCompressed(size * sizeOfT);\n const tempReader = new OdolReader(compressed);\n tempReader.version = this.version;\n\n const array = new Array<T>(size);\n for (let i = 0; i < size; i++) {\n array[i] = readElement(tempReader);\n }\n\n return array;\n }\n\n /**\n * Read compressed data\n */\n readCompressed(expectedSize: number): Uint8Array {\n if (expectedSize === 0) {\n return new Uint8Array(0);\n }\n\n const useCompression = expectedSize >= 1024;\n\n if (!useCompression) {\n return this.readBytes(expectedSize);\n }\n\n // Calculate worst-case compressed size\n const worstCompressedSize = expectedSize + Math.floor(expectedSize / 64) + 16 + 3 + 4;\n const remainingBytes = this.length - this.pos;\n const bytesToRead = Math.min(worstCompressedSize, remainingBytes);\n\n // Read worst-case amount\n const compressedData = this.readBytes(bytesToRead);\n\n // Decompress and get actual bytes consumed\n const result = lzoDecompressWithSize(compressedData, expectedSize);\n\n // Adjust position to account for bytes not consumed\n const bytesNotConsumed = compressedData.length - result.bytesRead;\n if (bytesNotConsumed > 0) {\n this.seek(-bytesNotConsumed, 'current');\n }\n\n return result.data;\n }\n\n /**\n * Read compressed vertex index array\n */\n readCompressedVertexIndexArray(): number[] {\n return this.readCompressedArray<number>(reader => reader.readUInt16(), 2);\n }\n\n readCompressedVector3(): Vector3 {\n const compressed = this.readInt32();\n return Vector3.fromInt32(compressed);\n }\n}\n", "/* eslint-disable @typescript-eslint/no-duplicate-enum-values */\n/**\n * Clipping flags enum\n */\nexport enum ClipFlags {\n DecalNone = 0,\n FogNormal = 0,\n LandNone = 0,\n LightNormal = 0,\n None = 0,\n Front = 0x01,\n Back = 0x02,\n Left = 0x04,\n Right = 0x08,\n Bottom = 0x10,\n Top = 0x20,\n All = ClipFlags.Front | ClipFlags.Back | ClipFlags.Left | ClipFlags.Right | ClipFlags.Bottom | ClipFlags.Top,\n User0 = 0x40,\n MaxUserValue = 0xFF,\n LandOn = 0x100,\n LandAbove = 0x200,\n LandUnder = 0x400,\n LandKeep = 0x800,\n LandMask = ClipFlags.LandOn | ClipFlags.LandUnder | ClipFlags.LandKeep,\n DecalNormal = 0x1000,\n DecalVertical = 0x2000,\n DecalMask = 0x3000,\n FogDisable = 0x4000,\n FogSky = 0x8000,\n FogMask = ClipFlags.FogDisable | ClipFlags.FogSky,\n UserStep = 0x100000,\n UserMask = 0x0FF00000,\n Hints = 0x10000000,\n Shining = 0xC800000,\n AlwaysInShadow = 0xC900000,\n HalfLight = 0xCA00000,\n FullLight = ClipFlags.Shining | ClipFlags.AlwaysInShadow | ClipFlags.HalfLight,\n}\n\nexport enum SpecialFlags {\n None = 0,\n Unk_2 = 0x02,\n Unk_16 = 0x10,\n NoShadows = 0x20,\n Unk_256 = 0x100,\n Unk_512 = 0x200,\n Unk_4096 = 0x1000,\n SectionSpecial = 0x2000,\n Unk_16384 = 0x4000,\n Unk_32768 = 0x8000,\n Unk_131072 = 0x20000,\n HiddenVertex = 0x402000,\n ZBiasLow = 0x4000000,\n ZBiasMiddle = 0x8000000,\n ZBiasHigh = 0xC000000,\n}\n\nexport enum ShadowBufferSource {\n Visual = 0,\n ShadowVolume = 1,\n Explicit = 2,\n None = 3,\n VisualEx = 4,\n}\n\nexport enum MapType {\n Tree = 0,\n SmallTree = 1,\n Bush = 2,\n Building = 3,\n House = 4,\n ForestBorder = 5,\n ForestTriangle = 6,\n ForestSquare = 7,\n Church = 8,\n Chapel = 9,\n Cross = 10,\n Rock = 11,\n Bunker = 12,\n Fortress = 13,\n Fountain = 14,\n ViewTower = 15,\n Lighthouse = 16,\n Quay = 17,\n Fuelstation = 18,\n Hospital = 19,\n Fence = 20,\n Wall = 21,\n Hide = 22,\n BusStop = 23,\n Road = 24,\n Forest = 25,\n Transmitter = 26,\n Stack = 27,\n Ruin = 28,\n Tourism = 29,\n Watertower = 30,\n Track = 31,\n MainRoad = 32,\n Rocks = 33,\n PowerLines = 34,\n RailWay = 35\n}\n\nexport enum AnimationType {\n None = 0,\n Software = 1,\n Hardware = 2,\n}\n", "import { BinaryReader } from '@bis-toolkit/utils';\n\n/**\n * Packed color (RGBA as a single 32-bit integer)\n */\n\nexport class PackedColor {\n constructor(public value: number = 0) { }\n\n static fromReader(reader: BinaryReader): PackedColor {\n return new PackedColor(reader.readUInt32());\n }\n\n get r(): number {\n return (this.value >> 0) & 0xFF;\n }\n\n get g(): number {\n return (this.value >> 8) & 0xFF;\n }\n\n get b(): number {\n return (this.value >> 16) & 0xFF;\n }\n\n get a(): number {\n return (this.value >> 24) & 0xFF;\n }\n\n toArray(): [number, number, number, number] {\n return [this.r, this.g, this.b, this.a];\n }\n}\n", "import { OdolReader } from './OdolReader';\nimport { PackedColor } from './PackedColor';\nimport { ClipFlags, SpecialFlags } from './enums';\nimport { Vector3, Matrix4 } from './math';\n\n/**\n * Skeleton bone structure\n */\nexport class Skeleton {\n public name: string = '';\n public isDiscrete: boolean = false;\n public bones: string[] = [];\n public pivotsName: string = '';\n\n static fromReader(reader: OdolReader): Skeleton {\n const skeleton = new Skeleton();\n skeleton.name = reader.readCString();\n\n if (skeleton.name === '') {\n return skeleton;\n }\n\n skeleton.isDiscrete = reader.readBoolean();\n\n const bonesCnt = reader.readInt32();\n skeleton.bones = new Array<string>(bonesCnt * 2);\n\n for (let i = 0; i < bonesCnt; i++) {\n skeleton.bones[i * 2] = reader.readCString();\n skeleton.bones[i * 2 + 1] = reader.readCString();\n }\n\n skeleton.pivotsName = reader.readCString();\n\n return skeleton;\n }\n\n getBonePairs(): [string, string][] {\n const pairs: [string, string][] = [];\n for (let i = 0; i < this.bones.length; i += 2) {\n pairs.push([this.bones[i], this.bones[i + 1]]);\n }\n return pairs;\n }\n}\n\n/**\n * Proxy object (reference to another model)\n */\nexport class ProxyObject {\n public proxyModel: string = '';\n public transformation: Matrix4 = new Matrix4();\n public sequenceId: number = 0;\n public namedSelectionIndex: number = 0;\n public boneIndex: number = 0;\n public sectionIndex: number = 0;\n\n static fromReader(reader: OdolReader): ProxyObject {\n const proxy = new ProxyObject();\n proxy.proxyModel = reader.readCString();\n proxy.transformation = Matrix4.fromReader(reader);\n proxy.sequenceId = reader.readInt32();\n proxy.namedSelectionIndex = reader.readInt32();\n proxy.boneIndex = reader.readInt32();\n proxy.sectionIndex = reader.readInt32();\n return proxy;\n }\n}\n\n/**\n * Keyframe for animations\n */\nexport class Keyframe {\n public time: number = 0;\n public points: Vector3[] = [];\n\n static fromReader(reader: OdolReader): Keyframe {\n const keyframe = new Keyframe();\n keyframe.time = reader.readFloat();\n keyframe.points = reader.readArray(r => Vector3.fromReader(r));\n return keyframe;\n }\n}\n\nexport class SubSkeletonIndexSet {\n public subSkeletons: number[] = [];\n\n static fromReader(reader: OdolReader): SubSkeletonIndexSet {\n const set = new SubSkeletonIndexSet();\n set.subSkeletons = reader.readArray(r => r.readInt32());\n return set;\n }\n}\n\nexport class LodMetadata {\n public facesCount: number = 0;\n public color: PackedColor = new PackedColor();\n public special: SpecialFlags = SpecialFlags.None;\n public orHints: ClipFlags = ClipFlags.None;\n public hasSkeleton: boolean = false;\n public verticesCount: number = 0;\n public faceArea: number = 0;\n\n static fromReader(reader: OdolReader): LodMetadata {\n const info = new LodMetadata();\n\n info.facesCount = reader.readInt32();\n info.color = PackedColor.fromReader(reader);\n info.special = reader.readInt32() as SpecialFlags;\n info.orHints = reader.readUInt32() as ClipFlags;\n info.hasSkeleton = reader.readBoolean();\n\n info.verticesCount = reader.readInt32();\n info.faceArea = reader.readFloat();\n\n return info;\n }\n}\n", "import { Matrix4 } from './math';\nimport { OdolReader } from './OdolReader';\n\n\n/**\n * Color with RGBA float components\n */\nexport class Color {\n public r: number = 0;\n public g: number = 0;\n public b: number = 0;\n public a: number = 0;\n\n static fromReader(reader: OdolReader): Color {\n const color = new Color();\n color.r = reader.readFloat();\n color.g = reader.readFloat();\n color.b = reader.readFloat();\n color.a = reader.readFloat();\n return color;\n }\n}\n\nexport class StageTexture {\n public textureFilter: number = 0; // TextureFilterType enum\n public texture: string = '';\n public stageId: number = 0;\n public useWorldEnvMap: boolean = false;\n\n static fromReader(reader: OdolReader): StageTexture {\n const stage = new StageTexture();\n stage.textureFilter = reader.readUInt32();\n stage.texture = reader.readCString();\n stage.stageId = reader.readUInt32();\n stage.useWorldEnvMap = reader.readBoolean();\n return stage;\n }\n}\n\nexport class StageTransform {\n public uvSource: number = 0; // UVSource enum\n public transformation: Matrix4 = new Matrix4();\n\n static fromReader(reader: OdolReader): StageTransform {\n const transform = new StageTransform();\n transform.uvSource = reader.readUInt32();\n transform.transformation = Matrix4.fromReader(reader);\n return transform;\n }\n}\n\nexport class EmbeddedMaterial {\n public materialName: string = '';\n public version: number = 0;\n\n // Color properties (RGBA floats)\n public emissive: Color = new Color();\n public ambient: Color = new Color();\n public diffuse: Color = new Color();\n public forcedDiffuse: Color = new Color();\n public specular: Color = new Color();\n public emissive2: Color = new Color();\n public specular2: Color = new Color();\n public unkCol1: Color = new Color();\n public unkCol2: Color = new Color();\n\n // Material properties\n public specularPower: number = 0;\n public pixelShaderId: number = 0;\n public vertexShaderId: number = 0;\n public mainLight: number = 0;\n public fogMode: number = 0;\n public surfaceFile: string = '';\n public nRenderFlags: number = 0;\n public renderFlags: number = 0;\n\n // Stage data\n public stageTextures: StageTexture[] = [];\n public stageTransforms: StageTransform[] = [];\n public stageTI: StageTexture | null = null;\n\n // Unknown fields\n public unk2: number = 0;\n public unk3: number = 0;\n\n static fromReader(reader: OdolReader): EmbeddedMaterial {\n const material = new EmbeddedMaterial();\n\n material.materialName = reader.readCString();\n material.version = reader.readUInt32();\n\n material.emissive = Color.fromReader(reader);\n material.ambient = Color.fromReader(reader);\n material.diffuse = Color.fromReader(reader);\n material.forcedDiffuse = Color.fromReader(reader);\n material.specular = Color.fromReader(reader);\n material.emissive2 = Color.fromReader(reader);\n material.unkCol1 = Color.fromReader(reader);\n material.specular2 = Color.fromReader(reader);\n material.specularPower = reader.readFloat();\n material.unk2 = reader.readInt32(); // 0 usually\n material.unk3 = reader.readInt32(); // 0 usually\n\n //console.log(`Unknown material values: unk2=${material.unk2}, unk3=${material.unk3}`);\n material.unkCol2 = Color.fromReader(reader);\n\n if (material.version >= 20) {\n const _unk1 = reader.readInt32(); // 0\n const _unk2 = reader.readInt32(); // 0\n const _unk3 = reader.readInt32(); // -1\n const _unk4 = reader.readFloat(); // 30.0\n const _unk5 = reader.readFloat(); // 45.0\n const _unk6 = reader.readInt32(); // 0\n const _unk7 = reader.readInt32(); // -1\n const _unk8 = reader.readInt32(); // 0\n const _unk9 = reader.readFloat(); // 1.0\n const _unk10 = reader.readInt32(); // 0\n const _unk11 = reader.readInt32(); // 0\n const _unk12 = reader.readInt32(); // 0\n\n //console.log(`Unknown material values: Unk1=${unk1}, Unk2=${unk2}, Unk3=${unk3}, Unk4=${unk4}, Unk5=${unk5}, Unk6=${unk6}, Unk7=${unk7}, Unk8=${unk8}, Unk9=${unk9}, Unk10=${unk10}, Unk11=${unk11}, Unk12=${unk12}`);\n }\n\n material.pixelShaderId = reader.readUInt32();\n material.vertexShaderId = reader.readUInt32();\n material.mainLight = reader.readUInt32();\n material.fogMode = reader.readUInt32();\n material.surfaceFile = reader.readCString();\n material.nRenderFlags = reader.readUInt32();\n material.renderFlags = reader.readUInt32();\n\n const nStages = reader.readInt32();\n const nTexGens = reader.readInt32();\n\n material.stageTextures = new Array<StageTexture>(nStages);\n for (let i = 0; i < nStages; i++) {\n material.stageTextures[i] = StageTexture.fromReader(reader);\n }\n\n material.stageTransforms = new Array<StageTransform>(nTexGens);\n for (let i = 0; i < nTexGens; i++) {\n material.stageTransforms[i] = StageTransform.fromReader(reader);\n }\n\n material.stageTI = StageTexture.fromReader(reader);\n\n return material;\n }\n}\n", "import { OdolReader } from './OdolReader';\nimport { SpecialFlags } from './enums';\n\n/**\n * Face (polygon) in ODOL\n */\nexport class Face {\n public vertexIndices: number[] = [];\n public size: number = 0;\n\n static fromReader(reader: OdolReader): Face {\n const face = new Face();\n const vertexCount = reader.readByte();\n\n face.vertexIndices = new Array<number>(vertexCount);\n for (let i = 0; i < vertexCount; i++) {\n face.vertexIndices[i] = reader.readUInt16();\n }\n\n face.size = 1 + (vertexCount * 2);\n\n return face;\n }\n}\n\n/**\n * Collection of polygons\n */\nexport class Polygons {\n public faces: Face[] = [];\n public unk: number = 0;\n\n static fromReader(reader: OdolReader): Polygons {\n const polygons = new Polygons();\n\n const facesCount = reader.readInt32();\n const allocationSize = reader.readInt32();\n polygons.unk = reader.readUInt16();\n if (polygons.unk !== 0) {\n console.warn(`Polygons.unk expected to be 0, got: ${polygons.unk}`);\n }\n\n let size = 0;\n polygons.faces = new Array<Face>(facesCount);\n for (let i = 0; i < facesCount; i++) {\n polygons.faces[i] = Face.fromReader(reader);\n size += polygons.faces[i].size;\n }\n\n size += polygons.faces.length;\n\n if (size !== allocationSize) {\n console.warn(`Polygon allocation size mismatch: expected ${allocationSize}, got ${size}`);\n }\n\n return polygons;\n }\n}\n\n/**\n * Section (material/texture group)\n */\nexport class Section {\n public faceLowerIndex: number = 0;\n public faceUpperIndex: number = 0;\n public minBoneIndex: number = 0;\n public bonesCount: number = 0;\n public textureIndex: number = 0;\n public commonFaceFlags: SpecialFlags = SpecialFlags.None;\n public materialIndex: number = 0;\n public material: string = '';\n public areaOverTex: number[] = [];\n private unk1: number = 0;\n\n static fromReader(reader: OdolReader): Section {\n const section = new Section();\n section.faceLowerIndex = reader.readInt32();\n section.faceUpperIndex = reader.readInt32();\n section.minBoneIndex = reader.readInt32();\n section.bonesCount = reader.readInt32();\n section.unk1 = reader.readInt32();\n section.textureIndex = reader.readUInt16();\n section.commonFaceFlags = reader.readUInt32() as SpecialFlags;\n section.materialIndex = reader.readInt32();\n\n if (section.materialIndex === -1) {\n section.material = reader.readCString();\n }\n\n section.areaOverTex = reader.readArray(r => r.readFloat());\n return section;\n }\n\n getFaceIndexes(faces: Face[]): number[] {\n let curFaceOffset = 0;\n const faceStride = 8;\n const quadExtra = 2;\n const indexes: number[] = [];\n\n for (let index = 0; index < faces.length; index++) {\n if (curFaceOffset >= this.faceLowerIndex && curFaceOffset < this.faceUpperIndex) {\n indexes.push(index);\n }\n curFaceOffset += faceStride;\n if (faces[index].vertexIndices.length === 4) {\n curFaceOffset += quadExtra;\n }\n if (curFaceOffset >= this.faceUpperIndex) break;\n }\n\n return indexes;\n }\n}\n\n/**\n * Named selection (vertex/face groups)\n */\nexport class NamedSelection {\n public name: string = '';\n public isSectional: boolean = false;\n public selectedFaces: number[] = [];\n public sections: number[] = [];\n public selectedVertices: number[] = [];\n public selectedVerticesWeights: Uint8Array = new Uint8Array(0);\n\n static fromReader(reader: OdolReader): NamedSelection {\n const selection = new NamedSelection();\n\n selection.name = reader.readCString();\n selection.selectedFaces = reader.readCompressedVertexIndexArray();\n\n const unk0 = reader.readInt32();\n if (unk0 !== 0) {\n console.warn(`NamedSelection: expected 0, got ${unk0}`);\n }\n\n selection.isSectional = reader.readBoolean();\n selection.sections = reader.readCompressedArray(r => r.readInt32(), 4);\n selection.selectedVertices = reader.readCompressedVertexIndexArray();\n\n const weightsSize = reader.readInt32();\n selection.selectedVerticesWeights = reader.readCompressed(weightsSize);\n\n return selection;\n }\n}\n\n/**\n * UV coordinate set\n */\nexport class UVSet {\n private minU: number = 0;\n private minV: number = 0;\n private maxU: number = 0;\n private maxV: number = 0;\n private nVertices: number = 0;\n private isDefault: boolean = false;\n private defaultValue: Uint8Array = new Uint8Array(0);\n private uvData: Uint8Array = new Uint8Array(0);\n\n static fromReader(reader: OdolReader): UVSet {\n const uvSet = new UVSet();\n\n uvSet.minU = reader.readFloat();\n uvSet.minV = reader.readFloat();\n uvSet.maxU = reader.readFloat();\n uvSet.maxV = reader.readFloat();\n\n uvSet.nVertices = reader.readInt32();\n uvSet.isDefault = reader.readBoolean();\n\n if (uvSet.isDefault) {\n uvSet.defaultValue = reader.readBytes(4);\n } else {\n uvSet.uvData = reader.readCompressed(uvSet.nVertices * 4);\n }\n\n return uvSet;\n }\n\n /**\n * Get UV data as float array\n */\n getUVData(): Float32Array {\n const uvData = new Float32Array(this.nVertices * 2);\n\n const rangeU = this.maxU - this.minU;\n const rangeV = this.maxV - this.minV;\n\n const view = this.isDefault\n ? new DataView(this.defaultValue.buffer, this.defaultValue.byteOffset)\n : new DataView(this.uvData.buffer, this.uvData.byteOffset);\n\n if (this.isDefault) {\n const u = this.decodeUVComponent(view.getInt16(0, true), rangeU, this.minU);\n const v = this.decodeUVComponent(view.getInt16(2, true), rangeV, this.minV);\n\n for (let i = 0; i < this.nVertices; i++) {\n const dst = i * 2;\n uvData[dst] = u;\n uvData[dst + 1] = v;\n }\n } else {\n for (let i = 0; i < this.nVertices; i++) {\n const src = i * 4;\n const dst = i * 2;\n uvData[dst] = this.decodeUVComponent(view.getInt16(src, true), rangeU, this.minU);\n uvData[dst + 1] = this.decodeUVComponent(view.getInt16(src + 2, true), rangeV, this.minV);\n }\n }\n\n return uvData;\n }\n\n private decodeUVComponent(value: number, range: number, min: number): number {\n return ((value + 32767) / 65536) * range + min;\n }\n}\n", "import { OdolReader } from './OdolReader';\nimport { Vector3 } from './math';\nimport { ClipFlags } from './enums';\nimport { UVSet } from './structures';\n\n/**\n * Animation RT pair\n */\nexport class AnimationRTPair {\n constructor(\n public selectionIndex: number,\n public weight: number\n ) { }\n}\n\n/**\n * Animation RT weight\n */\nexport class AnimationRTWeight {\n private nSmall: number = 0;\n private smallSpace: Uint8Array = new Uint8Array(8);\n\n static fromReader(reader: OdolReader): AnimationRTWeight {\n const weight = new AnimationRTWeight();\n weight.nSmall = reader.readInt32();\n weight.smallSpace = reader.readBytes(8);\n return weight;\n }\n\n getAnimationRTPairs(): AnimationRTPair[] {\n const pairs: AnimationRTPair[] = [];\n for (let i = 0; i < this.nSmall; i++) {\n pairs.push(new AnimationRTPair(\n this.smallSpace[i * 2],\n this.smallSpace[i * 2 + 1]\n ));\n }\n return pairs;\n }\n}\n\n/**\n * Vertex neighbor info\n */\nexport class VertexNeighborInfo {\n public posA: number = 0;\n private unk1: number = 0;\n public weightA: AnimationRTWeight | null = null;\n public posB: number = 0;\n private unk2: number = 0;\n public weightB: AnimationRTWeight | null = null;\n\n static fromReader(reader: OdolReader): VertexNeighborInfo {\n const info = new VertexNeighborInfo();\n info.posA = reader.readUInt16();\n info.unk1 = reader.readUInt16();\n info.weightA = AnimationRTWeight.fromReader(reader);\n info.posB = reader.readUInt16();\n info.unk2 = reader.readUInt16();\n info.weightB = AnimationRTWeight.fromReader(reader);\n return info;\n }\n}\n\n/**\n * ST coordinate pair (tangent/bitangent)\n */\nexport class STPair {\n public s: Vector3 = new Vector3();\n public t: Vector3 = new Vector3();\n\n static fromReader(reader: OdolReader): STPair {\n const pair = new STPair();\n pair.s = reader.readCompressedVector3();\n pair.t = reader.readCompressedVector3();\n\n return pair;\n }\n}\n\nexport class VertexData {\n public vertexBoneRefIsSimple: boolean = false;\n public clipFlags: ClipFlags[] = [];\n public uvSets: UVSet[] = [];\n public vertices: Vector3[] = [];\n public normals: Vector3[] = [];\n public stCoords: STPair[] = [];\n public vertexBoneRef: AnimationRTWeight[] = [];\n public neighborBoneRef: VertexNeighborInfo[] = [];\n\n static fromReader(reader: OdolReader): VertexData {\n const data = new VertexData();\n\n data.vertexBoneRefIsSimple = reader.readBoolean();\n const calcSizeStart = reader.pos;\n const sizeOfData = reader.readUInt32();\n const clipFlagsInt = reader.readCompressedFillArray(r => r.readInt32(), 4);\n data.clipFlags = clipFlagsInt.map(f => f as ClipFlags);\n\n // Read first UV set\n const uvSet0 = UVSet.fromReader(reader);\n const uvSetCount = reader.readInt32();\n data.uvSets = new Array<UVSet>(uvSetCount);\n data.uvSets[0] = uvSet0;\n\n // Read remaining UV sets\n for (let i = 1; i < uvSetCount; i++) {\n data.uvSets[i] = UVSet.fromReader(reader);\n }\n\n // Read vertices\n data.vertices = reader.readCompressedArray(r => Vector3.fromReader(r), 12);\n\n // Read normals\n data.normals = reader.readCompressedFillArray(r => r.readCompressedVector3(), 4);\n\n // Read ST coordinates (tangent/bitangent)\n data.stCoords = reader.readCompressedArray(r => STPair.fromReader(r), 8);\n\n // Read vertex bone references\n data.vertexBoneRef = reader.readCompressedArray(r => AnimationRTWeight.fromReader(r), 12);\n\n // Read neighbor bone references\n data.neighborBoneRef = reader.readCompressedArray(r => VertexNeighborInfo.fromReader(r), 32);\n\n const size = reader.pos - calcSizeStart;\n if (size !== sizeOfData) {\n console.warn(`Vertex Data size mismatch: expected ${sizeOfData}, got ${size}`);\n }\n\n return data;\n }\n}\n", "import { OdolReader } from './OdolReader';\nimport { Vector3 } from './math';\nimport { ClipFlags, SpecialFlags } from './enums';\nimport {\n ProxyObject,\n SubSkeletonIndexSet,\n Keyframe,\n LodMetadata\n} from './auxiliaryStructures';\nimport { EmbeddedMaterial } from './Materials';\nimport {\n Polygons,\n Section,\n NamedSelection,\n Face\n} from './structures';\nimport { VertexData } from './VertexData';\nimport { getLodName } from '../shared/Resolution';\nimport { ILod } from '../shared/Lod';\n\n/**\n * ODOL LOD (Level of Detail)\n */\nexport class OdolLod implements ILod {\n public resolution: number = 0;\n public proxyObjects: ProxyObject[] = [];\n public subSkeletonsToSkeleton: number[] = [];\n public skeletonToSubSkeleton: SubSkeletonIndexSet[] = [];\n public vertexCount: number = 0;\n public faceArea: number = 0;\n public orHints: ClipFlags = ClipFlags.None;\n public andHints: ClipFlags = ClipFlags.None;\n public bMin: Vector3 = new Vector3();\n public bMax: Vector3 = new Vector3();\n public bCenter: Vector3 = new Vector3();\n public bRadius: number = 0;\n public textures: string[] = [];\n public materials: EmbeddedMaterial[] = [];\n public pointToVertex: number[] = [];\n public vertexToPoint: number[] = [];\n public polygons: Polygons = new Polygons();\n public sections: Section[] = [];\n public namedSelections: NamedSelection[] = [];\n public namedProperties: [string, string][] = [];\n public frames: Keyframe[] = [];\n public iconColor: number = 0;\n public selectedColor: number = 0;\n public special: SpecialFlags = SpecialFlags.None;\n public vertexData: VertexData = new VertexData();\n public lodMetadata: LodMetadata | null = null;\n\n static fromReader(reader: OdolReader): OdolLod {\n const lod = new OdolLod();\n\n // Read proxies\n lod.proxyObjects = reader.readArray(r => ProxyObject.fromReader(r));\n\n // Read skeleton mappings\n lod.subSkeletonsToSkeleton = reader.readArray(r => r.readInt32());\n lod.skeletonToSubSkeleton = reader.readArray(r => SubSkeletonIndexSet.fromReader(r));\n lod.vertexCount = reader.readUInt32();\n lod.faceArea = reader.readFloat();\n lod.orHints = reader.readInt32() as ClipFlags;\n lod.andHints = reader.readInt32() as ClipFlags;\n lod.bMin = Vector3.fromReader(reader);\n lod.bMax = Vector3.fromReader(reader);\n lod.bCenter = Vector3.fromReader(reader);\n lod.bRadius = reader.readFloat();\n\n // Read textures\n lod.textures = reader.readArray(r => r.readCString());\n\n // Read materials\n lod.materials = reader.readArray(r => EmbeddedMaterial.fromReader(r));\n\n // Read vertex index mappings\n lod.pointToVertex = reader.readCompressedVertexIndexArray();\n lod.vertexToPoint = reader.readCompressedVertexIndexArray();\n\n // Read polygons\n lod.polygons = Polygons.fromReader(reader);\n\n // Read sections\n lod.sections = reader.readArray(r => Section.fromReader(r));\n\n // Read named selections\n lod.namedSelections = reader.readArray(r => NamedSelection.fromReader(r));\n\n // Read named properties\n const namedPropertiesCnt = reader.readInt32();\n lod.namedProperties = new Array<[string, string]>(namedPropertiesCnt);\n for (let i = 0; i < namedPropertiesCnt; i++) {\n const key = reader.readCString();\n const value = reader.readCString();\n lod.namedProperties[i] = [key, value];\n }\n\n // Read frames (keyframes)\n lod.frames = reader.readArray(r => Keyframe.fromReader(r));\n\n lod.iconColor = reader.readInt32();\n lod.selectedColor = reader.readUInt32();\n lod.special = reader.readInt32() as SpecialFlags;\n\n // Read vertex table\n lod.vertexData = VertexData.fromReader(reader);\n\n return lod;\n }\n\n /**\n * Get resolution name\n */\n get resolutionName(): string {\n return getLodName(this.resolution);\n }\n\n /**\n * Get all unique texture paths\n */\n get allTextures(): string[] {\n return [...new Set(this.textures)];\n }\n\n /**\n * Get all material names\n */\n get materialNames(): string[] {\n return this.materials.map(m => m.materialName);\n }\n\n /**\n * Get vertices\n */\n get vertices(): Vector3[] {\n return this.vertexData.vertices;\n }\n\n get verticesCount(): number {\n return this.vertexData.vertices.length;\n }\n\n get facesCount(): number {\n return this.polygons.faces.length;\n }\n\n /**\n * Get face count\n */\n get faces(): Face[] {\n return this.polygons.faces;\n }\n\n /**\n * Get statistics about this LOD\n */\n getStats() {\n return {\n resolution: this.resolution,\n vertexCount: this.vertices.length,\n faceCount: this.faces.length,\n textureCount: this.textures.length,\n materialCount: this.materials.length,\n sectionCount: this.sections.length,\n namedSelectionCount: this.namedSelections.length,\n proxyCount: this.proxyObjects.length\n };\n }\n}\n", "import { OdolReader } from './OdolReader';\nimport { Vector3, Matrix3 } from './math';\nimport { PackedColor } from './PackedColor';\nimport { ClipFlags, ShadowBufferSource, MapType } from './enums';\nimport { Skeleton } from './auxiliaryStructures';\n\n/**\n * Model information (metadata and properties)\n */\nexport class ModelInfo {\n public special: number = 0;\n public boundingSphere: number = 0;\n public geometrySphere: number = 0;\n public remarks: number = 0;\n public andHints: ClipFlags = ClipFlags.None;\n public orHints: ClipFlags = ClipFlags.None;\n public aimingCenter: Vector3 = new Vector3();\n public color: PackedColor = new PackedColor();\n public colorType: PackedColor = new PackedColor();\n public viewDensity: number = 0;\n public bboxMin: Vector3 = new Vector3();\n public bboxMax: Vector3 = new Vector3();\n public bboxMinVisual: Vector3 = new Vector3();\n public bboxMaxVisual: Vector3 = new Vector3();\n public boundingCenter: Vector3 = new Vector3();\n public geometryCenter: Vector3 = new Vector3();\n public centerOfMass: Vector3 = new Vector3();\n public invInertia: Matrix3 = new Matrix3();\n public autoCenter: boolean = false;\n public lockAutoCenter: boolean = false;\n public canOcclude: boolean = false;\n public canBeOccluded: boolean = false;\n public unknownBool: boolean = false;\n public unknownFloat: number = 0;\n public forceNotAlphaModel: boolean = false;\n public sbSource: ShadowBufferSource = ShadowBufferSource.Visual;\n public preferShadowVolume: boolean = false;\n public shadowOffset: number = 0;\n public animated: boolean = false;\n public skeleton: Skeleton = new Skeleton();\n public mapType: MapType = MapType.Tree;\n public massArray: number[] = [0, 0, 0, 0];\n public mass: number = 0;\n public invMass: number = 0;\n public armor: number = 0;\n public invArmor: number = 0;\n\n public htMin: number = 0;\n public htMax: number = 0;\n public afMax: number = 0;\n public mfMax: number = 0;\n public mFact: number = 0;\n public tBody: number = 0;\n public minShadow: number = 0;\n public canBlend: boolean = false;\n public propertyClass: string = '';\n public propertyDamage: string = '';\n public propertyFrequent: boolean = false;\n\n public memoryIndex: number = 0;\n public geometryIndex: number = 0;\n public unkLodType1Index: number = 0;\n public geometryFireIndex: number = 0;\n public geometryViewIndex: number = 0\n public geometryViewPilotIndex: number = 0;\n public geometryViewGunnerIndex: number = 0;\n public unkLodType2Index: number = 0;\n public geometryViewCargoIndex: number = 0;\n public landContactIndex: number = 0;\n public roadwayIndex: number = 0;\n public pathsIndex: number = 0;\n public hitpointsIndex: number = 0;\n\n static fromReader(reader: OdolReader): ModelInfo {\n const info = new ModelInfo();\n\n info.special = reader.readInt32();\n info.boundingSphere = reader.readFloat();\n info.geometrySphere = reader.readFloat();\n info.remarks = reader.readInt32();\n info.andHints = reader.readUInt32() as ClipFlags;\n info.orHints = reader.readUInt32() as ClipFlags;\n info.aimingCenter = Vector3.fromReader(reader);\n info.color = PackedColor.fromReader(reader);\n info.colorType = PackedColor.fromReader(reader);\n info.viewDensity = reader.readFloat();\n info.bboxMin = Vector3.fromReader(reader);\n info.bboxMax = Vector3.fromReader(reader);\n info.bboxMinVisual = Vector3.fromReader(reader);\n info.bboxMaxVisual = Vector3.fromReader(reader);\n info.boundingCenter = Vector3.fromReader(reader);\n info.geometryCenter = Vector3.fromReader(reader);\n info.centerOfMass = Vector3.fromReader(reader);\n info.invInertia = Matrix3.fromReader(reader);\n info.autoCenter = reader.readBoolean();\n info.lockAutoCenter = reader.readBoolean();\n info.canOcclude = reader.readBoolean();\n info.canBeOccluded = reader.readBoolean();\n info.unknownBool = reader.readBoolean();\n info.unknownFloat = reader.readFloat();\n console.warn('Unknown ModelInfo values:', info.unknownBool, info.unknownFloat);\n\n info.htMin = reader.readFloat();\n info.htMax = reader.readFloat();\n info.afMax = reader.readFloat();\n info.mfMax = reader.readFloat();\n info.mFact = reader.readFloat();\n info.tBody = reader.readFloat();\n info.forceNotAlphaModel = reader.readBoolean();\n info.sbSource = reader.readInt32() as ShadowBufferSource;\n info.preferShadowVolume = reader.readBoolean();\n info.shadowOffset = reader.readFloat();\n info.animated = reader.readBoolean();\n info.skeleton = Skeleton.fromReader(reader);\n info.mapType = reader.readByte() as MapType;\n info.massArray = reader.readCompressedArray(r => r.readFloat(), 4);\n info.mass = reader.readFloat();\n info.invMass = reader.readFloat();\n info.armor = reader.readFloat();\n info.invArmor = reader.readFloat();\n\n info.memoryIndex = reader.readByte();\n info.geometryIndex = reader.readByte();\n if (reader.version >= 54) {\n info.unkLodType1Index = reader.readByte(); // unkLodType1 (seems always to be 255)\n }\n\n info.geometryFireIndex = reader.readByte(); // geometryFire\n info.geometryViewIndex = reader.readByte(); // geometryView\n info.geometryViewPilotIndex = reader.readByte(); // geometryViewPilot\n info.geometryViewGunnerIndex = reader.readByte(); // geometryViewGunner\n info.unkLodType2Index = reader.readByte(); // unkLodType2 (seems always to be 255)\n info.geometryViewCargoIndex = reader.readByte(); // geometryViewCargo\n info.landContactIndex = reader.readByte(); // landContact\n info.roadwayIndex = reader.readByte(); // roadway\n info.pathsIndex = reader.readByte(); // paths\n info.hitpointsIndex = reader.readByte(); // hitpoints\n info.minShadow = reader.readUInt32();\n info.canBlend = reader.readBoolean();\n info.propertyClass = reader.readCString();\n info.propertyDamage = reader.readCString();\n info.propertyFrequent = reader.readBoolean();\n\n return info;\n }\n}\n", "import { OdolReader } from './OdolReader';\nimport { OdolLod } from './OdolLod';\nimport { ModelInfo } from './ModelInfo';\nimport { Animations } from './Animations';\nimport { LodMetadata as LodMetadata, Skeleton } from './auxiliaryStructures';\nimport { P3D, P3dStats } from '../shared/P3d';\n\n/**\n * LOD information\n */\nclass LodInfo {\n public resolution: number = 0;\n public lodStartPosition: number = 0;\n public lodEndPosition: number = 0;\n public hasLodMeta: boolean = false;\n public lodMetadata: LodMetadata | null = null;\n}\n\n/**\n * Main ODOL file reader\n * ODOL is the compiled/binary format for Bohemia Interactive 3D models\n */\nexport class Odol implements P3D {\n public version: number = 0;\n public modelInfo: ModelInfo | null = null;\n public lods: OdolLod[] = [];\n public animations: Animations | null = null;\n\n public static readonly MIN_SUPPORTED_VERSION = 53;\n public static readonly MAX_SUPPORTED_VERSION = 54;\n\n /**\n * Read ODOL from a buffer\n */\n static fromBuffer(buffer: Buffer | Uint8Array): Odol {\n const reader = new OdolReader(buffer);\n return Odol.fromReader(reader);\n }\n\n /**\n * Read ODOL from an OdolReader\n */\n static fromReader(reader: OdolReader): Odol {\n const odol = new Odol();\n\n // Read and check signature\n const signature = reader.readString(4);\n if (signature !== 'ODOL') {\n throw new Error(`Expected ODOL signature, got: ${signature}`);\n }\n\n // Read version\n odol.version = reader.readInt32();\n reader.version = odol.version;\n\n if (odol.version > Odol.MAX_SUPPORTED_VERSION || odol.version < Odol.MIN_SUPPORTED_VERSION) {\n throw new Error(`Unsupported ODOL version: ${odol.version}. Supported versions: ${Odol.MIN_SUPPORTED_VERSION}-${Odol.MAX_SUPPORTED_VERSION}`);\n }\n\n // Read LOD count and resolutions\n const lodCount = reader.readInt32();\n const lodInfos = new Array<LodInfo>(lodCount);\n\n for (let i = 0; i < lodCount; i++) {\n lodInfos[i] = new LodInfo();\n lodInfos[i].resolution = reader.readFloat();\n }\n\n // Read model info\n odol.modelInfo = ModelInfo.fromReader(reader);\n\n const _unk = reader.readUInt32(); // unknown (seems to be 0)\n\n // Read animations if present\n const hasAnimations = reader.readBoolean();\n if (hasAnimations) {\n odol.animations = Animations.fromReader(reader);\n }\n\n // Read LOD addresses\n for (let i = 0; i < lodCount; i++) {\n lodInfos[i].lodStartPosition = reader.readUInt32();\n }\n\n for (let i = 0; i < lodCount; i++) {\n lodInfos[i].lodEndPosition = reader.readUInt32();\n }\n\n for (let i = 0; i < lodCount; i++) {\n lodInfos[i].hasLodMeta = !reader.readBoolean();\n }\n\n for (let i = 0; i < lodCount; i++) {\n if (lodInfos[i].hasLodMeta) {\n lodInfos[i].lodMetadata = LodMetadata.fromReader(reader);\n }\n }\n\n // Find lowest LOD start address\n const lowestPos = Math.min(...lodInfos.map(info => info.lodStartPosition));\n if (reader.pos !== lowestPos) {\n throw new Error(`Not all data read correctly, expected LODs to start at ${lowestPos}, but current position is ${reader.pos} (Difference: ${lowestPos - reader.pos})`);\n }\n\n odol.lods = new Array<OdolLod>(lodCount);\n // Read each LOD - ALL of them, including permanent ones\n for (let i = 0; i < lodCount; i++) {\n const lodInfo = lodInfos[i];\n\n // Skip LODs with start address at or beyond file size\n if (lodInfo.lodStartPosition >= reader.length) {\n continue;\n }\n\n reader.seek(lodInfo.lodStartPosition, 'begin');\n\n const lod = OdolLod.fromReader(reader);\n\n lod.resolution = lodInfo.resolution;\n lod.lodMetadata = lodInfos[i].lodMetadata; // Preserve the lodMetadata we read earlier\n odol.lods[i] = lod;\n\n // Validate position matches end address if end address is valid\n if (lodInfo.lodEndPosition > 0 && lodInfo.lodEndPosition <= reader.length) {\n if (reader.pos !== lodInfo.lodEndPosition) {\n console.warn(`LOD[${i}] position mismatch: expected ${lodInfo.lodEndPosition}, got ${reader.pos}`);\n }\n }\n }\n\n return odol;\n }\n\n /**\n * Get skeleton from model info\n */\n get skeleton(): Skeleton | null {\n return this.modelInfo?.skeleton ?? null;\n }\n\n /**\n * Get mass from model info\n */\n get mass(): number {\n return this.modelInfo?.mass ?? 0;\n }\n\n /**\n * Check if model has animations\n */\n get hasAnims(): boolean {\n return this.animations !== null;\n }\n\n /**\n * Get all unique textures across all LODs\n */\n get allTextures(): string[] {\n const textures = new Set<string>();\n for (const lod of this.lods) {\n for (const texture of lod.textures) {\n textures.add(texture);\n }\n }\n return Array.from(textures);\n }\n\n get allMaterials(): string[] {\n const materials = new Set<string>();\n for (const lod of this.lods) {\n for (const material of lod.materials) {\n materials.add(material.materialName);\n }\n }\n return Array.from(materials);\n }\n\n /**\n * Get statistics about the model\n */\n getStats(): Partial<P3dStats> {\n return {\n version: this.version,\n lodCount: this.lods.length,\n totalVertices: this.lods.reduce((sum, lod) => sum + lod.vertices.length, 0),\n totalFaces: this.lods.reduce((sum, lod) => sum + lod.faces.length, 0),\n textures: this.allTextures,\n materials: this.allMaterials,\n mass: this.mass,\n hasAnimations: this.hasAnims,\n skeleton: this.skeleton?.name ?? 'none'\n };\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,eAAN,MAAmB;EAKtB,YAAY,QAA6B;AAFzC,SAAU,WAAW;AAIjB,SAAK,SAAS,kBAAkB,aAAa,SAAS,IAAI,WAAW,MAAM;AAC3E,SAAK,OAAO,IAAI,SAAS,KAAK,OAAO,QAAQ,KAAK,OAAO,YAAY,KAAK,OAAO,UAAU;EA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,WAAoB;AACpB,WAAO,KAAK,eAAe;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,cAAwB;AACxB,UAAM,WAAW,oBAAI,IAAY;AACjC,eAAW,OAAO,KAAK,MAAM;AACzB,iBAAW,WAAW,IAAI,UAAU;AAChC,iBAAS,IAAI,OAAO;AAAA,MACxB;AAAA,IACJ;AACA,WAAO,MAAM,KAAK,QAAQ;AAAA,EAC9B;AAAA,EAEA,IAAI,eAAyB;AACzB,UAAM,YAAY,oBAAI,IAAY;AAClC,eAAW,OAAO,KAAK,MAAM;AACzB,iBAAW,YAAY,IAAI,WAAW;AAClC,kBAAU,IAAI,SAAS,YAAY;AAAA,MACvC;AAAA,IACJ;AACA,WAAO,MAAM,KAAK,SAAS;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA,EAKA,WAA8B;AAC1B,WAAO;AAAA,MACH,SAAS,KAAK;AAAA,MACd,UAAU,KAAK,KAAK;AAAA,MACpB,eAAe,KAAK,KAAK,OAAO,CAAC,KAAK,QAAQ,MAAM,IAAI,SAAS,QAAQ,CAAC;AAAA,MAC1E,YAAY,KAAK,KAAK,OAAO,CAAC,KAAK,QAAQ,MAAM,IAAI,MAAM,QAAQ,CAAC;AAAA,MACpE,UAAU,KAAK;AAAA,MACf,WAAW,KAAK;AAAA,MAChB,MAAM,KAAK;AAAA,MACX,eAAe,KAAK;AAAA,MACpB,UAAU,KAAK,UAAU,QAAQ;AAAA,IACrC;AAAA,EACJ;AACJ;AA3Ka,MAMc,wBAAwB;AANtC,MAOc,wBAAwB;AAP5C,IAAM,OAAN;",
|
|
6
|
+
"names": ["matched", "PointFlags", "FaceFlags", "Face", "Vector3", "Vector3", "Vector3", "Vector3", "Vector3", "ClipFlags", "SpecialFlags", "ShadowBufferSource", "MapType", "AnimationType", "Vector3", "Face", "Vector3", "Vector3", "Vector3"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BinaryReader } from '@bis-toolkit/utils';
|
|
2
|
+
import { Vertex } from './Vertex';
|
|
3
|
+
import { FaceFlags } from './FaceFlags';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a face (polygon) in the model
|
|
6
|
+
*/
|
|
7
|
+
export declare class Face {
|
|
8
|
+
sidesCnt: number;
|
|
9
|
+
vertices: Vertex[];
|
|
10
|
+
flags: FaceFlags;
|
|
11
|
+
texture: string;
|
|
12
|
+
material: string;
|
|
13
|
+
constructor(sidesCnt: number, vertices: Vertex[], flags: FaceFlags, texture: string, material: string);
|
|
14
|
+
static fromReader(reader: BinaryReader): Face;
|
|
15
|
+
/**
|
|
16
|
+
* Get only the used vertices (based on sidesCnt)
|
|
17
|
+
*/
|
|
18
|
+
getUsedVertices(): Vertex[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BinaryReader } from '@bis-toolkit/utils';
|
|
2
|
+
import { MlodLod } from './MlodLod';
|
|
3
|
+
import { P3D } from '../shared/P3d';
|
|
4
|
+
/**
|
|
5
|
+
* Main MLOD (Model LOD) file reader
|
|
6
|
+
* MLOD is the editable source format for Bohemia Interactive 3D models
|
|
7
|
+
*/
|
|
8
|
+
export declare class Mlod implements P3D {
|
|
9
|
+
version: number;
|
|
10
|
+
lods: MlodLod[];
|
|
11
|
+
static readonly SUPPORTED_VERSION = 257;
|
|
12
|
+
/**
|
|
13
|
+
* Read MLOD from a buffer
|
|
14
|
+
*/
|
|
15
|
+
static fromBuffer(buffer: Buffer | Uint8Array): Mlod;
|
|
16
|
+
/**
|
|
17
|
+
* Read MLOD from a BinaryReader
|
|
18
|
+
*/
|
|
19
|
+
static fromReader(reader: BinaryReader): Mlod;
|
|
20
|
+
/**
|
|
21
|
+
* Get all unique textures across all LODs
|
|
22
|
+
*/
|
|
23
|
+
get allTextures(): string[];
|
|
24
|
+
/**
|
|
25
|
+
* Get all unique materials across all LODs
|
|
26
|
+
*/
|
|
27
|
+
get allMaterials(): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Get statistics about the model
|
|
30
|
+
*/
|
|
31
|
+
getStats(): {
|
|
32
|
+
version: number;
|
|
33
|
+
lodCount: number;
|
|
34
|
+
totalVertices: number;
|
|
35
|
+
totalFaces: number;
|
|
36
|
+
textures: string[];
|
|
37
|
+
materials: string[];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BinaryReader } from '@bis-toolkit/utils';
|
|
2
|
+
import { type Tagg } from './Tagg';
|
|
3
|
+
import { Point } from './Point';
|
|
4
|
+
import { Vector3 } from './Vector3';
|
|
5
|
+
import { Face } from './Face';
|
|
6
|
+
import { ILod } from '../shared/Lod';
|
|
7
|
+
/**
|
|
8
|
+
* Represents a single LOD (Level of Detail) in an MLOD model
|
|
9
|
+
*/
|
|
10
|
+
export declare class MlodLod implements ILod {
|
|
11
|
+
resolution: number;
|
|
12
|
+
flags: number;
|
|
13
|
+
vertices: Point[];
|
|
14
|
+
normals: Vector3[];
|
|
15
|
+
faces: Face[];
|
|
16
|
+
taggs: Tagg[];
|
|
17
|
+
get resolutionName(): string;
|
|
18
|
+
get verticesCount(): number;
|
|
19
|
+
get facesCount(): number;
|
|
20
|
+
/**
|
|
21
|
+
* Get unique textures used in this LOD
|
|
22
|
+
*/
|
|
23
|
+
get textures(): string[];
|
|
24
|
+
/**
|
|
25
|
+
* Get unique materials used in this LOD
|
|
26
|
+
*/
|
|
27
|
+
get materials(): string[];
|
|
28
|
+
get namedSelections(): string[];
|
|
29
|
+
static fromReader(reader: BinaryReader): MlodLod;
|
|
30
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Vector3 } from './Vector3';
|
|
2
|
+
import { PointFlags } from './PointFlags';
|
|
3
|
+
import { BinaryReader } from '@bis-toolkit/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a vertex point in 3D space with flags
|
|
6
|
+
*/
|
|
7
|
+
export declare class Point extends Vector3 {
|
|
8
|
+
flags: PointFlags;
|
|
9
|
+
constructor(x?: number, y?: number, z?: number, flags?: PointFlags);
|
|
10
|
+
static fromReader(reader: BinaryReader): Point;
|
|
11
|
+
/**
|
|
12
|
+
* Returns a new Point with the X coordinate flipped.
|
|
13
|
+
* Useful for converting between coordinate systems (e.g., MLOD to Three.js)
|
|
14
|
+
*/
|
|
15
|
+
flipX(): Point;
|
|
16
|
+
/**
|
|
17
|
+
* Returns a new Point with the Y coordinate flipped.
|
|
18
|
+
* Useful for converting between coordinate systems
|
|
19
|
+
*/
|
|
20
|
+
flipY(): Point;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a new Point with the Z coordinate flipped.
|
|
23
|
+
* Useful for converting between coordinate systems
|
|
24
|
+
*/
|
|
25
|
+
flipZ(): Point;
|
|
26
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Vector3 } from './Vector3';
|
|
2
|
+
export interface AnimationTagg {
|
|
3
|
+
kind: 'Animation';
|
|
4
|
+
name: '#Animation#';
|
|
5
|
+
frameTime: number;
|
|
6
|
+
framePoints: Vector3[];
|
|
7
|
+
}
|
|
8
|
+
export interface LockTagg {
|
|
9
|
+
kind: 'Lock';
|
|
10
|
+
name: '#Lock#';
|
|
11
|
+
lockedPoints: boolean[];
|
|
12
|
+
lockedFaces: boolean[];
|
|
13
|
+
}
|
|
14
|
+
export interface MassTagg {
|
|
15
|
+
kind: 'Mass';
|
|
16
|
+
name: '#Mass#';
|
|
17
|
+
mass: number[];
|
|
18
|
+
}
|
|
19
|
+
export interface PropertyTagg {
|
|
20
|
+
kind: 'Property';
|
|
21
|
+
name: '#Property#';
|
|
22
|
+
propName: string;
|
|
23
|
+
propValue: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SelectedTagg {
|
|
26
|
+
kind: 'Selected';
|
|
27
|
+
name: '#Selected#';
|
|
28
|
+
weightedPoints: Uint8Array;
|
|
29
|
+
faces: boolean[];
|
|
30
|
+
}
|
|
31
|
+
export interface SharpEdgesTagg {
|
|
32
|
+
kind: 'SharpEdges';
|
|
33
|
+
name: '#SharpEdges#';
|
|
34
|
+
pointIndices: [number, number][];
|
|
35
|
+
}
|
|
36
|
+
export interface UVSetTagg {
|
|
37
|
+
kind: 'UVSet';
|
|
38
|
+
name: '#UVSet#';
|
|
39
|
+
uvSetNr: number;
|
|
40
|
+
faceUVs: [number, number][][];
|
|
41
|
+
}
|
|
42
|
+
export interface NamedSelectionTagg {
|
|
43
|
+
kind: 'NamedSelection';
|
|
44
|
+
name: string;
|
|
45
|
+
points: boolean[];
|
|
46
|
+
faces: boolean[];
|
|
47
|
+
}
|
|
48
|
+
export interface EndOfFileTagg {
|
|
49
|
+
kind: 'EndOfFile';
|
|
50
|
+
name: '#EndOfFile#';
|
|
51
|
+
}
|
|
52
|
+
export type Tagg = AnimationTagg | LockTagg | MassTagg | PropertyTagg | SelectedTagg | SharpEdgesTagg | UVSetTagg | NamedSelectionTagg | EndOfFileTagg;
|
|
53
|
+
export declare function getSelectedIndices(boolArray: boolean[]): number[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BinaryReader } from '@bis-toolkit/utils';
|
|
2
|
+
import { Face } from './Face';
|
|
3
|
+
import { type Tagg } from './Tagg';
|
|
4
|
+
export declare class TaggReader {
|
|
5
|
+
static readTaggs(reader: BinaryReader, verticesLength: number, faces: Face[]): Tagg[];
|
|
6
|
+
private static readTaggByName;
|
|
7
|
+
private static readAnimationTagg;
|
|
8
|
+
private static readLockTagg;
|
|
9
|
+
private static readMassTagg;
|
|
10
|
+
private static readPropertyTagg;
|
|
11
|
+
private static readSelectedTagg;
|
|
12
|
+
private static readSharpEdgesTagg;
|
|
13
|
+
private static readUvSetTagg;
|
|
14
|
+
private static readNamedSelectionTagg;
|
|
15
|
+
private static readEndOfFileTagg;
|
|
16
|
+
private static readFixedString;
|
|
17
|
+
private static ensureSectionEnd;
|
|
18
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 3D Vector class
|
|
3
|
+
*/
|
|
4
|
+
export declare class Vector3 {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
z: number;
|
|
8
|
+
constructor(x?: number, y?: number, z?: number);
|
|
9
|
+
get length(): number;
|
|
10
|
+
static fromReader(reader: {
|
|
11
|
+
readFloat(): number;
|
|
12
|
+
}): Vector3;
|
|
13
|
+
/**
|
|
14
|
+
* Returns a new Vector3 with the X coordinate flipped.
|
|
15
|
+
* Useful for converting between coordinate systems (e.g., MLOD to Three.js)
|
|
16
|
+
*/
|
|
17
|
+
flipX(): Vector3;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a new Vector3 with the Y coordinate flipped.
|
|
20
|
+
* Useful for converting between coordinate systems
|
|
21
|
+
*/
|
|
22
|
+
flipY(): Vector3;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a new Vector3 with the Z coordinate flipped.
|
|
25
|
+
* Useful for converting between coordinate systems
|
|
26
|
+
*/
|
|
27
|
+
flipZ(): Vector3;
|
|
28
|
+
toArray(): [number, number, number];
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BinaryReader } from '@bis-toolkit/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a face vertex with point/normal indices and UV coordinates
|
|
4
|
+
*/
|
|
5
|
+
export declare class Vertex {
|
|
6
|
+
pointIndex: number;
|
|
7
|
+
normalIndex: number;
|
|
8
|
+
u: number;
|
|
9
|
+
v: number;
|
|
10
|
+
constructor(pointIndex: number, normalIndex: number, u: number, v: number);
|
|
11
|
+
static fromReader(reader: BinaryReader): Vertex;
|
|
12
|
+
}
|