Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 2, 2006, 12:47:18 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: redirect everything to see into the dof of the _centerNode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/elements/glgui_radar.cc

    r9001 r9002  
    114114        if (_centerNode->distance(*it) < this->_range)
    115115        {
    116           this->_dotLists[i].positions.push_back(Vector2D(this->getSizeX2D() / 2.0f, this->getSizeY2D() / 2.0f) + Vector2D((_centerNode->getAbsCoor().x - (*it)->getAbsCoor().x) * this->getSizeX2D(), (_centerNode->getAbsCoor().z - (*it)->getAbsCoor().z) * this->getSizeY2D())/ (2.0f * _range));
     116          this->_dotLists[i].positions.push_back(Vector2D(((*it)->getAbsCoor().x - _centerNode->getAbsCoor().x) * this->getSizeX2D() ,
     117                                                 ((*it)->getAbsCoor().z - _centerNode->getAbsCoor().z) * this->getSizeY2D()  )
     118                                                 / (2.0f * _range));
    117119        }
    118120
     
    128130    GLGuiWidget::draw();
    129131
    130     glPointSize(2.0f);
    131     for (unsigned int i = 0; i < this->_dotLists.size(); ++i)
     132    if (likely(this->_centerNode != NULL))
    132133    {
    133       glColor4fv(&_dotLists[i].dotColor[0]);
    134       for (unsigned int j = 0; j < this->_dotLists[i].positions.size(); ++j)
     134      glTranslatef(this->getSizeX2D()/2.0f, this->getSizeY2D()/2.0f, 0);
     135      glRotatef((this->_centerNode->getAbsDir().getHeading() - M_PI_2)* 180.0 /M_PI , 0, 0, 1);
     136
     137      glPointSize(2.0f);
     138      for (unsigned int i = 0; i < this->_dotLists.size(); ++i)
    135139      {
    136         glBegin(GL_POINTS);
    137         glVertex2f(this->_dotLists[i].positions[j].x, this->_dotLists[i].positions[j].y);
    138         glEnd();
     140        glColor4fv(&_dotLists[i].dotColor[0]);
     141        for (unsigned int j = 0; j < this->_dotLists[i].positions.size(); ++j)
     142        {
     143          glBegin(GL_POINTS);
     144          glVertex2f(this->_dotLists[i].positions[j].x, this->_dotLists[i].positions[j].y);
     145          glEnd();
     146        }
    139147      }
    140148    }
Note: See TracChangeset for help on using the changeset viewer.