Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2008, 3:39:48 PM (17 years ago)
Author:
landauf
Message:
  • AI ships are now displayed with a point with its teamcolour on the radar.
  • It's now possible to assign an arbitrary colour (and even a texture) to a RadarObject. But be aware the system has to create a new material for every colour (not for every object), so please use deterministic colours to reduce the amount of used materials to a bearable number.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/hud/HUD.cc

    r1505 r1562  
    124124        SceneNode* node;
    125125        node = sm->getRootSceneNode()->createChildSceneNode("tomato1", Vector3(2000.0, 0.0, 0.0));
     126        addRadarObject(node, ColourValue(0.5, 0, 0, 1));
     127        node = sm->getRootSceneNode()->createChildSceneNode("tomato2", Vector3(0.0, 2000.0, 0.0));
     128        addRadarObject(node, ColourValue(0.5, 0, 0, 1));
     129        node = sm->getRootSceneNode()->createChildSceneNode("tomato3", Vector3(0.0, 0.0, 2000.0));
     130        addRadarObject(node, ColourValue(0.5, 0, 0, 1));
     131        node = sm->getRootSceneNode()->createChildSceneNode("station", Vector3(10000.0,16000.0,0.0));
    126132        addRadarObject(node);
    127         node = sm->getRootSceneNode()->createChildSceneNode("tomato2", Vector3(0.0, 2000.0, 0.0));
    128         addRadarObject(node);
    129         node = sm->getRootSceneNode()->createChildSceneNode("tomato3", Vector3(0.0, 0.0, 2000.0));
    130         addRadarObject(node);
    131         node = sm->getRootSceneNode()->createChildSceneNode("station", Vector3(10000.0,16000.0,0.0));
    132         addRadarObject(node, 3);
    133133    }
    134134
     
    178178    }
    179179
    180     void HUD::addRadarObject(SceneNode* node, int colour){
     180    void HUD::addRadarObject(SceneNode* node, const ColourValue& colour){
    181181        RadarObject* obj = new RadarObject(container, node, colour);
    182182        roSet.insert(obj);
     
    193193
    194194    void HUD::removeRadarObject(Ogre::SceneNode* node){
    195       COUT(3) << "blabla" << std::endl;
    196         for(std::set<RadarObject*>::iterator it=roSet.begin(); it!=roSet.end(); it++){
    197             if((*it)->getNode() == node) {
     195        for(std::set<RadarObject*>::iterator it=roSet.begin(); it!=roSet.end(); ++it){
     196            if ((*it)->getNode() == node)
     197            {
     198                if (this->nav->focus_ == (*it))
     199                {
     200                    this->nav->cycleFocus();
     201                    if (this->nav->focus_ == (*it))
     202                        this->nav->focus_ = 0;
     203                }
    198204                delete (*it);
    199205                roSet.erase(it);
     206                return;
    200207            }
    201208        }
Note: See TracChangeset for help on using the changeset viewer.