rw-parser-ng 2.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 +88 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +26 -0
- package/lib/renderware/RwFile.d.ts +10 -0
- package/lib/renderware/RwFile.js +33 -0
- package/lib/renderware/RwSections.d.ts +20 -0
- package/lib/renderware/RwSections.js +29 -0
- package/lib/renderware/dff/DffModelType.d.ts +5 -0
- package/lib/renderware/dff/DffModelType.js +9 -0
- package/lib/renderware/dff/DffParser.d.ts +155 -0
- package/lib/renderware/dff/DffParser.js +418 -0
- package/lib/renderware/errors/RwParseError.d.ts +6 -0
- package/lib/renderware/errors/RwParseError.js +34 -0
- package/lib/renderware/txd/TxdParser.d.ts +38 -0
- package/lib/renderware/txd/TxdParser.js +185 -0
- package/lib/renderware/utils/ImageDecoder.d.ts +23 -0
- package/lib/renderware/utils/ImageDecoder.js +512 -0
- package/lib/renderware/utils/ImageFormatEnums.d.ts +25 -0
- package/lib/renderware/utils/ImageFormatEnums.js +32 -0
- package/lib/renderware/utils/RwVersion.d.ts +7 -0
- package/lib/renderware/utils/RwVersion.js +30 -0
- package/lib/scripts/sort_models.d.ts +1 -0
- package/lib/scripts/sort_models.js +185 -0
- package/lib/scripts/sort_worker.d.ts +1 -0
- package/lib/scripts/sort_worker.js +140 -0
- package/lib/src/index.d.ts +8 -0
- package/lib/src/index.js +28 -0
- package/lib/src/renderware/RwFile.d.ts +10 -0
- package/lib/src/renderware/RwFile.js +33 -0
- package/lib/src/renderware/RwSections.d.ts +20 -0
- package/lib/src/renderware/RwSections.js +29 -0
- package/lib/src/renderware/common/types.d.ts +50 -0
- package/lib/src/renderware/common/types.js +2 -0
- package/lib/src/renderware/dff/DffModelType.d.ts +5 -0
- package/lib/src/renderware/dff/DffModelType.js +9 -0
- package/lib/src/renderware/dff/DffParser.d.ts +112 -0
- package/lib/src/renderware/dff/DffParser.js +418 -0
- package/lib/src/renderware/errors/RwParseError.d.ts +6 -0
- package/lib/src/renderware/errors/RwParseError.js +34 -0
- package/lib/src/renderware/ifp/IfpData.d.ts +28 -0
- package/lib/src/renderware/ifp/IfpData.js +9 -0
- package/lib/src/renderware/ifp/IfpParser.d.ts +12 -0
- package/lib/src/renderware/ifp/IfpParser.js +196 -0
- package/lib/src/renderware/txd/TxdParser.d.ts +38 -0
- package/lib/src/renderware/txd/TxdParser.js +185 -0
- package/lib/src/renderware/utils/ImageDecoder.d.ts +23 -0
- package/lib/src/renderware/utils/ImageDecoder.js +512 -0
- package/lib/src/renderware/utils/ImageFormatEnums.d.ts +25 -0
- package/lib/src/renderware/utils/ImageFormatEnums.js +32 -0
- package/lib/src/renderware/utils/RwVersion.d.ts +7 -0
- package/lib/src/renderware/utils/RwVersion.js +30 -0
- package/lib/src/utils/ByteStream.d.ts +17 -0
- package/lib/src/utils/ByteStream.js +65 -0
- package/lib/utils/ByteStream.d.ts +16 -0
- package/lib/utils/ByteStream.js +60 -0
- package/package.json +64 -0
- package/src/index.ts +10 -0
- package/src/renderware/RwFile.ts +22 -0
- package/src/renderware/RwSections.ts +27 -0
- package/src/renderware/common/types.ts +59 -0
- package/src/renderware/dff/DffModelType.ts +5 -0
- package/src/renderware/dff/DffParser.ts +596 -0
- package/src/renderware/errors/RwParseError.ts +11 -0
- package/src/renderware/ifp/IfpData.ts +33 -0
- package/src/renderware/ifp/IfpParser.ts +203 -0
- package/src/renderware/txd/TxdParser.ts +234 -0
- package/src/renderware/utils/ImageDecoder.ts +571 -0
- package/src/renderware/utils/ImageFormatEnums.ts +28 -0
- package/src/renderware/utils/RwVersion.ts +28 -0
- package/src/utils/ByteStream.ts +75 -0
- package/tsconfig.json +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# RenderWare Binary Stream Parser NG
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/rw-parser-ng)
|
|
4
|
+
[](https://github.com/DepsCian/rw-parser-ng/blob/master/LICENSE)
|
|
5
|
+
|
|
6
|
+
Parses RenderWare files (`.dff`, `.txd`, `.ifp`) into a usable format.
|
|
7
|
+
|
|
8
|
+
This is a fork of the original [rw-parser](https://github.com/Timic3/rw-parser) by Timic3, which is no longer active maintained. This version aims to continue development, fix bugs, and add new features.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
* **DFF (Model) Parsing:** Extracts geometry, materials, frames, and skinning data.
|
|
13
|
+
* **TXD (Texture Dictionary) Parsing:** Extracts texture information, including name, resolution and pixel data.
|
|
14
|
+
* **IFP (Animation) Parsing:** Extracts animation data, including bone names, keyframes, and timings.
|
|
15
|
+
* **Cross-Platform:** Works in both Node.js and modern web browsers.
|
|
16
|
+
* **TypeScript Support:** Fully typed for a better development experience.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
Install `rw-parser-ng` using npm:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install --save rw-parser-ng
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### ES6 Module
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import { DffParser, TxdParser, IfpParser } from 'rw-parser-ng';
|
|
32
|
+
import { readFileSync } from 'fs';
|
|
33
|
+
|
|
34
|
+
// DFF
|
|
35
|
+
const dffBuffer = readFileSync('path/to/your/model.dff');
|
|
36
|
+
const dffParser = new DffParser(dffBuffer);
|
|
37
|
+
const dffData = dffParser.parse();
|
|
38
|
+
console.log(dffData);
|
|
39
|
+
|
|
40
|
+
// TXD
|
|
41
|
+
const txdBuffer = readFileSync('path/to/your/textures.txd');
|
|
42
|
+
const txdParser = new TxdParser(txdBuffer);
|
|
43
|
+
const txdData = txdParser.parse();
|
|
44
|
+
console.log(txdData);
|
|
45
|
+
|
|
46
|
+
// IFP
|
|
47
|
+
const ifpBuffer = readFileSync('path/to/your/animation.ifp');
|
|
48
|
+
const ifpParser = new IfpParser(ifpBuffer);
|
|
49
|
+
const ifpData = ifpParser.parse();
|
|
50
|
+
console.log(ifpData);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Browser Usage
|
|
54
|
+
|
|
55
|
+
This library can also be used in the browser. You will need a bundler like Webpack or Rollup to handle the Node.js `Buffer` dependency.
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
import { DffParser } from 'rw-parser-ng';
|
|
59
|
+
|
|
60
|
+
async function parseDffFromUrl(url) {
|
|
61
|
+
const response = await fetch(url);
|
|
62
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
63
|
+
const buffer = Buffer.from(arrayBuffer); // Requires Buffer polyfill
|
|
64
|
+
|
|
65
|
+
const dffParser = new DffParser(buffer);
|
|
66
|
+
const dffData = dffParser.parse();
|
|
67
|
+
console.log(dffData);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
parseDffFromUrl('path/to/your/model.dff');
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Development
|
|
74
|
+
|
|
75
|
+
1. Clone the repository: `git clone https://github.com/DepsCian/rw-parser-ng.git`
|
|
76
|
+
2. Install dependencies: `npm install`
|
|
77
|
+
3. Build the project: `npm run build`
|
|
78
|
+
4. Run tests: `npm test`
|
|
79
|
+
|
|
80
|
+
To watch for changes during development, use `npm run dev`.
|
|
81
|
+
|
|
82
|
+
## Contributing
|
|
83
|
+
|
|
84
|
+
Contributions are welcome! Please feel free to open an issue or submit a pull request.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
This project is licensed under the GPL-3.0 License. See the [LICENSE](LICENSE) file for details.
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ByteStream } from './utils/ByteStream';
|
|
2
|
+
export { RwFile } from './renderware/RwFile';
|
|
3
|
+
export { RwSections } from './renderware/RwSections';
|
|
4
|
+
export * from './renderware/dff/DffParser';
|
|
5
|
+
export * from './renderware/txd/TxdParser';
|
|
6
|
+
export * from './renderware/dff/DffModelType';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.RwSections = exports.RwFile = exports.ByteStream = void 0;
|
|
18
|
+
var ByteStream_1 = require("./utils/ByteStream");
|
|
19
|
+
Object.defineProperty(exports, "ByteStream", { enumerable: true, get: function () { return ByteStream_1.ByteStream; } });
|
|
20
|
+
var RwFile_1 = require("./renderware/RwFile");
|
|
21
|
+
Object.defineProperty(exports, "RwFile", { enumerable: true, get: function () { return RwFile_1.RwFile; } });
|
|
22
|
+
var RwSections_1 = require("./renderware/RwSections");
|
|
23
|
+
Object.defineProperty(exports, "RwSections", { enumerable: true, get: function () { return RwSections_1.RwSections; } });
|
|
24
|
+
__exportStar(require("./renderware/dff/DffParser"), exports);
|
|
25
|
+
__exportStar(require("./renderware/txd/TxdParser"), exports);
|
|
26
|
+
__exportStar(require("./renderware/dff/DffModelType"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ByteStream } from "../utils/ByteStream";
|
|
2
|
+
export interface RwSectionHeader {
|
|
3
|
+
sectionType: number;
|
|
4
|
+
sectionSize: number;
|
|
5
|
+
versionNumber: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class RwFile extends ByteStream {
|
|
8
|
+
constructor(stream: Buffer);
|
|
9
|
+
readSectionHeader(): RwSectionHeader;
|
|
10
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.RwFile = void 0;
|
|
19
|
+
var ByteStream_1 = require("../utils/ByteStream");
|
|
20
|
+
var RwFile = /** @class */ (function (_super) {
|
|
21
|
+
__extends(RwFile, _super);
|
|
22
|
+
function RwFile(stream) {
|
|
23
|
+
return _super.call(this, stream) || this;
|
|
24
|
+
}
|
|
25
|
+
RwFile.prototype.readSectionHeader = function () {
|
|
26
|
+
var sectionType = this.readUint32();
|
|
27
|
+
var sectionSize = this.readUint32();
|
|
28
|
+
var versionNumber = this.readUint32();
|
|
29
|
+
return { sectionType: sectionType, sectionSize: sectionSize, versionNumber: versionNumber };
|
|
30
|
+
};
|
|
31
|
+
return RwFile;
|
|
32
|
+
}(ByteStream_1.ByteStream));
|
|
33
|
+
exports.RwFile = RwFile;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum RwSections {
|
|
2
|
+
RwStruct = 1,
|
|
3
|
+
RwString = 2,
|
|
4
|
+
RwExtension = 3,
|
|
5
|
+
RwTexture = 6,
|
|
6
|
+
RwMaterial = 7,
|
|
7
|
+
RwMaterialList = 8,
|
|
8
|
+
RwFrameList = 14,
|
|
9
|
+
RwGeometry = 15,
|
|
10
|
+
RwClump = 16,
|
|
11
|
+
RwAtomic = 20,
|
|
12
|
+
RwTextureNative = 21,
|
|
13
|
+
RwTextureDictionary = 22,
|
|
14
|
+
RwGeometryList = 26,
|
|
15
|
+
RwSkin = 278,
|
|
16
|
+
RwAnim = 286,
|
|
17
|
+
RwMaterialEffectsPLG = 288,
|
|
18
|
+
RwReflectionMaterial = 39056124,
|
|
19
|
+
RwNodeName = 39056126
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RwSections = void 0;
|
|
4
|
+
var RwSections;
|
|
5
|
+
(function (RwSections) {
|
|
6
|
+
// Core
|
|
7
|
+
RwSections[RwSections["RwStruct"] = 1] = "RwStruct";
|
|
8
|
+
RwSections[RwSections["RwString"] = 2] = "RwString";
|
|
9
|
+
RwSections[RwSections["RwExtension"] = 3] = "RwExtension";
|
|
10
|
+
RwSections[RwSections["RwTexture"] = 6] = "RwTexture";
|
|
11
|
+
RwSections[RwSections["RwMaterial"] = 7] = "RwMaterial";
|
|
12
|
+
RwSections[RwSections["RwMaterialList"] = 8] = "RwMaterialList";
|
|
13
|
+
RwSections[RwSections["RwFrameList"] = 14] = "RwFrameList";
|
|
14
|
+
RwSections[RwSections["RwGeometry"] = 15] = "RwGeometry";
|
|
15
|
+
RwSections[RwSections["RwClump"] = 16] = "RwClump";
|
|
16
|
+
RwSections[RwSections["RwAtomic"] = 20] = "RwAtomic";
|
|
17
|
+
RwSections[RwSections["RwTextureNative"] = 21] = "RwTextureNative";
|
|
18
|
+
RwSections[RwSections["RwTextureDictionary"] = 22] = "RwTextureDictionary";
|
|
19
|
+
RwSections[RwSections["RwGeometryList"] = 26] = "RwGeometryList";
|
|
20
|
+
RwSections[RwSections["RwSkin"] = 278] = "RwSkin";
|
|
21
|
+
RwSections[RwSections["RwAnim"] = 286] = "RwAnim";
|
|
22
|
+
// Toolkit
|
|
23
|
+
RwSections[RwSections["RwMaterialEffectsPLG"] = 288] = "RwMaterialEffectsPLG";
|
|
24
|
+
// R* specific RW plugins
|
|
25
|
+
RwSections[RwSections["RwReflectionMaterial"] = 39056124] = "RwReflectionMaterial";
|
|
26
|
+
// This was renamed to RwNodeName from RwFrame to prevent confusion.
|
|
27
|
+
// https://gtamods.com/wiki/Node_Name_(RW_Section)
|
|
28
|
+
RwSections[RwSections["RwNodeName"] = 39056126] = "RwNodeName";
|
|
29
|
+
})(RwSections || (exports.RwSections = RwSections = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DffModelType = void 0;
|
|
4
|
+
var DffModelType;
|
|
5
|
+
(function (DffModelType) {
|
|
6
|
+
DffModelType[DffModelType["GENERIC"] = 0] = "GENERIC";
|
|
7
|
+
DffModelType[DffModelType["SKIN"] = 1] = "SKIN";
|
|
8
|
+
DffModelType[DffModelType["VEHICLE"] = 2] = "VEHICLE";
|
|
9
|
+
})(DffModelType || (exports.DffModelType = DffModelType = {}));
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { RwFile } from '../RwFile';
|
|
2
|
+
import { DffModelType } from './DffModelType';
|
|
3
|
+
export interface RwDff {
|
|
4
|
+
modelType: DffModelType;
|
|
5
|
+
version: string;
|
|
6
|
+
versionNumber: number;
|
|
7
|
+
geometryList: RwGeometryList | null;
|
|
8
|
+
frameList: RwFrameList | null;
|
|
9
|
+
atomics: number[];
|
|
10
|
+
dummies: string[];
|
|
11
|
+
animNodes: RwAnimNode[];
|
|
12
|
+
}
|
|
13
|
+
export interface RwClump {
|
|
14
|
+
atomicCount: number;
|
|
15
|
+
lightCount?: number;
|
|
16
|
+
cameraCount?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface RwAnimNode {
|
|
19
|
+
boneId: number;
|
|
20
|
+
bonesCount: number;
|
|
21
|
+
bones: RwBone[];
|
|
22
|
+
}
|
|
23
|
+
export interface RwBone {
|
|
24
|
+
boneId: number;
|
|
25
|
+
boneIndex: number;
|
|
26
|
+
flags: number;
|
|
27
|
+
}
|
|
28
|
+
export interface RwFrame {
|
|
29
|
+
rotationMatrix: RwMatrix3;
|
|
30
|
+
coordinatesOffset: RwVector3;
|
|
31
|
+
parentFrame: number;
|
|
32
|
+
}
|
|
33
|
+
export interface RwFrameList {
|
|
34
|
+
frameCount: number;
|
|
35
|
+
frames: RwFrame[];
|
|
36
|
+
}
|
|
37
|
+
export interface RwTexture {
|
|
38
|
+
textureFiltering: number;
|
|
39
|
+
uAddressing: number;
|
|
40
|
+
vAddressing: number;
|
|
41
|
+
usesMipLevels: boolean;
|
|
42
|
+
textureName: string;
|
|
43
|
+
}
|
|
44
|
+
export interface RwMaterial {
|
|
45
|
+
color: RwColor;
|
|
46
|
+
isTextured: boolean;
|
|
47
|
+
ambient?: number;
|
|
48
|
+
specular?: number;
|
|
49
|
+
diffuse?: number;
|
|
50
|
+
texture?: RwTexture;
|
|
51
|
+
}
|
|
52
|
+
export interface RwMaterialList {
|
|
53
|
+
materialInstanceCount: number;
|
|
54
|
+
materialData: RwMaterial[];
|
|
55
|
+
}
|
|
56
|
+
export interface RwGeometry {
|
|
57
|
+
vertexColorInformation: RwColor[];
|
|
58
|
+
textureCoordinatesCount: number;
|
|
59
|
+
textureMappingInformation: RwTextureCoordinate[][];
|
|
60
|
+
hasVertices: boolean;
|
|
61
|
+
hasNormals: boolean;
|
|
62
|
+
triangleInformation: RwTriangle[];
|
|
63
|
+
vertexInformation: RwVector3[];
|
|
64
|
+
normalInformation: RwVector3[];
|
|
65
|
+
boundingSphere?: RwSphere;
|
|
66
|
+
materialList: RwMaterialList;
|
|
67
|
+
binMesh: RwBinMesh;
|
|
68
|
+
skin?: RwSkin;
|
|
69
|
+
}
|
|
70
|
+
export interface RwGeometryList {
|
|
71
|
+
geometricObjectCount: number;
|
|
72
|
+
geometries: RwGeometry[];
|
|
73
|
+
}
|
|
74
|
+
export interface RwAtomic {
|
|
75
|
+
frameIndex: number;
|
|
76
|
+
geometryIndex: number;
|
|
77
|
+
flags: number;
|
|
78
|
+
}
|
|
79
|
+
export interface RwBinMesh {
|
|
80
|
+
meshCount: number;
|
|
81
|
+
meshes: RwMesh[];
|
|
82
|
+
}
|
|
83
|
+
export interface RwSkin {
|
|
84
|
+
boneCount: number;
|
|
85
|
+
usedBoneCount: number;
|
|
86
|
+
maxWeightsPerVertex: number;
|
|
87
|
+
boneVertexIndices: number[][];
|
|
88
|
+
vertexWeights: number[][];
|
|
89
|
+
inverseBoneMatrices: RwMatrix4[];
|
|
90
|
+
}
|
|
91
|
+
export interface RwMesh {
|
|
92
|
+
materialIndex: number;
|
|
93
|
+
indexCount: number;
|
|
94
|
+
indices: number[];
|
|
95
|
+
}
|
|
96
|
+
export interface RwMatrix3 {
|
|
97
|
+
right: RwVector3;
|
|
98
|
+
up: RwVector3;
|
|
99
|
+
at: RwVector3;
|
|
100
|
+
}
|
|
101
|
+
export interface RwMatrix4 {
|
|
102
|
+
right: RwVector4;
|
|
103
|
+
up: RwVector4;
|
|
104
|
+
at: RwVector4;
|
|
105
|
+
transform: RwVector4;
|
|
106
|
+
}
|
|
107
|
+
export interface RwColor {
|
|
108
|
+
r: number;
|
|
109
|
+
g: number;
|
|
110
|
+
b: number;
|
|
111
|
+
a: number;
|
|
112
|
+
}
|
|
113
|
+
export interface RwVector2 {
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
}
|
|
117
|
+
export interface RwVector3 {
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
z: number;
|
|
121
|
+
}
|
|
122
|
+
export interface RwVector4 {
|
|
123
|
+
x: number;
|
|
124
|
+
y: number;
|
|
125
|
+
z: number;
|
|
126
|
+
t: number;
|
|
127
|
+
}
|
|
128
|
+
export interface RwTextureCoordinate {
|
|
129
|
+
u: number;
|
|
130
|
+
v: number;
|
|
131
|
+
}
|
|
132
|
+
export interface RwTriangle {
|
|
133
|
+
vector: RwVector3;
|
|
134
|
+
materialId: number;
|
|
135
|
+
}
|
|
136
|
+
export interface RwSphere {
|
|
137
|
+
vector: RwVector3;
|
|
138
|
+
radius: number;
|
|
139
|
+
}
|
|
140
|
+
export declare class DffParser extends RwFile {
|
|
141
|
+
constructor(buffer: Buffer);
|
|
142
|
+
parse(): RwDff;
|
|
143
|
+
readClump(): RwClump;
|
|
144
|
+
readFrameList(): RwFrameList;
|
|
145
|
+
readGeometryList(): RwGeometryList;
|
|
146
|
+
readGeometry(versionNumber: number): RwGeometry;
|
|
147
|
+
readBinMesh(): RwBinMesh;
|
|
148
|
+
readSkin(vertexCount: number): RwSkin;
|
|
149
|
+
readAnimNode(): RwAnimNode;
|
|
150
|
+
readMesh(): RwMesh;
|
|
151
|
+
readMaterialList(): RwMaterialList;
|
|
152
|
+
readMaterial(): RwMaterial;
|
|
153
|
+
readTexture(): RwTexture;
|
|
154
|
+
readAtomic(): RwAtomic;
|
|
155
|
+
}
|