Changeset 5481 in orxonox.OLD for trunk/src/lib/collision_detection/obb_tree_node.cc
- Timestamp:
- Nov 3, 2005, 10:22:30 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/obb_tree_node.cc
r5449 r5481 25 25 26 26 #include <math.h> 27 #include "color.h" 27 28 28 29 #include "stdincl.h" 29 30 30 #include "lin_alg.h" 31 31 #include "glincl.h" … … 806 806 807 807 808 void OBBTreeNode::drawBV(int depth, int drawMode )808 void OBBTreeNode::drawBV(int depth, int drawMode, const Vector& color, bool top) const 809 809 { 810 this->obbTree->getMaterial(treeIndex)->select();811 810 812 811 /* draw the model itself, there is some problem concerning this: the vertices are drawn multiple times */ … … 834 833 } 835 834 835 if (top) 836 { 837 glPushAttrib(GL_ENABLE_BIT); 838 glDisable(GL_LIGHTING); 839 glDisable(GL_TEXTURE_2D); 840 glDisable(GL_BLEND); 841 } 842 glColor3f(color.x, color.y, color.z); 843 836 844 837 845 /* draw world axes */ … … 839 847 { 840 848 glBegin(GL_LINES); 841 glColor3f( 0.0, 0.4, 0.3);849 glColor3f(1.0, 0.0, 0.0); 842 850 glVertex3f(0.0, 0.0, 0.0); 843 851 glVertex3f(3.0, 0.0, 0.0); 844 852 853 glColor3f(0.0, 1.0, 0.0); 845 854 glVertex3f(0.0, 0.0, 0.0); 846 855 glVertex3f(0.0, 3.0, 0.0); 847 856 857 glColor3f(0.0, 0.0, 1.0); 848 858 glVertex3f(0.0, 0.0, 0.0); 849 859 glVertex3f(0.0, 0.0, 3.0); … … 890 900 891 901 if( this->bvElement->bCollided) 892 this->obbTree->getCollisionMaterial()->select(); 902 { 903 glColor3f(1.0, 1.0, 1.0); // COLLISION COLOR 904 } 893 905 else if( drawMode & DRAW_BV_BLENDED) 894 this->obbTree->getTransparentMaterial(treeIndex)->select(); 906 { 907 glColor4f(color.x, color.y, color.z, .5); 908 } 895 909 896 910 … … 1005 1019 1006 1020 if( drawMode & DRAW_BV_BLENDED) 1007 this->obbTree->getMaterial(treeIndex)->select();1021 glColor3f(color.x, color.y, color.z); 1008 1022 } 1009 1023 … … 1016 1030 { 1017 1031 if( drawMode & DRAW_BV_BLENDED) 1018 this->obbTree->getTransparentMaterial(treeIndex)->select();1032 glColor4f(color.x, color.y, color.z, .6); 1019 1033 1020 1034 /* now draw the separation plane */ … … 1032 1046 1033 1047 if( drawMode & DRAW_BV_BLENDED) 1034 this->obbTree->getMaterial(treeIndex)->select(); 1035 1036 } 1037 } 1038 1039 1040 1041 if( this->nodeLeft != NULL && depth != 0 ) 1042 this->nodeLeft->drawBV(depth - 1, drawMode); 1043 if( this->nodeRight != NULL && depth != 0) 1044 this->nodeRight->drawBV(depth - 1, drawMode); 1045 1048 glColor4f(color.x, color.y, color.z, 1.0); 1049 1050 } 1051 } 1052 1053 1054 1055 if (depth > 0) 1056 { 1057 Vector childColor = Color::HSVtoRGB(Color::RGBtoHSV(color)+Vector(20,0,.0)); 1058 if( this->nodeLeft != NULL) 1059 this->nodeLeft->drawBV(depth - 1, drawMode, childColor, false); 1060 if( this->nodeRight != NULL) 1061 this->nodeRight->drawBV(depth - 1, drawMode, childColor, false); 1062 } 1046 1063 this->bvElement->bCollided = false; 1064 1065 if (top) 1066 glPopAttrib(); 1047 1067 } 1048 1068
Note: See TracChangeset
for help on using the changeset viewer.