Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2006, 11:17:59 PM (19 years ago)
Author:
bensch
Message:

compiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r7840 r7843  
    2121#include <algorithm>
    2222
     23// ONLY IF PNODE ENABLED //
     24#include "state.h"
    2325#include "p_node.h"
     26#include "camera.h"
     27///////////////////////////
    2428
    2529#include "graphics_engine.h"
     
    4549
    4650  this->setVisibility(true);
     51  this->bCurrentlyVisible = true;
    4752  this->activate2D();
    4853  this->setAlignment(E2D_ALIGN_NONE);
     
    240245
    241246
     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 */
     251void Element2D::setBindNode(const PNode* bindNode)
     252{
     253  this->bindNode = bindNode;
     254  if (bindNode == NULL)
     255    this->bCurrentlyVisible = true;
     256}
    242257
    243258/**
     
    863878    else if (unlikely(this->bindNode != NULL))
    864879    {
     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
    865888      GLdouble projectPos[3] = {0.0, 0.0, 0.0};
    866889      gluProject(this->bindNode->getAbsCoor().x,
     
    10111034void Element2D::draw2D(E2D_LAYER from, E2D_LAYER to) const
    10121035{
    1013   if (this->bVisible)
     1036  if (this->bVisible && this->bCurrentlyVisible)
    10141037    this->draw();
    10151038  if (this->children.size() > 0)
Note: See TracChangeset for help on using the changeset viewer.