@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.
@@ -0,0 +1,66 @@
1
+ import { OdolReader } from './OdolReader';
2
+ import { SpecialFlags } from './enums';
3
+ /**
4
+ * Face (polygon) in ODOL
5
+ */
6
+ export declare class Face {
7
+ vertexIndices: number[];
8
+ size: number;
9
+ static fromReader(reader: OdolReader): Face;
10
+ }
11
+ /**
12
+ * Collection of polygons
13
+ */
14
+ export declare class Polygons {
15
+ faces: Face[];
16
+ unk: number;
17
+ static fromReader(reader: OdolReader): Polygons;
18
+ }
19
+ /**
20
+ * Section (material/texture group)
21
+ */
22
+ export declare class Section {
23
+ faceLowerIndex: number;
24
+ faceUpperIndex: number;
25
+ minBoneIndex: number;
26
+ bonesCount: number;
27
+ textureIndex: number;
28
+ commonFaceFlags: SpecialFlags;
29
+ materialIndex: number;
30
+ material: string;
31
+ areaOverTex: number[];
32
+ private unk1;
33
+ static fromReader(reader: OdolReader): Section;
34
+ getFaceIndexes(faces: Face[]): number[];
35
+ }
36
+ /**
37
+ * Named selection (vertex/face groups)
38
+ */
39
+ export declare class NamedSelection {
40
+ name: string;
41
+ isSectional: boolean;
42
+ selectedFaces: number[];
43
+ sections: number[];
44
+ selectedVertices: number[];
45
+ selectedVerticesWeights: Uint8Array;
46
+ static fromReader(reader: OdolReader): NamedSelection;
47
+ }
48
+ /**
49
+ * UV coordinate set
50
+ */
51
+ export declare class UVSet {
52
+ private minU;
53
+ private minV;
54
+ private maxU;
55
+ private maxV;
56
+ private nVertices;
57
+ private isDefault;
58
+ private defaultValue;
59
+ private uvData;
60
+ static fromReader(reader: OdolReader): UVSet;
61
+ /**
62
+ * Get UV data as float array
63
+ */
64
+ getUVData(): Float32Array;
65
+ private decodeUVComponent;
66
+ }
@@ -0,0 +1,5 @@
1
+ export interface ILod {
2
+ get resolutionName(): string;
3
+ get verticesCount(): number;
4
+ get facesCount(): number;
5
+ }
@@ -0,0 +1,19 @@
1
+ import { ILod } from "./Lod";
2
+ export interface P3dStats {
3
+ version: number;
4
+ lodCount: number;
5
+ totalVertices: number;
6
+ totalFaces: number;
7
+ textures: string[];
8
+ materials: string[];
9
+ mass: number;
10
+ skeleton: string;
11
+ hasAnimations: boolean;
12
+ }
13
+ export interface P3D {
14
+ version: number;
15
+ lods: ILod[];
16
+ get allMaterials(): string[];
17
+ get allTextures(): string[];
18
+ getStats(): Partial<P3dStats>;
19
+ }
@@ -0,0 +1 @@
1
+ export declare function getLodName(resolution: number): string;
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@bis-toolkit/p3d",
3
+ "version": "1.0.0",
4
+ "description": "P3D (Arma/DayZ Model Format) reader",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "scripts": {
24
+ "build": "npm run build:types && npm run build:bundle",
25
+ "build:types": "tsc --declaration --emitDeclarationOnly --outDir dist",
26
+ "build:bundle": "node esbuild.config.js",
27
+ "prepublishOnly": "npm run build",
28
+ "watch": "tsc --watch",
29
+ "lint": "eslint",
30
+ "lint:fix": "eslint --fix"
31
+ },
32
+ "keywords": [
33
+ "mlod",
34
+ "odol",
35
+ "p3d",
36
+ "model",
37
+ "3d",
38
+ "arma",
39
+ "dayz"
40
+ ],
41
+ "author": "Alpine Labs",
42
+ "license": "GPL-3.0-or-later",
43
+ "devDependencies": {
44
+ "@types/node": "^25.0.3",
45
+ "@typescript-eslint/eslint-plugin": "^8.52.0",
46
+ "@typescript-eslint/parser": "^8.52.0",
47
+ "esbuild": "^0.27.2",
48
+ "eslint": "^9.39.2",
49
+ "typescript": "^5.9.3",
50
+ "typescript-eslint": "^8.52.0"
51
+ },
52
+ "dependencies": {
53
+ "@bis-toolkit/utils": "^1.0.0",
54
+ "@bis-toolkit/cppparser": "^1.0.0"
55
+ }
56
+ }