Changeset 5430 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Oct 24, 2005, 9:21:15 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/obb_tree_node.cc
r5429 r5430 37 37 OBBTree* OBBTreeNode::obbTree = NULL; 38 38 39 float** OBBTreeNode::coMat = NULL; 40 float** OBBTreeNode::eigvMat = NULL; 41 float* OBBTreeNode::eigvlMat = NULL; 42 int* OBBTreeNode::rotCount = NULL; 39 float** OBBTreeNode_coMat = NULL; 40 float** OBBTreeNode_eigvMat = NULL; 41 float* OBBTreeNode_eigvlMat = NULL; 42 int* OBBTreeNode_rotCount = NULL; 43 GLUquadricObj* OBBTreeNode_sphereObj = NULL; 43 44 44 45 /** … … 52 53 this->bvElement = NULL; 53 54 54 if( coMat == NULL)55 { 56 coMat = new float*[4];55 if(OBBTreeNode_coMat == NULL) 56 { 57 OBBTreeNode_coMat = new float*[4]; 57 58 for(int i = 0; i < 4; i++) 58 coMat[i] = new float[4];59 } 60 if( eigvMat == NULL)61 { 62 eigvMat = new float*[4];59 OBBTreeNode_coMat[i] = new float[4]; 60 } 61 if(OBBTreeNode_eigvMat == NULL) 62 { 63 OBBTreeNode_eigvMat = new float*[4]; 63 64 for(int i = 0; i < 4; i++) 64 eigvMat[i] = new float[4]; 65 } 66 if( eigvlMat == NULL) 67 { 68 eigvlMat = new float[4]; 69 } 70 if( rotCount == NULL) 71 rotCount = new int; 72 73 this->sphereObj = gluNewQuadric(); 65 OBBTreeNode_eigvMat[i] = new float[4]; 66 } 67 if( OBBTreeNode_eigvlMat == NULL) 68 { 69 OBBTreeNode_eigvlMat = new float[4]; 70 } 71 if( OBBTreeNode_rotCount == NULL) 72 OBBTreeNode_rotCount = new int; 73 74 if (OBBTreeNode_sphereObj == NULL) 75 OBBTreeNode_sphereObj = gluNewQuadric(); 74 76 } 75 77 … … 358 360 Vector* axis = new Vector[3]; //!< the references to the obb axis 359 361 360 coMat[1][1] = box->covarianceMatrix[0][0]; coMat[1][2] = box->covarianceMatrix[0][1];coMat[1][3] = box->covarianceMatrix[0][2];361 coMat[2][1] = box->covarianceMatrix[1][0]; coMat[2][2] = box->covarianceMatrix[1][1];coMat[2][3] = box->covarianceMatrix[1][2];362 coMat[3][1] = box->covarianceMatrix[2][0]; coMat[3][2] = box->covarianceMatrix[2][1];coMat[3][3] = box->covarianceMatrix[2][2];362 OBBTreeNode_coMat[1][1] = box->covarianceMatrix[0][0]; OBBTreeNode_coMat[1][2] = box->covarianceMatrix[0][1]; OBBTreeNode_coMat[1][3] = box->covarianceMatrix[0][2]; 363 OBBTreeNode_coMat[2][1] = box->covarianceMatrix[1][0]; OBBTreeNode_coMat[2][2] = box->covarianceMatrix[1][1]; OBBTreeNode_coMat[2][3] = box->covarianceMatrix[1][2]; 364 OBBTreeNode_coMat[3][1] = box->covarianceMatrix[2][0]; OBBTreeNode_coMat[3][2] = box->covarianceMatrix[2][1]; OBBTreeNode_coMat[3][3] = box->covarianceMatrix[2][2]; 363 365 364 366 // OBBTreeNode::coMat[0][0] = box->covarianceMatrix[0][0]; … … 376 378 377 379 /* new jacobi tests */ 378 JacobI(OBBTreeNode ::coMat, 3, eigvlMat, eigvMat,rotCount);380 JacobI(OBBTreeNode_coMat, 3, OBBTreeNode_eigvlMat, OBBTreeNode_eigvMat, OBBTreeNode_rotCount); 379 381 PRINTF(3)("-- Done Jacobi Decomposition\n"); 380 382 … … 386 388 // for(int k = 1; k < 4; ++k) 387 389 // { 388 // PRINTF(3)(" \b%f ", eigvMat[j][k]);390 // PRINTF(3)(" \b%f ", OBBTreeNode_OBBTreeNode_eigvMat[j][k]); 389 391 // } 390 392 // PRINTF(3)(" |\n"); 391 393 // } 392 394 393 axis[0].x = eigvMat[1][1]; axis[0].y = eigvMat[2][1]; axis[0].z =eigvMat[3][1];394 axis[1].x = eigvMat[1][2]; axis[1].y = eigvMat[2][2]; axis[1].z =eigvMat[3][2];395 axis[2].x = eigvMat[1][3]; axis[2].y = eigvMat[2][3]; axis[2].z =eigvMat[3][3];395 axis[0].x = OBBTreeNode_eigvMat[1][1]; axis[0].y = OBBTreeNode_eigvMat[2][1]; axis[0].z = OBBTreeNode_eigvMat[3][1]; 396 axis[1].x = OBBTreeNode_eigvMat[1][2]; axis[1].y = OBBTreeNode_eigvMat[2][2]; axis[1].z = OBBTreeNode_eigvMat[3][2]; 397 axis[2].x = OBBTreeNode_eigvMat[1][3]; axis[2].y = OBBTreeNode_eigvMat[2][3]; axis[2].z = OBBTreeNode_eigvMat[3][3]; 396 398 axis[0].normalize(); 397 399 axis[1].normalize(); … … 815 817 glPushMatrix(); 816 818 glTranslatef(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 817 gluSphere( this->sphereObj, 0.1, 10, 10);819 gluSphere(OBBTreeNode_sphereObj, 0.1, 10, 10); 818 820 glPopMatrix(); 819 821 } -
trunk/src/lib/collision_detection/obb_tree_node.h
r5427 r5430 69 69 int tmpLen1; //!< len vert data obbox1 70 70 int tmpLen2; //!< len vert data obbox2 71 72 static float** coMat; //!< temp covariance matrice save place - consumes less mem73 static float** eigvMat; //!< temp eigenvector matrice save place74 static float* eigvlMat; //!< temp eigenvalue vector save place75 static int* rotCount; //!< temp rotations count save place: how many givens-rotations where needed to transform the matrix :)76 77 GLUquadricObj* sphereObj;78 71 }; 79 72 -
trunk/src/lib/graphics/importer/abstract_model.h
r5427 r5430 116 116 } sAnimState; 117 117 118 118 //! Model Information definitions 119 119 typedef struct 120 120 { 121 unsigned int numVertices; 122 unsigned int numTriangles; 123 unsigned int numNormals; 121 unsigned int numVertices; //!< number of Vertices in the Model 122 unsigned int numTriangles; //!< number of triangles in the Model 123 unsigned int numNormals; //!< how many Normals in the Model 124 124 unsigned int numTexCoor; 125 125 126 const float* pVertices; 127 sTriangleExt* pTriangles; 128 const float* pNormals; 129 const float* pTexCoor; 126 const float* pVertices; //!< array of the Vertives 127 sTriangleExt* pTriangles; //!< array of all triangles 128 const float* pNormals; //!< array of the Normals 129 const float* pTexCoor; //!< array of the Texture Coordinates 130 130 131 131 } modelInfo; … … 140 140 virtual ~AbstractModel() {} 141 141 142 inline modelInfo* getModelInfo() const { return this->pModelInfo; }142 inline const modelInfo* getModelInfo() const { return this->pModelInfo; } 143 143 144 144 145 145 protected: 146 modelInfo* pModelInfo; //!< Reference to the modelInfo defined in abstract_model.h 147 Quadtree* quadtreel; //!< Reference to the quadtree of the object, NULL if not defined 146 modelInfo* pModelInfo; //!< Reference to the modelInfo 148 147 }; 149 148 150 151 152 153 154 149 #endif /* _ABSTRACT_MODEL_H */ -
trunk/src/lib/graphics/importer/model.cc
r5427 r5430 21 21 22 22 #include "stdlibincl.h" 23 #include <math.h>24 25 23 #include <stdarg.h> 26 24 -
trunk/src/lib/graphics/spatial_separation/quadtree.cc
r5234 r5430 31 31 * standard constructor 32 32 */ 33 Quadtree::Quadtree ( modelInfo* pModelInfo, const int treeDepth)33 Quadtree::Quadtree (const modelInfo* pModelInfo, const int treeDepth) 34 34 { 35 35 this->setClassID(CL_QUADTREE, "Quadtree"); -
trunk/src/lib/graphics/spatial_separation/quadtree.h
r5039 r5430 24 24 25 25 public: 26 Quadtree( modelInfo* pModelInfo, const int treeDepth);26 Quadtree(const modelInfo* pModelInfo, const int treeDepth); 27 27 virtual ~Quadtree(); 28 28 … … 42 42 QuadtreeNode* rootNode; //!< reference to the root node of the quadtree 43 43 QuadtreeNode** nodes; //!< reference to all quadtree nodes (only leafs of the quad tree) 44 modelInfo*pModelInfo; //!< reference to the modelInfo of the object44 const modelInfo* pModelInfo; //!< reference to the modelInfo of the object 45 45 int treeDepth; //!< depth of the tree 46 46 -
trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
r5427 r5430 68 68 * standard constructor 69 69 */ 70 QuadtreeNode::QuadtreeNode( modelInfo* pModelInfo, Quadtree* quadtree, const int maxDepth)70 QuadtreeNode::QuadtreeNode(const modelInfo* pModelInfo, Quadtree* quadtree, const int maxDepth) 71 71 { 72 72 /* save all important variables localy */ -
trunk/src/lib/graphics/spatial_separation/quadtree_node.h
r5405 r5430 32 32 Rectangle* rect, int treeDepth, const int maxDepth, int index 33 33 ); 34 QuadtreeNode( modelInfo* pModelInfo, Quadtree* quadtree, const int maxDepth);34 QuadtreeNode(const modelInfo* pModelInfo, Quadtree* quadtree, const int maxDepth); 35 35 virtual ~QuadtreeNode(); 36 36 … … 82 82 unsigned int numTriangles; //!< number of triangles of the Node 83 83 unsigned int numVertices; //!< number of vertices of the node 84 modelInfo*pModelInfo; //!< reference to the modelInfo of the object84 const modelInfo* pModelInfo; //!< reference to the modelInfo of the object 85 85 Rectangle* pDimension; //!< pointer to the local rectangle properties 86 86
Note: See TracChangeset
for help on using the changeset viewer.