Changeset 6448 in orxonox.OLD for branches/collision_detection
- Timestamp:
- Jan 9, 2006, 12:38:12 PM (19 years ago)
- Location:
- branches/collision_detection/src/lib/collision_detection
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/collision_detection/src/lib/collision_detection/obb_tree.cc
r6447 r6448 58 58 59 59 60 60 /** 61 * this function creates a bv tree out of a modelInf structure 62 * @param modelInf the model info of a model (modelInfo), containing vertices, triangle and normal infos 63 */ 61 64 void OBBTree::spawnBVTree(const modelInfo& modelInf) 62 65 { … … 70 73 /* triangles indexes created */ 71 74 int* triangleIndexes = new int[modelInf.numTriangles]; 72 for( int i = 0; i < modelInf.numTriangles; ++i)75 for( int i = 0; i < modelInf.numTriangles; ++i) 73 76 triangleIndexes[i] = i; 74 77 … … 77 80 78 81 79 80 82 /** 83 * release the current bv tree if any 84 */ 81 85 void OBBTree:: flushTree() 82 86 {} … … 95 99 96 100 97 101 /** 102 * draw bv tree 103 */ 98 104 void OBBTree::drawBV(int depth, int drawMode) const 99 105 { … … 105 111 106 112 107 113 /** 114 * some debug output and creation function 115 * 116 * doesn't work at the moment 117 */ 108 118 void OBBTree::debug() 109 119 { -
branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc
r6447 r6448 688 688 { 689 689 690 /* draw the model itself, there is some problem concerning this: the vertices are drawn multiple times */ 690 691 /* this function can be used to draw the triangles and/or the points only */ 691 692 if( drawMode & DRAW_MODEL || drawMode & DRAW_ALL) 692 693 { … … 694 695 { 695 696 if( drawMode & DRAW_POINTS) 697 { 696 698 glBegin(GL_POINTS); 697 for( int i = 0; i < this->bvElement->modelInf->numVertices; i+=3) 698 { 699 if( drawMode & DRAW_POINTS) 700 glVertex3f(this->bvElement->modelInf->pVertices[i], this->bvElement->modelInf->pVertices[i+1], this->bvElement->modelInf->pVertices[i+2]); 701 else 702 { 703 glPushMatrix(); 704 glVertex3f(this->bvElement->modelInf->pVertices[i], this->bvElement->modelInf->pVertices[i+1], this->bvElement->modelInf->pVertices[i+2]); 705 gluSphere(OBBTreeNode_sphereObj, 0.1, 10, 10); 706 glPopMatrix(); 707 } 699 for( int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3) 700 glVertex3f(this->bvElement->modelInf->pVertices[i], 701 this->bvElement->modelInf->pVertices[i+1], 702 this->bvElement->modelInf->pVertices[i+2]); 703 glEnd(); 708 704 } 709 if( drawMode & DRAW_POINTS) 710 glEnd(); 711 } 712 } 713 714 if (top) 705 } 706 } 707 /* if (top) 715 708 { 716 709 glPushAttrib(GL_ENABLE_BIT); 717 710 glDisable(GL_LIGHTING); 718 711 glDisable(GL_TEXTURE_2D); 719 } 712 }*/ 720 713 glColor3f(color.x, color.y, color.z); 721 714 … … 742 735 if( drawMode & DRAW_BV_AXIS || drawMode & DRAW_ALL) 743 736 { 744 if( !(drawMode & DRAW_SINGLE && depth != 0))737 if(1 /*!(drawMode & DRAW_SINGLE && depth != 0)*/) 745 738 { 746 739 /* draw the obb axes */ -
branches/collision_detection/src/lib/collision_detection/obb_tree_node.h
r6447 r6448 1 1 /*! 2 2 * @file bv_tree.h 3 * Definition of a bounding volume tree 4 3 * Definition of a bounding volume tree 5 4 */ 6 5 … … 8 7 #define _OBB_TREE_NODE_H 9 8 9 10 10 #include "bv_tree_node.h" 11 11 12 12 13 // forward declarations14 13 class BoundingVolume; 15 14 class OBB; … … 39 38 /** gets the id of the current child @return id of the child */ 40 39 inline const int getID() { return this->nextID++; } 40 41 41 42 42 private:
Note: See TracChangeset
for help on using the changeset viewer.