Changeset 4671 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 23, 2005, 6:54:34 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4670 r4671 51 51 transparentMaterial[i] = new Material(); 52 52 transparentMaterial[i]->setIllum(3); 53 transparentMaterial[i]->setTransparency(0. 5);53 transparentMaterial[i]->setTransparency(0.2); 54 54 } 55 55 transparentMaterial[0]->setAmbient(0.0, 0.3, 0.0); -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4670 r4671 761 761 glEnd(); 762 762 763 764 if( drawMode & DRAW_BV_BLENDED) 765 { 766 glBegin(GL_QUADS); 767 glVertex3f(cen.x - axis[0].x * len[0] + axis[1].x * len[1] - axis[2].x * len[2], 768 cen.y - axis[0].y * len[0] + axis[1].y * len[1] - axis[2].y * len[2], 769 cen.z - axis[0].z * len[0] + axis[1].z * len[1] - axis[2].z * len[2]); 770 glVertex3f(cen.x + axis[0].x * len[0] + axis[1].x * len[1] - axis[2].x * len[2], 771 cen.y + axis[0].y * len[0] + axis[1].y * len[1] - axis[2].y * len[2], 772 cen.z + axis[0].z * len[0] + axis[1].z * len[1] - axis[2].z * len[2]); 773 glVertex3f(cen.x + axis[0].x * len[0] - axis[1].x * len[1] - axis[2].x * len[2], 774 cen.y + axis[0].y * len[0] - axis[1].y * len[1] - axis[2].y * len[2], 775 cen.z + axis[0].z * len[0] - axis[1].z * len[1] - axis[2].z * len[2]); 776 glVertex3f(cen.x - axis[0].x * len[0] - axis[1].x * len[1] - axis[2].x * len[2], 777 cen.y - axis[0].y * len[0] - axis[1].y * len[1] - axis[2].y * len[2], 778 cen.z - axis[0].z * len[0] - axis[1].z * len[1] - axis[2].z * len[2]); 779 glEnd(); 780 781 glBegin(GL_QUADS); 782 glVertex3f(cen.x - axis[0].x * len[0] + axis[1].x * len[1] + axis[2].x * len[2], 783 cen.y - axis[0].y * len[0] + axis[1].y * len[1] + axis[2].y * len[2], 784 cen.z - axis[0].z * len[0] + axis[1].z * len[1] + axis[2].z * len[2]); 785 glVertex3f(cen.x + axis[0].x * len[0] + axis[1].x * len[1] + axis[2].x * len[2], 786 cen.y + axis[0].y * len[0] + axis[1].y * len[1] + axis[2].y * len[2], 787 cen.z + axis[0].z * len[0] + axis[1].z * len[1] + axis[2].z * len[2]); 788 glVertex3f(cen.x + axis[0].x * len[0] - axis[1].x * len[1] + axis[2].x * len[2], 789 cen.y + axis[0].y * len[0] - axis[1].y * len[1] + axis[2].y * len[2], 790 cen.z + axis[0].z * len[0] - axis[1].z * len[1] + axis[2].z * len[2]); 791 glVertex3f(cen.x - axis[0].x * len[0] - axis[1].x * len[1] + axis[2].x * len[2], 792 cen.y - axis[0].y * len[0] - axis[1].y * len[1] + axis[2].y * len[2], 793 cen.z - axis[0].z * len[0] - axis[1].z * len[1] + axis[2].z * len[2]); 794 glEnd(); 795 } 796 797 763 798 if( drawMode & DRAW_BV_BLENDED) 764 799 this->obbTree->getMaterial(treeIndex)->select(); … … 771 806 if( !(drawMode & DRAW_SINGLE && depth != 0)) 772 807 { 808 if( drawMode & DRAW_BV_BLENDED) 809 this->obbTree->getTransparentMaterial(treeIndex)->select(); 810 773 811 /* now draw the separation plane */ 774 812 Vector a1 = this->bvElement->axis[(this->longestAxisIndex + 1)%3]; … … 783 821 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); 784 822 glEnd(); 823 824 if( drawMode & DRAW_BV_BLENDED) 825 this->obbTree->getMaterial(treeIndex)->select(); 826 785 827 } 786 828 } -
orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc
r4661 r4671 232 232 } 233 233 234 235 int blendedBox(GtkWidget* nonInterest, void* widget) 236 { 237 if(drawMode & DRAW_BV_BLENDED) 238 { 239 int temp = drawMode & DRAW_BV_BLENDED; 240 drawMode ^= temp; 241 printf("Removing OBB Polygons\n"); 242 } 243 else 244 { 245 drawMode |= DRAW_BV_BLENDED; 246 printf("Drawing OBB Polygons\n"); 247 } 248 } 249 250 234 251 int treeDepth(GtkWidget* nonInterest, void* widget) 235 252 { … … 258 275 Box* windowBox = new Box('v'); 259 276 { 260 CheckButton* BoxPolygons = new CheckButton(" BoxPolygons");277 CheckButton* BoxPolygons = new CheckButton("Draw OBB Polygons"); 261 278 BoxPolygons->connectSignal("clicked", (void*)BoxPolygons, boxPolygons); 262 279 windowBox->fill(BoxPolygons); 280 281 282 CheckButton* BlendedBox = new CheckButton("Draw OBB Blended"); 283 BlendedBox->connectSignal("clicked", (void*)BlendedBox, blendedBox); 284 windowBox->fill(BlendedBox); 263 285 264 286 … … 266 288 SeperatingPlanes->connectSignal("clicked", (void*)SeperatingPlanes, seperatingPlanes); 267 289 windowBox->fill(SeperatingPlanes); 290 268 291 269 292 Slider* TreeDepth = new Slider("TreeDepth", 0, 5);
Note: See TracChangeset
for help on using the changeset viewer.