- Timestamp:
- May 28, 2008, 2:08:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/hud/RadarOverlayElement.cc
r1410 r1450 89 89 90 90 // set size to fit distance... 91 float d = (ro-> pos_-shipPos_).length();91 float d = (ro->getPosition()-shipPos_).length(); 92 92 if(d<4000) ro->panel_->setDimensions(4,4); 93 93 else if(d<8000) ro->panel_->setDimensions(3,3); … … 113 113 // iterate through all Radar Objects 114 114 while(ro != NULL) { 115 COUT(3) << i++ << ": " << ro-> pos_<< std::endl;115 COUT(3) << i++ << ": " << ro->getPosition() << std::endl; 116 116 ro = ro->next; 117 117 } … … 119 119 120 120 float RadarOverlayElement::calcRadius(Vector3 pos, Vector3 dir, Vector3 orth, RadarObject* obj){ 121 return(acos((dir.dotProduct(obj-> pos_- pos))/122 ((obj-> pos_- pos).length()*dir.length())));121 return(acos((dir.dotProduct(obj->getPosition() - pos))/ 122 ((obj->getPosition() - pos).length()*dir.length()))); 123 123 } 124 124 125 125 float RadarOverlayElement::calcPhi(Vector3 pos, Vector3 dir, Vector3 orth, RadarObject* obj){ 126 126 // project difference vector on our plane... 127 Vector3 proj = Plane(dir, pos).projectVector(obj-> pos_- pos);127 Vector3 proj = Plane(dir, pos).projectVector(obj->getPosition() - pos); 128 128 // ...and find out the angle 129 129 return(acos((orth.dotProduct(proj))/ … … 132 132 133 133 bool RadarOverlayElement::calcRight(Vector3 pos, Vector3 dir, Vector3 orth, RadarObject* obj){ 134 if((dir.crossProduct(orth)).dotProduct(obj-> pos_- pos) > 0)134 if((dir.crossProduct(orth)).dotProduct(obj->getPosition() - pos) > 0) 135 135 return true; 136 136 else return false;
Note: See TracChangeset
for help on using the changeset viewer.