Changeset 5383 in orxonox.OLD for trunk/src/lib/coord
- Timestamp:
- Oct 15, 2005, 8:42:17 PM (19 years ago)
- Location:
- trunk/src/lib/coord
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5382 r5383 654 654 * displays some information about this pNode 655 655 * @param depth The deph into which to debug the children of this PNode to. 656 * (0: all children will be debugged, 1: only this PNode, 2: this and direct children ...)657 * @param level The n-th level of the Node we draw (this is internal and only for nice output)656 * (0: all children will be debugged, 1: only this PNode, 2: this and direct children, ...) 657 * @param level !! INTERNAL !! The n-th level of the Node we draw (this is internal and only for nice output). 658 658 */ 659 659 void PNode::debug(unsigned int depth, unsigned int level) const … … 697 697 698 698 /** 699 displays the PNode at its position with its rotation as a cube. 700 */ 701 void PNode::debugDraw(unsigned int depth, float size, const Vector& color) const 702 { 703 glMatrixMode(GL_MODELVIEW); 699 * displays the PNode at its position with its rotation as a cube. 700 * @param depth The deph into which to debug the children of this PNode to. 701 * (0: all children will be displayed, 1: only this PNode, 2: this and direct children, ...) 702 * @param size the Size of the Box to draw. 703 * @param color the color of the Box to display. 704 * @param level !! INTERNAL !! The n-th level of the Node we draw (this is internal and only for nice output). 705 */ 706 void PNode::debugDraw(unsigned int depth, float size, const Vector& color, unsigned int level) const 707 { 708 if (level == 0) 709 { 710 glPushAttrib(GL_ENABLE_BIT); 711 glMatrixMode(GL_MODELVIEW); 712 713 glDisable(GL_LIGHTING); 714 glDisable(GL_BLEND); 715 glDisable(GL_TEXTURE_2D); 716 } 717 704 718 glPushMatrix(); 705 glDisable(GL_LIGHTING);706 707 719 /* translate */ 708 720 glTranslatef (this->getAbsCoor ().x, … … 715 727 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 716 728 glColor3f(color.x, color.y, color.z); 729 717 730 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 718 731 { … … 745 758 746 759 glPopMatrix(); 747 glEnable(GL_LIGHTING);748 760 if (depth >= 2 || depth == 0) 749 761 { 750 762 Vector childColor = Color::HSVtoRGB(Color::RGBtoHSV(color)+Vector(20,0,.0)); 751 752 763 tIterator<PNode>* iterator = this->children->getIterator(); 753 764 PNode* pn = iterator->firstElement(); … … 755 766 { 756 767 if (depth == 0) 757 pn->debugDraw(0, size, childColor );768 pn->debugDraw(0, size, childColor, level+1); 758 769 else 759 pn->debugDraw(depth - 1, size, childColor );770 pn->debugDraw(depth - 1, size, childColor, level +1); 760 771 pn = iterator->nextElement(); 761 772 } 762 773 delete iterator; 763 774 } 775 if (level == 0) 776 glPopAttrib(); 764 777 } 765 778 -
trunk/src/lib/coord/p_node.h
r5382 r5383 118 118 119 119 void debug (unsigned int depth = 1, unsigned int level = 0) const; 120 void debugDraw(unsigned int depth = 1, float size = 1.0, const Vector& color = Vector(1, 1,1)) const;120 void debugDraw(unsigned int depth = 1, float size = 1.0, const Vector& color = Vector(1, 0, 0), unsigned int level = 0) const; 121 121 122 122
Note: See TracChangeset
for help on using the changeset viewer.