Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8996 in orxonox.OLD for trunk/src/world_entities/elements


Ignore:
Timestamp:
Jul 2, 2006, 6:25:54 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: RADAR RENDERS

Location:
trunk/src/world_entities/elements
Files:
2 edited

Legend:

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

    r8994 r8996  
    1919#include "world_entity.h"
    2020
     21#include "debug.h"
     22
    2123namespace OrxGui
    2224{
     
    2527   */
    2628  GLGuiRadar::GLGuiRadar ()
    27   {}
     29  {
     30    this->init();
     31  }
    2832
    2933
     
    7882    _timePassed+=dt;
    7983
    80     if (_timePassed > _updateInterval)
     84    //if (_timePassed > _updateInterval)
    8185    {
    82       _timePassed-=_updateInterval;
     86      _timePassed = 0 ; //-=_updateInterval;
    8387      this->updateRadar();
    8488    }
     
    104108        if (_centerNode->distance(*it) < this->_range)
    105109        {
    106           this->_dotLists[i].positions.push_back(Vector2D(50, 50) + Vector2D(_centerNode->getAbsCoor().x - (*it)->getAbsCoor().x, _centerNode->getAbsCoor().y - (*it)->getAbsCoor().y)/_range * 50);
     110          this->_dotLists[i].positions.push_back(Vector2D(50, 50) + Vector2D(_centerNode->getAbsCoor().x - (*it)->getAbsCoor().x, _centerNode->getAbsCoor().y - (*it)->getAbsCoor().y)* (50.0 /_range));
    107111        }
    108112
     
    118122    GLGuiWidget::draw();
    119123
     124    glPointSize(2.0f);
    120125    for (unsigned int i = 0; i < this->_dotLists.size(); ++i)
    121126    {
     
    124129      {
    125130        glBegin(GL_POINTS);
    126 
    127         glVertex2f(this->_dotLists[i].positions[i].x, this->_dotLists[i].positions[i].y);
    128 
     131        glVertex2f(this->_dotLists[i].positions[j].x, this->_dotLists[i].positions[j].y);
    129132        glEnd();
    130133      }
  • trunk/src/world_entities/elements/glgui_radar.h

    r8993 r8996  
    4242    void updateRadar();
    4343
    44     void tick(float dt);
     44    virtual void tick(float dt);
    4545    void draw() const;
    4646
Note: See TracChangeset for help on using the changeset viewer.