Changeset 4702 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jun 26, 2005, 1:37:14 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/bv_tree_node.h
r4700 r4702 31 31 virtual void collideWith(BVTreeNode* treeNode, PNode* nodeA, PNode* nodeB) = NULL; 32 32 33 virtual void drawBV(int depth, int drawMode) const= NULL;33 virtual void drawBV(int depth, int drawMode) = NULL; 34 34 35 35 -
orxonox/trunk/src/lib/collision_detection/obb.h
r4660 r4702 29 29 30 30 31 31 32 public: 32 33 Vector* axis; //!< Axes of oriented box [x,y,z] … … 34 35 float covarianceMatrix[3][3]; //!< the covariance matrix 35 36 37 bool bCollided; //!< is true if this obb has collided 38 36 39 }; 37 40 -
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4700 r4702 72 72 transparentMaterial[3]->setAmbient(5.0, 3.0, 1.0); 73 73 transparentMaterial[4]->setAmbient(1.0, 0.0, 7.0); 74 75 this->collisionMaterial = new Material(); 76 this->collisionMaterial->setIllum(5); 77 this->collisionMaterial->setTransparency(0.5); 78 this->collisionMaterial->setAmbient(1.0, 1.0, 1.0); 74 79 75 80 this->id = 0; -
orxonox/trunk/src/lib/collision_detection/obb_tree.h
r4700 r4702 32 32 virtual void drawBV(int depth, int drawMode) const; 33 33 34 Material* getMaterial(unsigned int depth) { return material[depth%5]; } 35 Material* getTransparentMaterial(unsigned int depth) { return transparentMaterial[depth%5]; } 34 Material* getMaterial(unsigned int depth) { return this->material[depth%5]; } 35 Material* getTransparentMaterial(unsigned int depth) { return this->transparentMaterial[depth%5]; } 36 Material* getCollisionMaterial() { return this->collisionMaterial; } 36 37 int getID() { return ++this->id;} 37 38 inline OBBTreeNode* getRootNode() { return this->rootNode; } … … 47 48 Material** material; 48 49 Material** transparentMaterial; 50 Material* collisionMaterial; 49 51 int id; 50 52 }; -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4701 r4702 694 694 } 695 695 696 return true; 697 } 698 699 700 701 void OBBTreeNode::drawBV(int depth, int drawMode) const 696 boxA->bCollided = true; /* use this ONLY!!!! for drawing operations */ 697 boxB->bCollided = true; 698 return true; 699 } 700 701 702 703 void OBBTreeNode::drawBV(int depth, int drawMode) 702 704 { 703 705 this->obbTree->getMaterial(treeIndex)->select(); … … 774 776 float* len = this->bvElement->halfLength; 775 777 776 if( drawMode & DRAW_BV_BLENDED) 778 if( this->bvElement->bCollided) 779 this->obbTree->getCollisionMaterial()->select(); 780 else if( drawMode & DRAW_BV_BLENDED) 777 781 this->obbTree->getTransparentMaterial(treeIndex)->select(); 782 783 778 784 779 785 /* draw bounding box */ … … 918 924 } 919 925 926 927 920 928 if( this->nodeLeft != NULL && depth != 0 ) 921 929 this->nodeLeft->drawBV(depth - 1, drawMode); … … 923 931 this->nodeRight->drawBV(depth - 1, drawMode); 924 932 933 this->bvElement->bCollided = false; 925 934 } 926 935 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
r4700 r4702 36 36 virtual void collideWith(BVTreeNode* treeNode, PNode* nodeA, PNode* nodeB); 37 37 38 virtual void drawBV(int depth, int drawMode) const;38 virtual void drawBV(int depth, int drawMode); 39 39 40 40 void debug(void) const; … … 52 52 OBBTreeNode* nodeLeft; //!< ref to the left tree node 53 53 OBBTreeNode* nodeRight; //!< ref to the right tree node 54 55 54 56 55 private:
Note: See TracChangeset
for help on using the changeset viewer.