Changeset 4172 in orxonox.OLD for orxonox/branches/md2_loader/src/lib/graphics/importer/abstract_model.h
- Timestamp:
- May 13, 2005, 3:40:23 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/importer/abstract_model.h
r4159 r4172 30 30 using namespace std; 31 31 32 //template<class T> class tList; 33 ; 32 33 34 //! this is a small and performant 3D vector 35 typedef float sVec3D[3]; 36 37 //! small and performant 2D vector 38 typedef float sVec2D[2]; 39 40 //! compressed vertex data: char insetead of float, the value will be expanded by the scale value. only for loading 41 typedef struct 42 { 43 byte v[3]; 44 unsigned char lightNormalIndex; 45 } sVertex; 46 47 //! compressed texture offset data: coords scaled by the texture size. Only for loading 48 typedef struct 49 { 50 short s,t; 51 } sTexCoor; 52 53 54 //! holds tha informations about a md2 frame 55 typedef struct 56 { 57 sVec3D scale; //!< scales values of the model 58 sVec3D translate; //!< translates the model 59 char name[16]; //!< frame name: something like "run32" 60 sVertex pVertices[1]; //!< first vertex of thes frame 61 } sFrame; 62 63 64 //! holds the information about a triangle 65 typedef struct 66 { 67 short indexToVertices[3]; //!< index to the verteces of the triangle 68 short indexToTexCoor[3]; //!< index to the texture coordinates 69 } sTriangle; 70 71 72 //! a md2 animation definition 73 typedef struct 74 { 75 int firstFrame; //!< first frame of the animation 76 int lastFrame; //!< last frame of the animation 77 int fps; //!< speed: number of frames per second 78 } sAnim; 79 80 //! animation state definition 81 typedef struct 82 { 83 int startFrame; 84 int endFrame; 85 int fps; 86 87 float localTime; 88 float lastTime; 89 float interpolationState; //!< the state of the animation [0..1] 90 91 int type; //!< animation type 92 93 int currentFrame; 94 int nextFrame; 95 } sAnimState; 96 34 97 35 98 //! This is our 3D point class. CONFLICTING with Vector.cc 36 99 class CVector3 37 100 { 38 public:39 101 public: 102 float x, y, z; 40 103 }; 41 104 … … 43 106 class CVector2 44 107 { 45 public:46 108 public: 109 float x, y; 47 110 }; 48 111 … … 50 113 struct tFace 51 114 { 52 53 115 int vertIndex[3]; // indicies for the verts that make up this triangle 116 int coordIndex[3]; // indicies for the tex coords to texture this face 54 117 }; 55 118 … … 57 120 struct tMaterialInfo 58 121 { 59 60 61 62 63 64 65 float uOffset;// u offset of texture66 122 char strName[255]; // The texture name 123 char strFile[255]; // The texture file name (If this is set it's a texture map) 124 byte color[3]; // The color of the object (R, G, B) 125 int texureId; // the texture ID 126 float uTile; // u tiling of texture 127 float vTile; // v tiling of texture 128 float uOffset; // u offset of texture 129 float vOffset; // v offset of texture 67 130 } ; 68 131 … … 70 133 struct t3DObject 71 134 { 72 73 74 75 76 77 78 79 80 81 135 int numOfVerts; // The number of verts in the model 136 int numOfFaces; // The number of faces in the model 137 int numTexVertex; // The number of texture coordinates 138 int materialID; // The texture ID to use, which is the index into our texture array 139 bool bHasTexture; // This is TRUE if there is a texture map for this object 140 char strName[255]; // The name of the object 141 CVector3 *pVerts; // The object's vertices 142 CVector3 *pNormals; // The object's normals 143 CVector2 *pTexVerts; // The texture's UV coordinates 144 tFace *pFaces; // The faces information of the object 82 145 }; 83 146 … … 85 148 struct tAnimationInfo 86 149 { 87 88 89 150 char strName[255]; // This stores the name of the animation (Jump, Pain, etc..) 151 int startFrame; // This stores the first frame number for this animation 152 int endFrame; // This stores the last frame number for this animation 90 153 }; 91 154 … … 93 156 struct t3DModel 94 157 { 95 96 97 98 99 100 101 102 158 int numOfObjects; // The number of objects in the model 159 int numOfMaterials; // The number of materials for the model 160 int numOfAnimations; // The number of animations in this model (NEW) 161 int currentAnim; // The current index into pAnimations list (NEW) 162 int currentFrame; // The current frame of the current animation (NEW) 163 vector<tAnimationInfo> animationList; // The list of animations (NEW) 164 vector<tMaterialInfo> materialList; // The list of material information (Textures and colors) 165 vector<t3DObject> objectList; // The object list for our model 103 166 }; 104 167
Note: See TracChangeset
for help on using the changeset viewer.