Changeset 1450 for code/branches/network/src/orxonox/hud/Navigation.cc
- Timestamp:
- May 28, 2008, 2:08:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/hud/Navigation.cc
r1444 r1450 96 96 97 97 if(navCam_ == NULL) navCam_ = SpaceShip::getLocalShip()->getCamera()->cam_; 98 Vector3 pos = focus_-> pos_;98 Vector3 pos = focus_->getPosition(); 99 99 // transform to screen coordinates 100 100 pos = navCam_->getProjectionMatrix()*navCam_->getViewMatrix()*pos; … … 107 107 // is object in view? 108 108 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; 111 111 bool outOfView = (xPosRel<0 || xPosRel>1 || yPosRel<0 || yPosRel>1); 112 112 // if object is behind us, it is out of view anyway: … … 206 206 } 207 207 else{ 208 focus_-> panel_->setMaterialName("Orxonox/RedDot");208 focus_->resetColour(); 209 209 if(focus_ != NULL) focus_ = focus_->next; 210 210 } … … 217 217 navMarker_->show(); 218 218 navText_->show(); 219 focus_-> panel_->setMaterialName("Orxonox/WhiteDot");219 focus_->setColour(RadarObject::WHITE); 220 220 } 221 221 } … … 223 223 float Navigation::getDist2Focus(){ 224 224 if(focus_ == NULL) return(0.0); 225 return((focus_-> pos_-SpaceShip::getLocalShip()->getPosition()).length());225 return((focus_->getPosition()-SpaceShip::getLocalShip()->getPosition()).length()); 226 226 } 227 227 }
Note: See TracChangeset
for help on using the changeset viewer.