123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- #ifndef __MODEL_MA_H__
- #define __MODEL_MA_H__
- typedef struct {
- char name[128];
- char parent[128];
- } maNodeHeader_t;
- typedef struct {
- char name[128];
- int size;
- } maAttribHeader_t;
- typedef struct maTransform_s {
- idVec3 translate;
- idVec3 rotate;
- idVec3 scale;
- maTransform_s* parent;
- } maTransform_t;
- typedef struct {
- int edge[3];
- int vertexNum[3];
- int tVertexNum[3];
- int vertexColors[3];
- idVec3 vertexNormals[3];
- } maFace_t;
- typedef struct {
-
-
- maTransform_t* transform;
-
- int numVertexes;
- idVec3 * vertexes;
- int numVertTransforms;
- idVec4 * vertTransforms;
- int nextVertTransformIndex;
-
- int numTVertexes;
- idVec2 * tvertexes;
-
- int numEdges;
- idVec3 * edges;
-
- int numColors;
- byte* colors;
-
- int numFaces;
- maFace_t * faces;
-
- int numNormals;
- idVec3 * normals;
- bool normalsParsed;
- int nextNormal;
- } maMesh_t;
- typedef struct {
- char name[128];
- float uOffset, vOffset;
- float uTiling, vTiling;
- float angle;
- } maMaterial_t;
- typedef struct {
- char name[128];
- int materialRef;
- char materialName[128];
- maMesh_t mesh;
- } maObject_t;
- typedef struct {
- char name[128];
- char path[1024];
- } maFileNode_t;
- typedef struct maMaterialNode_s {
- char name[128];
- maMaterialNode_s* child;
- maFileNode_t* file;
- } maMaterialNode_t;
- typedef struct maModel_s {
- ID_TIME_T timeStamp;
- idList<maMaterial_t *, TAG_MODEL> materials;
- idList<maObject_t *, TAG_MODEL> objects;
- idHashTable<maTransform_t*> transforms;
-
-
- idHashTable<maFileNode_t*> fileNodes;
- idHashTable<maMaterialNode_t*> materialNodes;
- } maModel_t;
- maModel_t *MA_Load( const char *fileName );
- void MA_Free( maModel_t *ma );
- #endif
|