Changeset 7843 in orxonox.OLD for trunk/src/lib/graphics/render2D/element_2d.cc
- Timestamp:
- May 24, 2006, 11:17:59 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.cc
r7840 r7843 21 21 #include <algorithm> 22 22 23 // ONLY IF PNODE ENABLED // 24 #include "state.h" 23 25 #include "p_node.h" 26 #include "camera.h" 27 /////////////////////////// 24 28 25 29 #include "graphics_engine.h" … … 45 49 46 50 this->setVisibility(true); 51 this->bCurrentlyVisible = true; 47 52 this->activate2D(); 48 53 this->setAlignment(E2D_ALIGN_NONE); … … 240 245 241 246 247 /** 248 * @brief sets a node, this 2D-Element should be shown upon 249 * @param bindNode the Node of the Node. (if NULL it will be unset). 250 */ 251 void Element2D::setBindNode(const PNode* bindNode) 252 { 253 this->bindNode = bindNode; 254 if (bindNode == NULL) 255 this->bCurrentlyVisible = true; 256 } 242 257 243 258 /** … … 863 878 else if (unlikely(this->bindNode != NULL)) 864 879 { 880 if (State::getCamera()->distance(this->bindNode) < 0) 881 this->bCurrentlyVisible = false; 882 else 883 { 884 this->bCurrentlyVisible = true; 885 printf("OK \n"); 886 } 887 865 888 GLdouble projectPos[3] = {0.0, 0.0, 0.0}; 866 889 gluProject(this->bindNode->getAbsCoor().x, … … 1011 1034 void Element2D::draw2D(E2D_LAYER from, E2D_LAYER to) const 1012 1035 { 1013 if (this->bVisible )1036 if (this->bVisible && this->bCurrentlyVisible) 1014 1037 this->draw(); 1015 1038 if (this->children.size() > 0)
Note: See TracChangeset
for help on using the changeset viewer.