Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 28, 2008, 2:08:03 PM (17 years ago)
Author:
FelixSchulthess
Message:

making radar objects from scene nodes now. radar object supporting multiple colors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/hud/Navigation.cc

    r1444 r1450  
    9696
    9797        if(navCam_ == NULL) navCam_ = SpaceShip::getLocalShip()->getCamera()->cam_;
    98         Vector3 pos = focus_->pos_;
     98        Vector3 pos = focus_->getPosition();
    9999        // transform to screen coordinates
    100100        pos = navCam_->getProjectionMatrix()*navCam_->getViewMatrix()*pos;
     
    107107        // is object in view?
    108108        float radius = RadarOverlayElement::calcRadius(navCamPos_, currentDir_, currentOrth_, focus_);
    109         bool isRight = (currentDir_.crossProduct(currentOrth_)).dotProduct(focus_->pos_ - navCamPos_)>0;
    110         bool isAbove = currentOrth_.dotProduct(focus_->pos_ - navCamPos_)>0;
     109        bool isRight = (currentDir_.crossProduct(currentOrth_)).dotProduct(focus_->getPosition() - navCamPos_)>0;
     110        bool isAbove = currentOrth_.dotProduct(focus_->getPosition() - navCamPos_)>0;
    111111        bool outOfView = (xPosRel<0 || xPosRel>1 || yPosRel<0 || yPosRel>1);
    112112        // if object is behind us, it is out of view anyway:
     
    206206        }
    207207        else{
    208             focus_->panel_->setMaterialName("Orxonox/RedDot");
     208            focus_->resetColour();
    209209            if(focus_ != NULL) focus_ = focus_->next;
    210210        }
     
    217217            navMarker_->show();
    218218            navText_->show();
    219             focus_->panel_->setMaterialName("Orxonox/WhiteDot");
     219            focus_->setColour(RadarObject::WHITE);
    220220        }
    221221    }
     
    223223    float Navigation::getDist2Focus(){
    224224        if(focus_ == NULL) return(0.0);
    225         return((focus_->pos_-SpaceShip::getLocalShip()->getPosition()).length());
     225        return((focus_->getPosition()-SpaceShip::getLocalShip()->getPosition()).length());
    226226    }
    227227}
Note: See TracChangeset for help on using the changeset viewer.