feat: mesh omit

This commit is contained in:
TrèsAbhi committed 2023-12-30 13:02:47 -06:00
1 parent 7e0fb82905
commit b433129354
3 files changed
+10 -3

No files matched your search

+2 -2
View File
@@ -517,8 +517,8 @@ if (allTargets || targets?.includes('tankModels')) {
// if (id !== 24609) continue; // concept 1b
// if (id !== 4417) continue; // amx m4 mle
// if (id !== 7297) continue; // 60tp
// if (id !== 1) continue; // t-34
if (id !== 6753) continue; // type 71
if (id !== 1) continue; // t-34
// if (id !== 6753) continue; // type 71
// if (id !== 5137) continue; // tiger ii
// if (id !== 6225) continue; // fv215b
+5 -1
View File
@@ -35,6 +35,8 @@ const vertexAttributeGltfVectorSizes = {
[VertexAttribute.TANGENT]: 4,
} as const;
const omitNames = ['chassis_chassis_', 'chassis_track_crash_', 'HP_'];
export async function extractModel(
data: string,
path: string,
@@ -143,6 +145,8 @@ export async function extractModel(
function parseHierarchies(hierarchies: Hierarchy[], parent: Scene | Node) {
hierarchies.forEach((hierarchy) => {
if (omitNames.some((omit) => hierarchy.name.startsWith(omit))) return;
const node = document.createNode(hierarchy.name);
const components = times(
hierarchy.components.count,
@@ -314,7 +318,7 @@ export async function extractModel(
// rotate 90 degrees on the x axis
const rootNode = document
.createNode()
.createNode('root')
.setRotation([Math.cos(Math.PI / 4), 0, 0, -Math.sin(Math.PI / 4)]);
scene.addChild(rootNode);
+3
View File
@@ -277,6 +277,9 @@ export class DdsStream extends WindowsStream {
resolveDxgiFormat(header: ReturnType<typeof this.header>) {
switch (header.pf.fourCC) {
case 'DXT1':
return DxgiFormat.BC1_UNORM;
case 'DXT3':
return DxgiFormat.BC2_UNORM;