mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: glb convertion
This commit is contained in:
1 parent
9db43db3cf
commit
6d2bb7b131
3 files changed
+207
-45
No files matched your search
@@ -34,7 +34,7 @@ enum KAType {
|
||||
UNCONFIRMED_TRANSFORM = 29,
|
||||
}
|
||||
|
||||
enum VertexType {
|
||||
export enum VertexType {
|
||||
VERTEX,
|
||||
NORMAL,
|
||||
COLOR,
|
||||
@@ -90,14 +90,18 @@ const VECTOR_SIZES = [
|
||||
[
|
||||
VertexType.VERTEX,
|
||||
VertexType.NORMAL,
|
||||
VertexType.TANGENT,
|
||||
VertexType.BINORMAL,
|
||||
VertexType.CUBETEXCOORD0,
|
||||
VertexType.CUBETEXCOORD1,
|
||||
VertexType.CUBETEXCOORD2,
|
||||
VertexType.CUBETEXCOORD3,
|
||||
],
|
||||
[VertexType.PIVOT4, VertexType.JOINTINDEX, VertexType.JOINTWEIGHT],
|
||||
[
|
||||
VertexType.PIVOT4,
|
||||
VertexType.JOINTINDEX,
|
||||
VertexType.JOINTWEIGHT,
|
||||
VertexType.TANGENT,
|
||||
],
|
||||
];
|
||||
|
||||
export class SCPGStream {
|
||||
@@ -252,6 +256,8 @@ export class SCPGStream {
|
||||
});
|
||||
}
|
||||
|
||||
console.log(verticesStream.readRemaining().length);
|
||||
|
||||
return {
|
||||
id: polygonGroupRaw['#id'].readBigUInt64LE(),
|
||||
vertices,
|
||||
|
||||
+10
-8
@@ -1,3 +1,5 @@
|
||||
import { Vector3Tuple, Vector4Tuple } from 'three';
|
||||
|
||||
export interface SC2 {
|
||||
'#dataNodes': DataNode[];
|
||||
'#hierarchy': Hierarchy[];
|
||||
@@ -67,12 +69,12 @@ interface Textures {
|
||||
normalmap: string;
|
||||
}
|
||||
|
||||
interface Hierarchy {
|
||||
export interface Hierarchy {
|
||||
'##name': 'Entity';
|
||||
'#hierarchy'?: Hierarchy[];
|
||||
components: Components;
|
||||
flags: number;
|
||||
id: number;
|
||||
id: bigint;
|
||||
name: string;
|
||||
}
|
||||
|
||||
@@ -104,12 +106,12 @@ interface RbAabbox {
|
||||
type Component =
|
||||
| {
|
||||
'comp.typename': 'TransformComponent';
|
||||
'tc.localRotation': number[];
|
||||
'tc.localScale': number[];
|
||||
'tc.localTranslation': number[];
|
||||
'tc.worldRotation': number[];
|
||||
'tc.worldScale': number[];
|
||||
'tc.worldTranslation': number[];
|
||||
'tc.localRotation': Vector4Tuple;
|
||||
'tc.localScale': Vector3Tuple;
|
||||
'tc.localTranslation': Vector3Tuple;
|
||||
'tc.worldRotation': Vector4Tuple;
|
||||
'tc.worldScale': Vector3Tuple;
|
||||
'tc.worldTranslation': Vector3Tuple;
|
||||
}
|
||||
| {
|
||||
'comp.typename': 'RenderComponent';
|
||||
|
||||
Reference in new issue
Block a user