Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2005, 11:00:48 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: included libORXquadtree.a

File:
1 edited

Legend:

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

    r4840 r4843  
    1818#include "element_2d.h"
    1919#include "render_2d.h"
     20
     21#include "graphics_engine.h"
     22#include "p_node.h"
    2023
    2124using namespace std;
     
    4144  Render2D::getInstance()->unregisterElement2D(this);
    4245}
     46
     47
     48/**
     49 * this sets the position of the Element on the screen.
     50 */
     51void Element2D::positioning()
     52{
     53  // setting the Position of this ELEM2D.
     54  Vector pos;
     55  if (this->bindNode)
     56  {
     57    GLdouble x = this->bindNode->getAbsCoor().x;
     58    GLdouble y = this->bindNode->getAbsCoor().y;
     59    GLdouble z = this->bindNode->getAbsCoor().z;
     60    GLdouble projectPos[3];
     61    gluProject(x, y, z, GraphicsEngine::modMat, GraphicsEngine::projMat, GraphicsEngine::viewPort, projectPos, projectPos+1, projectPos+2);
     62    pos.x = projectPos[0] + this->position2D[0];
     63    pos.y = GraphicsEngine::getInstance()->getResolutionY() - projectPos[1] + this->position2D[1];
     64    pos.z = projectPos[2];
     65  }
     66  else
     67  {
     68    pos.x = this->position2D[0];
     69    pos.y = this->position2D[1];
     70    pos.z = 0;
     71  }
     72
     73  glPushMatrix();
     74}
     75
Note: See TracChangeset for help on using the changeset viewer.