- Timestamp:
- Jun 23, 2005, 6:29:10 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4668 r4670 44 44 material[3]->setAmbient(5.0, 3.0, 1.0); 45 45 material[4]->setAmbient(1.0, 0.0, 7.0); 46 47 48 transparentMaterial = new Material*[5]; 49 for(int i = 0; i < 5; ++i) 50 { 51 transparentMaterial[i] = new Material(); 52 transparentMaterial[i]->setIllum(3); 53 transparentMaterial[i]->setTransparency(0.5); 54 } 55 transparentMaterial[0]->setAmbient(0.0, 0.3, 0.0); 56 transparentMaterial[1]->setAmbient(0.4, 0.0, 0.2); 57 transparentMaterial[2]->setAmbient(1.0, 0.0, 0.0); 58 transparentMaterial[3]->setAmbient(5.0, 3.0, 1.0); 59 transparentMaterial[4]->setAmbient(1.0, 0.0, 7.0); 46 60 47 61 this->id = 0; -
orxonox/trunk/src/lib/collision_detection/obb_tree.h
r4638 r4670 30 30 31 31 Material* getMaterial(unsigned int depth) { return material[depth%5]; } 32 Material* getTransparentMaterial(unsigned int depth) { return transparentMaterial[depth%5]; } 32 33 int getID() { return ++this->id;} 33 34 … … 42 43 OBBTreeNode* rootNode; //!< reference to the root node of the tree 43 44 Material** material; 45 Material** transparentMaterial; 44 46 int id; 45 47 }; -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4669 r4670 685 685 float* len = this->bvElement->halfLength; 686 686 687 if( drawMode & DRAW_BV_BLENDED) 688 this->obbTree->getTransparentMaterial(treeIndex)->select(); 689 687 690 /* draw bounding box */ 688 glBegin(GL_QUAD_STRIP); 691 if( drawMode & DRAW_BV_BLENDED) 692 glBegin(GL_QUADS); 693 else 694 glBegin(GL_LINE_LOOP); 689 695 glVertex3f(cen.x + axis[0].x * len[0] + axis[1].x * len[1] + axis[2].x * len[2], 690 696 cen.y + axis[0].y * len[0] + axis[1].y * len[1] + axis[2].y * len[2], … … 701 707 glEnd(); 702 708 703 glBegin(GL_LINE_LOOP); 709 if( drawMode & DRAW_BV_BLENDED) 710 glBegin(GL_QUADS); 711 else 712 glBegin(GL_LINE_LOOP); 704 713 glVertex3f(cen.x + axis[0].x * len[0] - axis[1].x * len[1] + axis[2].x * len[2], 705 714 cen.y + axis[0].y * len[0] - axis[1].y * len[1] + axis[2].y * len[2], … … 716 725 glEnd(); 717 726 718 glBegin(GL_LINE_LOOP); 727 if( drawMode & DRAW_BV_BLENDED) 728 glBegin(GL_QUADS); 729 else 730 glBegin(GL_LINE_LOOP); 719 731 glVertex3f(cen.x - axis[0].x * len[0] - axis[1].x * len[1] + axis[2].x * len[2], 720 732 cen.y - axis[0].y * len[0] - axis[1].y * len[1] + axis[2].y * len[2], … … 731 743 glEnd(); 732 744 733 glBegin(GL_LINE_LOOP); 745 if( drawMode & DRAW_BV_BLENDED) 746 glBegin(GL_QUADS); 747 else 748 glBegin(GL_LINE_LOOP); 734 749 glVertex3f(cen.x - axis[0].x * len[0] + axis[1].x * len[1] - axis[2].x * len[2], 735 750 cen.y - axis[0].y * len[0] + axis[1].y * len[1] - axis[2].y * len[2], … … 745 760 cen.z + axis[0].z * len[0] + axis[1].z * len[1] - axis[2].z * len[2]); 746 761 glEnd(); 762 763 if( drawMode & DRAW_BV_BLENDED) 764 this->obbTree->getMaterial(treeIndex)->select(); 747 765 } 748 766
Note: See TracChangeset
for help on using the changeset viewer.