Changeset 4615 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jun 13, 2005, 1:26:25 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/cd_engine.cc
r4551 r4615 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 19 19 #include "obb_tree.h" 20 20 #include "debug.h" 21 #include "abstract_model.h" 21 22 22 23 using namespace std; … … 26 27 \brief standard constructor 27 28 */ 28 CDEngine::CDEngine () 29 CDEngine::CDEngine () 29 30 { 30 31 this->setClassName("CDEngine"); 31 this->setClassID(CL_CD_ENGINE, "CDEngine"); 32 this->setClassID(CL_CD_ENGINE, "CDEngine"); 32 33 33 34 /* testing purposes only: */ … … 44 45 45 46 */ 46 CDEngine::~CDEngine () 47 CDEngine::~CDEngine () 47 48 { 48 49 CDEngine::singletonRef = NULL; … … 74 75 this->rootTree->debug(); 75 76 PRINT(0)("= CDEngine: Spawning Tree: Finished\n"); 76 PRINT(0)("=======================================================\n"); 77 PRINT(0)("=======================================================\n"); 77 78 78 79 } 80 81 void CDEngine::debugSpawnTree(int depth, sVec3D* vertices, int numVertices) 82 { 83 this->rootTree->spawnBVTree(depth, vertices, numVertices); 84 } -
orxonox/trunk/src/lib/collision_detection/cd_engine.h
r4551 r4615 1 /*! 1 /*! 2 2 \file cd_engine.h 3 3 \brief Definition of the collision detection engine 4 4 5 5 */ 6 6 … … 10 10 #include "base_object.h" 11 11 #include "collision_defs.h" 12 #include "abstract_model.h" 12 13 13 14 template<class T> class tList; … … 50 51 51 52 void debug(); 53 void debugSpawnTree(int depth, sVec3D* vertices, int numVertices); 52 54 53 55 private: -
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4612 r4615 107 107 } 108 108 109 this->spawnBVTree( 1, vertList, length);109 this->spawnBVTree(2, vertList, length); 110 110 111 111 PRINT(0)("= Spawning Tree: Finished\n"); -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4614 r4615 389 389 void OBBTreeNode::drawBV(int currentDepth, const int depth) const 390 390 { 391 glBegin(GL_LINE_LOOP);392 glColor3f(1.0, 1.0, 1.0);393 for(int i = 0; i < this->bvElement->numOfVertices; ++i)394 {395 glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);396 //printf("v(%f, %f, %f)\n", this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]);397 }398 glEnd();391 // glBegin(GL_LINE_LOOP); 392 // glColor3f(1.0, 1.0, 1.0); 393 // for(int i = 0; i < this->bvElement->numOfVertices; ++i) 394 // { 395 // glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 396 // //printf("v(%f, %f, %f)\n", this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]); 397 // } 398 // glEnd(); 399 399 } 400 400 -
orxonox/trunk/src/lib/graphics/importer/md2Model.h
r4488 r4615 1 /*! 1 /*! 2 2 \file md2Model.h 3 3 \brief Definition of an MD2 Model, a model format invented by ID Software. 4 4 5 5 We are deeply thankfull for all the wunderfull things id software made for us gamers! 6 6 7 7 The md2 file format is structured in a very simple way: it contains animations which are made out of 8 8 frames (so called keyframes). Each frame is a complete draweable model in a specific position. 9 9 A frame is a collection of vertex and its compagnions (normals, texture coordinates). 10 11 A typical model has about 200 frames, the maximum frame count is fixed by MD2_MAX_FRAMES to currently 10 11 A typical model has about 200 frames, the maximum frame count is fixed by MD2_MAX_FRAMES to currently 12 12 512 frames. The maximal vetices count is set to 2048 verteces, not enough? 13 13 You just have to change the MD2_MAX_* values if it doesn't fit your purposes... 14 14 15 15 Surface Culling is fully implemented in md2 models: quake2 uses front face culling. 16 16 */ … … 27 27 #define MD2_IDENT (('2'<<24) + ('P'<<16) + ('D'<<8) + 'I') //!< the md2 identifier tag in the bin file 28 28 #define MD2_VERSION 8 //!< the md2 version in the header 29 #define MD2_MAX_TRIANGLES 30 #define MD2_MAX_VERTICES 31 #define MD2_MAX_TEXCOORDS 32 #define MD2_MAX_FRAMES 33 #define MD2_MAX_SKINS 34 #define MD2_MAX_FRAMESIZE 29 #define MD2_MAX_TRIANGLES 4096 //!< maximal triangles count 30 #define MD2_MAX_VERTICES 2048 //!< maximal vertices count 31 #define MD2_MAX_TEXCOORDS 2048 //!< maximal tex coordinates 32 #define MD2_MAX_FRAMES 512 //!< maximal frames 33 #define MD2_MAX_SKINS 32 //!< maximal skins 34 #define MD2_MAX_FRAMESIZE (MD2_MAX_VERTICES * 4 + 128) //!< maximal framesize 35 35 36 36 #define NUM_VERTEX_NORMALS 162 //!< number of vertex normals … … 38 38 39 39 //! This stores the speed of the animation between each key frame - currently conflicting with the animation framework 40 #define kAnimationSpeed 40 #define kAnimationSpeed 12.0f //!< animation speed 41 41 42 42 //! This holds the header information that is read in at the beginning of the file: id software definition 43 43 struct MD2Header 44 { 45 int ident; 46 int version; 47 48 int skinWidth; 49 int skinHeight; 50 int frameSize; 51 52 int numSkins; 53 int numVertices; 54 int numTexCoords; 55 int numTriangles; 56 int numGlCommands; 57 int numFrames; 58 59 int offsetSkins; 60 int offsetTexCoords; 61 int offsetTriangles; 62 int offsetFrames; 63 int offsetGlCommands; 64 int offsetEnd; 44 { 45 int ident; //!< This is used to identify the file 46 int version; //!< The version number of the file (Must be 8) 47 48 int skinWidth; //!< The skin width in pixels 49 int skinHeight; //!< The skin height in pixels 50 int frameSize; //!< The size in bytes the frames are 51 52 int numSkins; //!< The number of skins associated with the model 53 int numVertices; //!< The number of vertices (constant for each frame) 54 int numTexCoords; //!< The number of texture coordinates 55 int numTriangles; //!< The number of faces (polygons) 56 int numGlCommands; //!< The number of gl commands 57 int numFrames; //!< The number of animation frames 58 59 int offsetSkins; //!< The offset in the file for the skin data 60 int offsetTexCoords; //!< The offset in the file for the texture data 61 int offsetTriangles; //!< The offset in the file for the face data 62 int offsetFrames; //!< The offset in the file for the frames data 63 int offsetGlCommands; //!< The offset in the file for the gl commands data 64 int offsetEnd; //!< The end of the file offset 65 65 }; 66 66 … … 85 85 CROUCH_ATTACK, 86 86 CROUCH_PAIN, 87 CROUCH_DEATH, 87 CROUCH_DEATH, 88 88 DEATH_FALLBACK, 89 89 DEATH_FALLFORWARD, 90 90 DEATH_FALLBACKSLOW, 91 91 BOOM, 92 92 93 93 MAX_ANIMATIONS 94 94 }; … … 113 113 114 114 public: 115 int numFrames; //!< number of frames 115 int numFrames; //!< number of frames 116 116 int numVertices; //!< number of vertices 117 117 int numTriangles; //!< number of triangles … … 125 125 int* pLightNormals; //!< pointer to the light normals 126 126 127 Material* material; //!< pointer to the material 127 Material* material; //!< pointer to the material 128 128 float scaleFactor; //!< the scale factor of the model, (global) 129 129 }; … … 136 136 MD2Model(const char* modelFileName, const char* skinFileName = NULL); 137 137 virtual ~MD2Model(); 138 138 139 139 void draw(); 140 140 141 141 void setAnim(int type); 142 142 /** 143 \brief scales the current model 143 \brief scales the current model 144 144 \param scaleFactor: the factor [0..1] to use for scaling 145 145 */ … … 151 151 152 152 private: 153 void animate(); 153 void animate(); 154 154 void processLighting(); 155 155 void interpolate(sVec3D* verticesList); … … 162 162 static sAnim animationList[21]; //!< the anomation list 163 163 164 private:165 164 MD2Data* data; //!< the md2 data pointer 166 165 166 private: 167 167 float scaleFactor; //!< the scale factor (individual) 168 168 sAnimState animationState; //!< animation state of the model
Note: See TracChangeset
for help on using the changeset viewer.