@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/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @bis-toolkit/p3d
2
+
3
+ A library for reading P3D model files (MLOD and ODOL formats) used in Bohemia Interactive games (Arma, DayZ).
4
+
5
+ ## Features
6
+
7
+ - **MLOD Reader**: Parse editable P3D model files (.p3d, .mlod)
8
+ - **ODOL Reader**: Parse binary P3D model files (binarized .p3d)
9
+ - Full TypeScript support with type definitions
10
+ - Zero dependencies (except for shared BIS Toolkit utilities)
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @bis-toolkit/p3d
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### MLOD (Editable P3D Format)
21
+
22
+ ```typescript
23
+ import { Mlod } from '@bis-toolkit/p3d';
24
+
25
+ const buffer = new Uint8Array(/* your file data */);
26
+ const mlod = Mlod.fromBuffer(buffer);
27
+
28
+ // Access LODs
29
+ mlod.lods.forEach(lod => {
30
+ console.log(`LOD: ${lod.resolutionName}`);
31
+ console.log(`Vertices: ${lod.vertices.length}`);
32
+ console.log(`Faces: ${lod.faces.length}`);
33
+ });
34
+ ```
35
+
36
+ ### ODOL (Binary P3D Format)
37
+
38
+ ```typescript
39
+ import { Odol } from '@bis-toolkit/p3d';
40
+
41
+ const buffer = new Uint8Array(/* your file data */);
42
+ const odol = Odol.fromBuffer(buffer);
43
+
44
+ // Access model information
45
+ console.log(`Version: ${odol.version}`);
46
+ console.log(`LODs: ${odol.lods.length}`);
47
+
48
+ // Access LODs
49
+ odol.lods.forEach(lod => {
50
+ console.log(`LOD: ${lod.resolutionName}`);
51
+ console.log(`Vertices: ${lod.vertices.length}`);
52
+ console.log(`Faces: ${lod.faces.length}`);
53
+ });
54
+ ```
55
+
56
+ ## License
57
+
58
+ GPLv3 © Alpine Labs - see [LICENSE](LICENSE).
@@ -0,0 +1,4 @@
1
+ export * as MLOD from './mlod/index';
2
+ export * as ODOL from './odol/index';
3
+ export { Mlod, MlodLod } from './mlod/index';
4
+ export { Odol, OdolLod, ModelInfo, OdolReader } from './odol/index';