Changeset 4618 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection
- Timestamp:
- Jun 13, 2005, 9:41:30 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/bv_tree_node.h
r4550 r4618 1 /*! 1 /*! 2 2 \file bv_tree.h 3 3 \brief Definition of a bounding volume tree … … 27 27 28 28 virtual BoundingVolume* getBV(int index) const = NULL; 29 inline const int getIndex() { return this->treeIndex; } 29 inline const int getIndex() { return this->treeIndex; } 30 30 31 31 virtual void collideWith(const BVTree &tree) = NULL; 32 32 33 virtual void drawBV(int currentDepth, const intdepth) const = NULL;34 virtual void drawBVPolygon(int currentDepth, const intdepth) const = NULL;35 virtual void drawBVBlended(int currentDepth, const intdepth) const = NULL;33 virtual void drawBV(int depth) const = NULL; 34 virtual void drawBVPolygon(int depth) const = NULL; 35 virtual void drawBVBlended(int depth) const = NULL; 36 36 37 37 -
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4616 r4618 75 75 if( likely(this->rootNode != NULL)) 76 76 { 77 this->rootNode->drawBV(currentDepth , depth);78 this->rootNode->drawBVPolygon(currentDepth , depth);77 this->rootNode->drawBV(currentDepth); 78 this->rootNode->drawBVPolygon(currentDepth); 79 79 } 80 80 } … … 84 84 { 85 85 if( likely(this->rootNode != NULL)) 86 this->rootNode->drawBVPolygon(currentDepth , depth);86 this->rootNode->drawBVPolygon(currentDepth); 87 87 } 88 88 … … 91 91 { 92 92 if( likely(this->rootNode != NULL)) 93 this->rootNode->drawBVBlended(currentDepth , depth);93 this->rootNode->drawBVBlended(currentDepth); 94 94 } 95 95 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4617 r4618 48 48 { 49 49 this->setClassID(CL_OBB_TREE_NODE, "OBBTreeNode"); 50 50 this->nodeLeft = NULL; 51 this->nodeRight = NULL; 51 52 } 52 53 … … 388 389 389 390 390 void OBBTreeNode::drawBV(int currentDepth, const intdepth) const391 void OBBTreeNode::drawBV(int depth) const 391 392 { 392 393 // glBegin(GL_LINE_LOOP); … … 402 403 403 404 404 void OBBTreeNode::drawBVPolygon(int currentDepth, const intdepth) const405 void OBBTreeNode::drawBVPolygon(int depth) const 405 406 { 406 407 … … 408 409 409 410 /* draw world axes */ 410 glBegin(GL_LINES);411 glColor3f(0.0, 0.4, 0.3);412 glVertex3f(0.0, 0.0, 0.0);413 glVertex3f(3.0, 0.0, 0.0);414 415 glVertex3f(0.0, 0.0, 0.0);416 glVertex3f(0.0, 3.0, 0.0);417 418 glVertex3f(0.0, 0.0, 0.0);419 glVertex3f(0.0, 0.0, 3.0);420 glEnd();411 // glBegin(GL_LINES); 412 // glColor3f(0.0, 0.4, 0.3); 413 // glVertex3f(0.0, 0.0, 0.0); 414 // glVertex3f(3.0, 0.0, 0.0); 415 // 416 // glVertex3f(0.0, 0.0, 0.0); 417 // glVertex3f(0.0, 3.0, 0.0); 418 // 419 // glVertex3f(0.0, 0.0, 0.0); 420 // glVertex3f(0.0, 0.0, 3.0); 421 // glEnd(); 421 422 422 423 423 424 424 425 /* draw the obb axes */ 425 glBegin(GL_LINES);426 glColor3f(0.0, 0.4, 0.3);427 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);428 glVertex3f(this->bvElement->center->x + this->bvElement->axis[0]->x * this->bvElement->halfLength[0],429 this->bvElement->center->y + this->bvElement->axis[0]->y * this->bvElement->halfLength[0],430 this->bvElement->center->z + this->bvElement->axis[0]->z * this->bvElement->halfLength[0]);431 432 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);433 glVertex3f(this->bvElement->center->x + this->bvElement->axis[1]->x * this->bvElement->halfLength[1],434 this->bvElement->center->y + this->bvElement->axis[1]->y * this->bvElement->halfLength[1],435 this->bvElement->center->z + this->bvElement->axis[1]->z * this->bvElement->halfLength[1]);436 437 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);438 glVertex3f(this->bvElement->center->x + this->bvElement->axis[2]->x * this->bvElement->halfLength[2],439 this->bvElement->center->y + this->bvElement->axis[2]->y * this->bvElement->halfLength[2],440 this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]);441 glEnd();426 // glBegin(GL_LINES); 427 // glColor3f(0.0, 0.4, 0.3); 428 // glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 429 // glVertex3f(this->bvElement->center->x + this->bvElement->axis[0]->x * this->bvElement->halfLength[0], 430 // this->bvElement->center->y + this->bvElement->axis[0]->y * this->bvElement->halfLength[0], 431 // this->bvElement->center->z + this->bvElement->axis[0]->z * this->bvElement->halfLength[0]); 432 // 433 // glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 434 // glVertex3f(this->bvElement->center->x + this->bvElement->axis[1]->x * this->bvElement->halfLength[1], 435 // this->bvElement->center->y + this->bvElement->axis[1]->y * this->bvElement->halfLength[1], 436 // this->bvElement->center->z + this->bvElement->axis[1]->z * this->bvElement->halfLength[1]); 437 // 438 // glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 439 // glVertex3f(this->bvElement->center->x + this->bvElement->axis[2]->x * this->bvElement->halfLength[2], 440 // this->bvElement->center->y + this->bvElement->axis[2]->y * this->bvElement->halfLength[2], 441 // this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]); 442 // glEnd(); 442 443 443 444 … … 519 520 glEnd(); 520 521 521 522 } 523 524 525 void OBBTreeNode::drawBVBlended(int currentDepth, const int depth) const 522 if( this->nodeLeft != NULL && depth != 0) 523 this->nodeLeft->drawBVPolygon(depth -1); 524 if( this->nodeRight != NULL && depth != 0) 525 this->nodeRight->drawBVPolygon(depth -1); 526 527 } 528 529 530 void OBBTreeNode::drawBVBlended(int depth) const 526 531 {} 527 532 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
r4614 r4618 32 32 virtual void collideWith(const BVTree &tree); 33 33 34 virtual void drawBV(int currentDepth, const intdepth) const;35 virtual void drawBVPolygon(int currentDepth, const intdepth) const;36 virtual void drawBVBlended(int currentDepth, const intdepth) const;34 virtual void drawBV(int depth) const; 35 virtual void drawBVPolygon(int depth) const; 36 virtual void drawBVBlended(int depth) const; 37 37 38 38 void debug();
Note: See TracChangeset
for help on using the changeset viewer.