Changeset 9235 in orxonox.OLD for trunk/src/lib/collision_detection
- Timestamp:
- Jul 5, 2006, 4:39:02 PM (18 years ago)
- Location:
- trunk/src/lib/collision_detection
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/obb_tree.cc
r8316 r9235 41 41 42 42 43 /** 44 * standard constructor 45 */ 46 OBBTree::OBBTree() 47 : BVTree() 48 {} 49 43 50 44 51 void OBBTree::init() … … 78 85 79 86 this->rootNode->spawnBVTree(modelInf, triangleIndexes, modelInf.numTriangles); 87 } 88 89 90 void OBBTree::createBox(Vector start, Vector end) 91 { 92 this->rootNode = new OBBTreeNode(*this, NULL, 1); 93 94 this->rootNode->createBox(start, end); 80 95 } 81 96 -
trunk/src/lib/collision_detection/obb_tree.h
r7711 r9235 23 23 public: 24 24 OBBTree(int depth, const modelInfo* modInfo, WorldEntity* entity); 25 OBBTree(); 25 26 virtual ~OBBTree(); 26 27 void init(); … … 28 29 virtual void spawnBVTree(const modelInfo& modelInf); 29 30 virtual void flushTree(); 31 32 void createBox(Vector start, Vector end); 30 33 31 34 virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2); -
trunk/src/lib/collision_detection/obb_tree_node.cc
r9008 r9235 90 90 delete this->bvElement; 91 91 } 92 93 94 95 void OBBTreeNode::createBox(Vector start, Vector end) 96 { 97 98 this->bvElement = new OBB(); 99 this->nodeLeft = NULL; 100 this->nodeRight = NULL; 101 // this->depth = 0; 102 103 this->bvElement->center = (end - start) * 0.5f; 104 this->bvElement->halfLength[0] = (end.x - start.x) * 0.5f; 105 this->bvElement->halfLength[1] = (end.y - start.y) * 0.5f; 106 this->bvElement->halfLength[2] = (end.z - start.z) * 0.5f; 107 108 this->bvElement->axis[0] = Vector(1,0,0); 109 this->bvElement->axis[1] = Vector(0,1,0); 110 this->bvElement->axis[2] = Vector(0,0,1); 111 } 112 92 113 93 114 … … 561 582 bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB) 562 583 { 584 563 585 //HACK remove this again 564 586 this->owner = nodeA; … … 677 699 void OBBTreeNode::drawBV(int depth, int drawMode, const Vector& color, bool top) const 678 700 { 701 679 702 /* this function can be used to draw the triangles and/or the points only */ 680 703 if( 1 /*drawMode & DRAW_MODEL || drawMode & DRAW_ALL*/) … … 682 705 if( depth == 0/*!(drawMode & DRAW_SINGLE && depth != 0)*/) 683 706 { 684 if( 1/*drawMode & DRAW_POINTS*/)707 if( 0 /*drawMode & DRAW_POINTS*/) 685 708 { 686 709 glBegin(GL_POINTS); -
trunk/src/lib/collision_detection/obb_tree_node.h
r7732 r9235 31 31 32 32 virtual void spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, int length); 33 void createBox(Vector start, Vector end); 33 34 34 35 virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB); … … 79 80 80 81 WorldEntity* owner; 82 81 83 }; 82 84
Note: See TracChangeset
for help on using the changeset viewer.