unreal.js
Version:
A pak reader for games like VALORANT & Fortnite written in Node.JS
32 lines (31 loc) • 1.44 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FStaticMeshSection = void 0;
const FRenderingObjectVersion_1 = require("../../../versions/FRenderingObjectVersion");
const index_1 = require("../../../../index");
class FStaticMeshSection {
constructor(Ar) {
this.materialIndex = Ar.readInt32();
this.firstIndex = Ar.readInt32();
this.numTriangles = Ar.readInt32();
this.minVertexIndex = Ar.readInt32();
this.maxVertexIndex = Ar.readInt32();
this.enableCollision = Ar.readBoolean();
this.castShadow = Ar.readBoolean();
this.forceOpaque = FRenderingObjectVersion_1.FRenderingObjectVersion.get(Ar) >=
FRenderingObjectVersion_1.EFRenderingObjectVersion.StaticMeshSectionForceOpaqueField && Ar.readBoolean();
this.visibleInRayTracing = Ar.versions.get("StaticMesh.HasVisibleInRayTracing") && Ar.readBoolean();
}
serialize(Ar) {
Ar.writeInt32(this.materialIndex);
Ar.writeInt32(this.firstIndex);
Ar.writeInt32(this.numTriangles);
Ar.writeInt32(this.minVertexIndex);
Ar.writeInt32(this.maxVertexIndex);
Ar.writeBoolean(this.enableCollision);
Ar.writeBoolean(this.castShadow);
if (Ar.game >= index_1.Game.GAME_UE4(25))
Ar.writeBoolean(this.forceOpaque);
}
}
exports.FStaticMeshSection = FStaticMeshSection;