- Timestamp:
- Jan 31, 2006, 11:09:15 PM (19 years ago)
- Location:
- branches/current_cd/src/lib/collision_detection
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/current_cd/src/lib/collision_detection/bv_tree_node.h
r6911 r6922 35 35 36 36 virtual void spawnBVTree(const modelInfo& modInfo, const int* triangleIndexes, int length) = 0; 37 virtual void collideWith( const BVTreeNode&treeNode, WorldEntity* nodeA, WorldEntity* nodeB) = 0;37 virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) = 0; 38 38 virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const = 0; 39 39 -
branches/current_cd/src/lib/collision_detection/obb_tree.cc
r6911 r6922 95 95 { 96 96 if( likely(entity2->getOBBTree() != NULL) ) 97 this->rootNode->collideWith( *(((OBBTree*)entity2->getOBBTree())->getRootNode()), entity1, entity2);97 this->rootNode->collideWith(((OBBTree*)entity2->getOBBTree())->getRootNode(), entity1, entity2); 98 98 } 99 99 -
branches/current_cd/src/lib/collision_detection/obb_tree.h
r6911 r6922 34 34 inline const int getID() { return ++this->id;} 35 35 /** returns the root node of the bounding volume tree @return reference to the root node */ 36 inline constOBBTreeNode* getRootNode() const { return this->rootNode; }36 inline OBBTreeNode* getRootNode() const { return this->rootNode; } 37 37 38 38 void debug(); -
branches/current_cd/src/lib/collision_detection/obb_tree_node.cc
r6921 r6922 517 517 void OBBTreeNode::collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) 518 518 { 519 if( unlikely(treeNode == 1))519 if( unlikely(treeNode == NULL)) 520 520 return; 521 521 522 522 PRINTF(3)("collideWith\n"); 523 523 /* if the obb overlap, make subtests: check which node is realy overlaping */ 524 PRINTF(3)("Checking OBB %i vs %i: ", this->getIndex(), treeNode .getIndex());524 PRINTF(3)("Checking OBB %i vs %i: ", this->getIndex(), treeNode->getIndex()); 525 525 // if( unlikely(treeNode == NULL)) return; 526 526 … … 533 533 if( likely( this->nodeLeft != NULL)) 534 534 { 535 PRINTF(3)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode .getIndex());535 PRINTF(3)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode->getIndex()); 536 536 if( this->overlapTest(*this->nodeLeft->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB)) 537 537 { 538 this->nodeLeft->collideWith( *(((const OBBTreeNode*)&treeNode)->nodeLeft), nodeA, nodeB);539 this->nodeLeft->collideWith( *(((const OBBTreeNode*)&treeNode)->nodeRight), nodeA, nodeB);538 this->nodeLeft->collideWith((((const OBBTreeNode*)treeNode)->nodeLeft), nodeA, nodeB); 539 this->nodeLeft->collideWith((((const OBBTreeNode*)treeNode)->nodeRight), nodeA, nodeB); 540 540 } 541 541 } … … 543 543 if( likely( this->nodeRight != NULL)) 544 544 { 545 PRINTF(3)("Checking OBB %i vs %i: ", this->nodeRight->getIndex(), treeNode .getIndex());545 PRINTF(3)("Checking OBB %i vs %i: ", this->nodeRight->getIndex(), treeNode->getIndex()); 546 546 if(this->overlapTest(*this->nodeRight->bvElement, *(((const OBBTreeNode*)&treeNode)->bvElement), nodeA, nodeB)) 547 547 { 548 this->nodeRight->collideWith( *(((const OBBTreeNode*)&treeNode)->nodeLeft), nodeA, nodeB);549 this->nodeRight->collideWith( *(((const OBBTreeNode*)&treeNode)->nodeRight), nodeA, nodeB);548 this->nodeRight->collideWith((((const OBBTreeNode*)treeNode)->nodeLeft), nodeA, nodeB); 549 this->nodeRight->collideWith((((const OBBTreeNode*)treeNode)->nodeRight), nodeA, nodeB); 550 550 } 551 551 } -
branches/current_cd/src/lib/collision_detection/obb_tree_node.h
r6911 r6922 32 32 virtual void spawnBVTree(const modelInfo& modelInf, const int* triangleIndexes, int length); 33 33 34 virtual void collideWith( const BVTreeNode&treeNode, WorldEntity* nodeA, WorldEntity* nodeB);34 virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB); 35 35 virtual void drawBV(int depth, int drawMode, const Vector& color = Vector(1,0,0), bool top = true) const; 36 36 void debug() const;
Note: See TracChangeset
for help on using the changeset viewer.