Changeset 9002 in orxonox.OLD for trunk/src/world_entities/elements/glgui_radar.cc
- Timestamp:
- Jul 2, 2006, 12:47:18 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/elements/glgui_radar.cc
r9001 r9002 114 114 if (_centerNode->distance(*it) < this->_range) 115 115 { 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)); 117 119 } 118 120 … … 128 130 GLGuiWidget::draw(); 129 131 130 glPointSize(2.0f); 131 for (unsigned int i = 0; i < this->_dotLists.size(); ++i) 132 if (likely(this->_centerNode != NULL)) 132 133 { 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) 135 139 { 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 } 139 147 } 140 148 }
Note: See TracChangeset
for help on using the changeset viewer.