Add CAABoxCollisionTree (CLSN)

This commit is contained in:
Phillip Stephens
2023-02-15 10:23:36 -08:00
parent 4fac8378f1
commit 30264e0694
3 changed files with 90 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
#ifndef _CAABOXCOLLISIONTREE
#define _CAABOXCOLLISIONTREE
#include "CTransform4f.bt"
struct CCollisionMaterial {
uint orientation;
uint materialType;
uint worldType;
uint behaviorList;
uint filterList;
};
struct CIndexedTriangle {
uint idx1;
uint idx2;
uint idx3;
ushort material;
ushort unk2;
};
struct CollisionMaterialVector {
uint count;
CCollisionMaterial collisionMaterials[count];
};
struct VertexVector {
uint count;
CVector3f vertices[count];
};
struct IndexedTriangleVector {
uint count;
CIndexedTriangle tris[count];
};
struct ModConData {
char id[16];
CTransform4f xf;
ushort unk;
};
struct CAABoxCollisionTree(uint64 size) {
local uint64 start<format = hex, hidden = true> = FTell();
while (FTell() != start + size) {
struct Chunk {
ChunkDescriptor desc;
union {
switch (desc.id) {
case "MTRL":
CollisionMaterialVector materials;
break;
case "TRIS":
IndexedTriangleVector triangles;
break;
case "VERT":
VertexVector vertices;
break;
}
char raw[desc.size];
} data;
} chunks;
}
};
#endif // _CAABOXCOLLISIONTREE
+20
View File
@@ -0,0 +1,20 @@
#ifndef _CTRANSFORM4F
#define _CTRANSFORM4F
struct CTransform4f {
float m00;
float m01;
float m02;
float m03;
float m10;
float m11;
float m12;
float m13;
float m20;
float m21;
float m22;
float m23;
};
#endif// _CTRANSFORM4F
+4
View File
@@ -14,6 +14,7 @@
#include "MessageStudioBinaryText.bt"
#include "MaterialArchive.bt"
#include "CVectorField.bt"
#include "CAABoxCollisionTree.bt"
//#include "CRuleSet.bt"
#include "CScaleformFlashLibrary.bt"
@@ -35,6 +36,9 @@ typedef struct
Assert("Invalid version!");
}
break;
case "CLSN":
CAABoxCollisionTree aaboxCollisionTree(form.size);
break;
case "CHPR":
FCharInf charInfo;
break;