feat: read stream

This commit is contained in:
TrèsAbhi committed 2024-02-04 17:55:48 -06:00
1 parent 016fe1c3d3
commit 93e405c370
11 files changed
+36 -36

No files matched your search

+4 -4
View File
@@ -1,7 +1,7 @@
import { Accessor, Document, Node, Scene } from '@gltf-transform/core';
import { times } from 'lodash';
import { Hierarchy, Sc2Stream } from '../streams/sc2';
import { ScgStream } from '../streams/scg';
import { Hierarchy, Sc2ReadStream } from '../streams/sc2';
import { ScgReadStream } from '../streams/scg';
import { VertexAttribute } from '../streams/scpg';
import {
vertexAttributeGLTFName,
@@ -16,8 +16,8 @@ Buffer.prototype.toJSON = function () {
export async function extractArmor(data: string, fileName: string) {
const sc2Path = `${data}/3d/Tanks/CollisionMeshes/${fileName}.sc2.dvpl`;
const scgPath = `${data}/3d/Tanks/CollisionMeshes/${fileName}.scg.dvpl`;
const sc2 = new Sc2Stream(await readDVPLFile(sc2Path)).sc2();
const scg = new ScgStream(await readDVPLFile(scgPath)).scg();
const sc2 = new Sc2ReadStream(await readDVPLFile(sc2Path)).sc2();
const scg = new ScgReadStream(await readDVPLFile(scgPath)).scg();
const document = new Document();
const scene = document.createScene();
const buffer = document.createBuffer();
+4 -4
View File
@@ -9,8 +9,8 @@ import {
Vector4Tuple,
} from 'three';
import { TextureMutation, readTexture } from '../blitzkrieg/readTexture';
import { Hierarchy, Sc2Stream, Textures } from '../streams/sc2';
import { ScgStream, vertexAttributeVectorSizes } from '../streams/scg';
import { Hierarchy, Sc2ReadStream, Textures } from '../streams/sc2';
import { ScgReadStream, vertexAttributeVectorSizes } from '../streams/scg';
import { VertexAttribute } from '../streams/scpg';
import { readDVPLFile } from './readDVPLFile';
@@ -48,8 +48,8 @@ export async function extractModel(
) {
const sc2Path = `${data}/3d/${path}.sc2.dvpl`;
const scgPath = `${data}/3d/${path}.scg.dvpl`;
const sc2 = new Sc2Stream(await readDVPLFile(sc2Path)).sc2();
const scg = new ScgStream(await readDVPLFile(scgPath)).scg();
const sc2 = new Sc2ReadStream(await readDVPLFile(sc2Path)).sc2();
const scg = new ScgReadStream(await readDVPLFile(scgPath)).scg();
const document = new Document();
const scene = document.createScene();
const buffer = document.createBuffer();