Changeset 5008 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Aug 14, 2005, 2:46:29 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/coord/p_node.cc
r5007 r5008 657 657 displays the PNode at its position with its rotation as a cube. 658 658 */ 659 void PNode::debugDraw(unsigned int depth, float size ) const659 void PNode::debugDraw(unsigned int depth, float size, Vector color) const 660 660 { 661 661 glMatrixMode(GL_MODELVIEW); 662 662 glPushMatrix(); 663 glDisable(GL_LIGHTING); 663 664 664 665 /* translate */ … … 671 672 672 673 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 674 glColor3f(color.x, color.y, color.z); 673 675 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 674 676 { … … 705 707 tIterator<PNode>* iterator = this->children->getIterator(); 706 708 //PNode* pn = this->children->enumerate (); 709 Vector childColor = color - Vector(.0,.3,.3); 707 710 PNode* pn = iterator->nextElement(); 708 711 while( pn != NULL) 709 712 { 710 713 if (depth == 0) 711 pn->debugDraw(0, size );714 pn->debugDraw(0, size, childColor); 712 715 else 713 pn->debugDraw(depth - 1, size );716 pn->debugDraw(depth - 1, size, childColor); 714 717 pn = iterator->nextElement(); 715 718 } 716 719 delete iterator; 717 720 } 721 glEnable(GL_LIGHTING); 718 722 } 719 723 -
orxonox/trunk/src/lib/coord/p_node.h
r5007 r5008 116 116 117 117 void debug (unsigned int depth = 1, unsigned int level = 0) const; 118 void debugDraw(unsigned int depth = 1, float size = 1.0 ) const;118 void debugDraw(unsigned int depth = 1, float size = 1.0, Vector color = Vector(1,1,1)) const; 119 119 120 120 -
orxonox/trunk/src/lib/math/vector.h
r5006 r5008 1 1 /*! 2 \file vector.h3 *A basic 3D math framework4 5 2 * @file vector.h 3 * A basic 3D math framework 4 * 5 * Contains classes to handle vectors, lines, rotations and planes 6 6 */ 7 7 … … 107 107 inline float angleRad (const Vector& v1, const Vector& v2) { return acos( v1 * v2 / (v1.len() * v2.len())) * 180/M_PI; }; 108 108 109 /** an easy way to create a Random Vector @param sideLength the length of the Vector (x not sqrt(x^2...)) */ 110 #define VECTOR_RAND(sideLength) (Vector((float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5) * sideLength) 111 109 112 110 113 //! Quaternion
Note: See TracChangeset
for help on using the changeset viewer.