Tmf2 - habanero3d/habanero3d-current GitHub Wiki
TMFFile
{
Header header;
StaticMesh mesh;
BoundingVolumeType type;
BoundingVolume bv; //of a type that is declared in a previous line
}
Header
{
uint Signature; // = '2FMT';
}
StaticMesh
{
uint NumVertices;
uint NumSubMeshes;
StaticVertex Vertices[NumVertices];
StaticSubMesh SubMeshes[NumSubMeshes];
}
StaticVertex
{
vector3f Position;
vector3f Normal;
vector2f TexCoord;
}
StaticSubMesh
{
uint MaterialId; // maps to material via 'i2n'
uint NumIndices;
uint Indices[NumIndices];
}
enum BoundingVolumeType : unsigned char
{
AABB = 1;
OBB = 2; // OBB is absent in "current" version, since it was never used
Sphere = 3;
}
AABB : BoundingVolume
{
float xmin, ymin, zmin, xmax, ymax, zmax;
};
OBB : BoundingVolume
{
vector3f center;
vector3f ox, oy, oz; // half distance in x, y, z directions
};
Sphere : BoundingVolume
{
vector3f center;
float radius;
};