================================= Description =================================

DMD 3.1 [D]gle [M]esh [D]ata binary format specification.

================================ Specification ================================

[BYTE * 11 | FormatDMD][BYTE * 13 | Header][ _ | MeshesData]

================================= Data Blocks =================================

#FormatDMD#
[CHAR * 11] String must be "DMD 3.1 BIN", without terminating null symbol.

#Header#
= Masks for ExtFlags =
[0x00000000 | NOTHING] Means that there is no additional data.
[0x00000001 | MODEL_AABB] Means that model has precalculated center and bounding box.
======================
[UINT32 | ExtFlags] Additional flags combined to integer as binary masks.
[UINT32 | MeshsCount] Number of meshes in file.

* If ExtFlags has MODEL_AABB *
	[FLOAT FLOAT FLOAT] Coordinates of the model geometric center.
	[FLOAT FLOAT FLOAT] Model extents (half of AABB size) per axis.
* End If *

#MeshesData#
[[

[BOOL | IsTextured] Does mesh contains texture coords.
[BOOL | IsTangentSpace] Does mesh contains tangent space. For future usage always "False", for now.
[UINT32 | NumVertices] Number of vertices in mesh.
[UINT32 | NumIndices] Number of indices in the mesh index buffer.

[FLOAT FLOAT FLOAT] Coordinates of the mesh geometric center.
[FLOAT FLOAT FLOAT] Mesh extents (half of AABB size) per axis.

[[FLOAT FLOAT FLOAT] * NumVertices] Mesh vertices data.
[[FLOAT FLOAT FLOAT] * NumVertices] Mesh normals data.

* If IsTextured is True *
	[[FLOAT FLOAT] * NumVertices] Mesh texture data.
* End If *

* If NumVertices <= 65535 *
	[(USHORT USHORT USHORT) * NumIndices] Mesh index buffer.
* Else *
	[(UINT32 UINT32 UINT32) * NumIndices] Mesh index buffer.
* End If *

] * MeshsCount] 

===============================================================================