为Material结构与Mesh头建立独立的.h文件,以使转换器和LOADER共用
This commit is contained in:
45
inc/hgl/graph/Mesh.h
Normal file
45
inc/hgl/graph/Mesh.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef HGL_GRAPH_MESH_INCLUDE
|
||||
#define HGL_GRAPH_MESH_INCLUDE
|
||||
|
||||
namespace hgl
|
||||
{
|
||||
namespace graph
|
||||
{
|
||||
#pragma pack(push,1)
|
||||
struct MeshFileHeader
|
||||
{
|
||||
uint8 flag[4]; ///<'MESH'
|
||||
uint8 sperator; ///<0x1a
|
||||
uint8 version; ///<1
|
||||
|
||||
uint8 primitive_type; ///<图元类型
|
||||
|
||||
uint32 vertices_number; ///<顶点数量
|
||||
uint32 faces_number; ///<面数量
|
||||
|
||||
uint8 color_channels; ///<顶点色数量
|
||||
uint8 texcoord_channels; ///<纹理坐标数量
|
||||
|
||||
uint32 material_index; ///<材质索引
|
||||
|
||||
uint8 ntb; ///<ntb信息位合集
|
||||
|
||||
uint32 bones_number; ///<骨骼数量
|
||||
|
||||
public:
|
||||
|
||||
MeshFileHeader()
|
||||
{
|
||||
memset(this,0,sizeof(MeshFileHeader));
|
||||
flag[0]='M';
|
||||
flag[1]='E';
|
||||
flag[2]='S';
|
||||
flag[3]='H';
|
||||
sperator=0x1A;
|
||||
version=1;
|
||||
}
|
||||
};//struct MeshFileHeader
|
||||
#pragma pack(pop)
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
#endif//HGL_GRAPH_MESH_INCLUDE
|
Reference in New Issue
Block a user