Changeset 4635 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection
- Timestamp:
- Jun 15, 2005, 7:05:39 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/bounding_volume.h
r4616 r4635 27 27 virtual void mergeWith(const BoundingVolume &bv) = NULL; 28 28 29 virtual void drawBV(int currentDepth, const int depth) const = NULL; 30 virtual void drawBVPolygon(int currentDepth, const int depth) const = NULL; 31 virtual void drawBVBlended(int currentDepth, const int depth) const = NULL; 29 virtual void drawBV(int currentDepth, int drawMode) const = NULL; 30 32 31 33 32 -
orxonox/trunk/src/lib/collision_detection/bv_tree.h
r4622 r4635 15 15 class BoundingVolume; 16 16 17 typedef enum DrawMode 18 { 19 DRAW_ALL = 1<<0, 20 DRAW_SINGLE = 1<<1, 21 22 DRAW_SEPARATING_PLANE = 1<<2, 23 DRAW_BV_AXIS = 1<<3, 24 DRAW_BV_BLENDED = 1<<4, 25 DRAW_BV_POLYGON = 1<<5, 26 DRAW_MODEL = 1<<6 27 }; 28 17 29 18 30 //! A class that represents a bounding volume tree … … 26 38 virtual void flushTree() = NULL; 27 39 28 29 virtual void drawBV(int depth) const = NULL; 30 virtual void drawBVPolygon(int depth) const = NULL; 31 virtual void drawBVBlended(int depth) const = NULL; 40 virtual void drawBV(int depth, int drawMode) const = NULL; 32 41 33 42 protected: -
orxonox/trunk/src/lib/collision_detection/bv_tree_node.h
r4618 r4635 31 31 virtual void collideWith(const BVTree &tree) = NULL; 32 32 33 virtual void drawBV(int depth) const = NULL; 34 virtual void drawBVPolygon(int depth) const = NULL; 35 virtual void drawBVBlended(int depth) const = NULL; 33 virtual void drawBV(int depth, int drawMode) const = NULL; 36 34 37 35 -
orxonox/trunk/src/lib/collision_detection/cd_engine.cc
r4622 r4635 53 53 54 54 55 void CDEngine::drawBV(int depth ) const55 void CDEngine::drawBV(int depth, int drawMode) const 56 56 { 57 57 /* this would operate on worldList bases, for testing purposes, we only use one OBBTree */ 58 this->rootTree->drawBV(depth );58 this->rootTree->drawBV(depth, drawMode); 59 59 } 60 60 61 61 62 void CDEngine::drawBVPolygon(int depth) const63 {}64 65 66 void CDEngine::drawBVBlended(int depth) const67 {}68 62 69 63 -
orxonox/trunk/src/lib/collision_detection/cd_engine.h
r4622 r4635 44 44 void disable(const int options) { int temp = this->state & options; this->state ^= temp; } 45 45 46 void drawBV(int depth) const; 47 void drawBVPolygon(int depth) const; 48 void drawBVBlended(int depth) const; 46 void drawBV(int depth, int drawMode) const; 49 47 50 48 void checkCollisions(); -
orxonox/trunk/src/lib/collision_detection/obb.cc
r4576 r4635 51 51 52 52 53 void OBB::drawBV(int currentDepth, const int depth) const53 void OBB::drawBV(int currentDepth, int drawMode) const 54 54 {} 55 55 56 56 57 void OBB::drawBVPolygon(int currentDepth, const int depth) const58 {}59 60 61 void OBB::drawBVBlended(int currentDepth, const int depth) const62 {} -
orxonox/trunk/src/lib/collision_detection/obb.h
r4588 r4635 26 26 virtual void mergeWith(const BoundingVolume &bv); 27 27 28 virtual void drawBV(int currentDepth, const int depth) const; 29 virtual void drawBVPolygon(int currentDepth, const int depth) const; 30 virtual void drawBVBlended(int currentDepth, const int depth) const; 28 virtual void drawBV(int currentDepth, int drawMode) const; 31 29 32 30 -
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4626 r4635 77 77 78 78 79 void OBBTree::drawBV(int depth ) const79 void OBBTree::drawBV(int depth, int drawMode) const 80 80 { 81 81 if( likely(this->rootNode != NULL)) 82 82 { 83 this->rootNode->drawBV(depth); 84 this->rootNode->drawBVPolygon(depth); 83 this->rootNode->drawBV(depth, drawMode); 85 84 } 86 85 } 87 86 88 89 void OBBTree::drawBVPolygon(int depth) const90 {91 if( likely(this->rootNode != NULL))92 this->rootNode->drawBVPolygon(depth);93 }94 95 96 void OBBTree::drawBVBlended(int depth) const97 {98 if( likely(this->rootNode != NULL))99 this->rootNode->drawBVBlended(depth);100 }101 87 102 88 -
orxonox/trunk/src/lib/collision_detection/obb_tree.h
r4622 r4635 27 27 void collideWith(const OBBTree &tree); 28 28 29 virtual void drawBV(int depth) const; 30 virtual void drawBVPolygon(int depth) const; 31 virtual void drawBVBlended(int depth) const; 29 virtual void drawBV(int depth, int drawMode) const; 32 30 33 31 Material* getMaterial(unsigned int depth) { return material[depth%3]; } -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4633 r4635 439 439 440 440 441 void OBBTreeNode::drawBV(int depth) const 442 { 443 glBegin(GL_TRIANGLES); 444 glColor3f(1.0, 1.0, 1.0); 445 for(int i = 0; i < this->bvElement->numOfVertices; ++i) 441 void OBBTreeNode::drawBV(int depth, int drawMode) const 442 { 443 //OBBTree::material->select(); 444 445 this->obbTree->getMaterial(depth)->select(); 446 447 /* draw the model itself, there is some problem concerning this: the vertices are drawn multiple times */ 448 if( drawMode & DRAW_MODEL || drawMode & DRAW_ALL) 449 { 450 glBegin(GL_TRIANGLES); 451 glColor3f(1.0, 1.0, 1.0); 452 for(int i = 0; i < this->bvElement->numOfVertices; ++i) 446 453 { 447 454 glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 448 455 //printf("v(%f, %f, %f)\n", this->vertices[i][0], this->vertices[i][1], this->vertices[i][2]); 449 456 } 450 glEnd(); 451 //this->drawBVPolygon(depth); 452 } 453 454 455 void OBBTreeNode::drawBVPolygon(int depth) const 456 { 457 //OBBTree::material->select(); 458 459 this->obbTree->getMaterial(depth)->select(); 457 glEnd(); 458 } 459 460 460 461 461 /* draw world axes */ … … 473 473 474 474 475 476 /* draw the obb axes */ 477 // glBegin(GL_LINES); 478 // glColor3f(0.0, 0.4, 0.3); 479 // glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 480 // glVertex3f(this->bvElement->center->x + this->bvElement->axis[0]->x * this->bvElement->halfLength[0], 481 // this->bvElement->center->y + this->bvElement->axis[0]->y * this->bvElement->halfLength[0], 482 // this->bvElement->center->z + this->bvElement->axis[0]->z * this->bvElement->halfLength[0]); 483 // 484 // glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 485 // glVertex3f(this->bvElement->center->x + this->bvElement->axis[1]->x * this->bvElement->halfLength[1], 486 // this->bvElement->center->y + this->bvElement->axis[1]->y * this->bvElement->halfLength[1], 487 // this->bvElement->center->z + this->bvElement->axis[1]->z * this->bvElement->halfLength[1]); 488 // 489 // glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 490 // glVertex3f(this->bvElement->center->x + this->bvElement->axis[2]->x * this->bvElement->halfLength[2], 491 // this->bvElement->center->y + this->bvElement->axis[2]->y * this->bvElement->halfLength[2], 492 // this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]); 493 // glEnd(); 494 495 496 Vector cen = *this->bvElement->center; 497 Vector** axis = this->bvElement->axis; 498 float* len = this->bvElement->halfLength; 499 500 /* draw bounding box */ 501 glBegin(GL_LINE_LOOP); 502 glColor3f(0.3, 0.4, 0.7); 503 glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2], 504 cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2], 505 cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]); 506 glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2], 507 cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2], 508 cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]); 509 glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2], 510 cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2], 511 cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]); 512 glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2], 513 cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2], 514 cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]); 515 glEnd(); 516 517 glBegin(GL_LINE_LOOP); 518 glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2], 519 cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2], 520 cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]); 521 glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2], 522 cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2], 523 cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]); 524 glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2], 525 cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2], 526 cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]); 527 glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2], 528 cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2], 529 cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]); 530 glEnd(); 531 532 glBegin(GL_LINE_LOOP); 533 glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2], 534 cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2], 535 cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]); 536 glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2], 537 cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2], 538 cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]); 539 glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2], 540 cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2], 541 cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]); 542 glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2], 543 cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2], 544 cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]); 545 glEnd(); 546 547 glBegin(GL_LINE_LOOP); 548 glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2], 549 cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2], 550 cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]); 551 glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2], 552 cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2], 553 cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]); 554 glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2], 555 cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2], 556 cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]); 557 glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2], 558 cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2], 559 cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]); 560 glEnd(); 561 562 563 if( true)//depth != 0) 564 { 565 /* now draw the separation plane */ 566 Vector a1 = *this->bvElement->axis[(this->longestAxisIndex + 1)%3]; 567 Vector a2 = *this->bvElement->axis[(this->longestAxisIndex + 2)%3]; 568 Vector c = *this->bvElement->center; 569 float l1 = this->bvElement->halfLength[(this->longestAxisIndex + 1)%3]; 570 float l2 = this->bvElement->halfLength[(this->longestAxisIndex + 2)%3]; 571 glBegin(GL_QUADS); 572 glVertex3f(c.x + a1.x * l1 + a2.x * l2, c.y + a1.y * l1+ a2.y * l2, c.z + a1.z * l1 + a2.z * l2); 573 glVertex3f(c.x - a1.x * l1 + a2.x * l2, c.y - a1.y * l1+ a2.y * l2, c.z - a1.z * l1 + a2.z * l2); 574 glVertex3f(c.x - a1.x * l1 - a2.x * l2, c.y - a1.y * l1- a2.y * l2, c.z - a1.z * l1 - a2.z * l2); 575 glVertex3f(c.x + a1.x * l1 - a2.x * l2, c.y + a1.y * l1- a2.y * l2, c.z + a1.z * l1 - a2.z * l2); 576 glEnd(); 475 if( drawMode & DRAW_BV_AXIS || drawMode & DRAW_ALL) 476 { 477 if( drawMode & DRAW_SINGLE && depth == 0) 478 { 479 /* draw the obb axes */ 480 glBegin(GL_LINES); 481 glColor3f(0.0, 0.4, 0.3); 482 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 483 glVertex3f(this->bvElement->center->x + this->bvElement->axis[0]->x * this->bvElement->halfLength[0], 484 this->bvElement->center->y + this->bvElement->axis[0]->y * this->bvElement->halfLength[0], 485 this->bvElement->center->z + this->bvElement->axis[0]->z * this->bvElement->halfLength[0]); 486 487 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 488 glVertex3f(this->bvElement->center->x + this->bvElement->axis[1]->x * this->bvElement->halfLength[1], 489 this->bvElement->center->y + this->bvElement->axis[1]->y * this->bvElement->halfLength[1], 490 this->bvElement->center->z + this->bvElement->axis[1]->z * this->bvElement->halfLength[1]); 491 492 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 493 glVertex3f(this->bvElement->center->x + this->bvElement->axis[2]->x * this->bvElement->halfLength[2], 494 this->bvElement->center->y + this->bvElement->axis[2]->y * this->bvElement->halfLength[2], 495 this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]); 496 glEnd(); 497 } 498 } 499 500 501 if( drawMode & DRAW_BV_POLYGON || drawMode & DRAW_ALL) 502 { 503 if( drawMode & DRAW_SINGLE && depth == 0) 504 { 505 Vector cen = *this->bvElement->center; 506 Vector** axis = this->bvElement->axis; 507 float* len = this->bvElement->halfLength; 508 509 /* draw bounding box */ 510 glBegin(GL_LINE_LOOP); 511 glColor3f(0.3, 0.4, 0.7); 512 glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2], 513 cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2], 514 cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]); 515 glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2], 516 cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2], 517 cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]); 518 glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2], 519 cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2], 520 cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]); 521 glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2], 522 cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2], 523 cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]); 524 glEnd(); 525 526 glBegin(GL_LINE_LOOP); 527 glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2], 528 cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2], 529 cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]); 530 glVertex3f(cen.x + axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2], 531 cen.y + axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2], 532 cen.z + axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]); 533 glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2], 534 cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2], 535 cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]); 536 glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2], 537 cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2], 538 cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]); 539 glEnd(); 540 541 glBegin(GL_LINE_LOOP); 542 glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] + axis[2]->x * len[2], 543 cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] + axis[2]->y * len[2], 544 cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] + axis[2]->z * len[2]); 545 glVertex3f(cen.x - axis[0]->x * len[0] - axis[1]->x * len[1] - axis[2]->x * len[2], 546 cen.y - axis[0]->y * len[0] - axis[1]->y * len[1] - axis[2]->y * len[2], 547 cen.z - axis[0]->z * len[0] - axis[1]->z * len[1] - axis[2]->z * len[2]); 548 glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2], 549 cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2], 550 cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]); 551 glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2], 552 cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2], 553 cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]); 554 glEnd(); 555 556 glBegin(GL_LINE_LOOP); 557 glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2], 558 cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2], 559 cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]); 560 glVertex3f(cen.x - axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2], 561 cen.y - axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2], 562 cen.z - axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]); 563 glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] + axis[2]->x * len[2], 564 cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] + axis[2]->y * len[2], 565 cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] + axis[2]->z * len[2]); 566 glVertex3f(cen.x + axis[0]->x * len[0] + axis[1]->x * len[1] - axis[2]->x * len[2], 567 cen.y + axis[0]->y * len[0] + axis[1]->y * len[1] - axis[2]->y * len[2], 568 cen.z + axis[0]->z * len[0] + axis[1]->z * len[1] - axis[2]->z * len[2]); 569 glEnd(); 570 } 571 } 572 573 if( drawMode & DRAW_SEPARATING_PLANE || drawMode & DRAW_ALL) 574 { 575 if( drawMode & DRAW_SINGLE && depth == 0) 576 { 577 /* now draw the separation plane */ 578 Vector a1 = *this->bvElement->axis[(this->longestAxisIndex + 1)%3]; 579 Vector a2 = *this->bvElement->axis[(this->longestAxisIndex + 2)%3]; 580 Vector c = *this->bvElement->center; 581 float l1 = this->bvElement->halfLength[(this->longestAxisIndex + 1)%3]; 582 float l2 = this->bvElement->halfLength[(this->longestAxisIndex + 2)%3]; 583 glBegin(GL_QUADS); 584 glVertex3f(c.x + a1.x * l1 + a2.x * l2, c.y + a1.y * l1+ a2.y * l2, c.z + a1.z * l1 + a2.z * l2); 585 glVertex3f(c.x - a1.x * l1 + a2.x * l2, c.y - a1.y * l1+ a2.y * l2, c.z - a1.z * l1 + a2.z * l2); 586 glVertex3f(c.x - a1.x * l1 - a2.x * l2, c.y - a1.y * l1- a2.y * l2, c.z - a1.z * l1 - a2.z * l2); 587 glVertex3f(c.x + a1.x * l1 - a2.x * l2, c.y + a1.y * l1- a2.y * l2, c.z + a1.z * l1 - a2.z * l2); 588 glEnd(); 589 } 577 590 } 578 591 579 592 if( this->nodeLeft != NULL && depth != 0 ) 580 this->nodeLeft->drawBV Polygon(depth - 1);593 this->nodeLeft->drawBV(depth - 1, drawMode); 581 594 if( this->nodeRight != NULL && depth != 0) 582 this->nodeRight->drawBVPolygon(depth - 1); 583 584 } 585 586 587 void OBBTreeNode::drawBVBlended(int depth) const 588 {} 595 this->nodeRight->drawBV(depth - 1, drawMode); 596 597 } 598 589 599 590 600 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.h
r4632 r4635 35 35 virtual void collideWith(const BVTree &tree); 36 36 37 virtual void drawBV(int depth) const; 38 virtual void drawBVPolygon(int depth) const; 39 virtual void drawBVBlended(int depth) const; 37 virtual void drawBV(int depth, int drawMode) const; 40 38 41 39 void debug();
Note: See TracChangeset
for help on using the changeset viewer.