-
Notifications
You must be signed in to change notification settings - Fork 0
Smf2
askalski edited this page Dec 14, 2012
·
1 revision
SMFFile
{
Header header;
SkinnedMesh mesh;
BoundingVolumeType type;
BoundingVolume bv; //of a type declared in a previous line
}
Header
{
uint Signature; // = '2FMS';
uint SkeletonId; // 0 here means lack of skeleton
}
SkinnedMesh
{
uint NumVertices;
uint NumSubMeshes;
SkinVertex4 Vertices[NumVertices];
SubMesh SubMeshes[NumSubMeshes];
}
SkinVertex4
{
vector3f Position;
vector3f Normal;
vector2f TexCoord;
uint JointIndices[4];
float JointWeights[4];
}
SubMesh
{
uint MaterialId; // 0 if there is no material.
uint NumIndices;
uint Indices[NumIndices];
}
enum BoundingVolumeType : unsigned char
{
AABB = 1;
OBB = 2;
Sphere = 3;
}
AABB : BoundingVolume
{
float xmin, ymin, zmin, xmax, ymax, zmax;
}
OBB : BoundingVolume
{
vector3f center;
vector3f ox, oy, oz; // half length in directions x, y, z
}
Sphere : BoundingVolume
{
vector3f center;
float radius;
}