Changeset 2485 for code/branches/presentation/src/orxonox/objects/Radar.cc
- Timestamp:
- Dec 16, 2008, 6:01:13 PM (15 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
-
code/branches/presentation/src/orxonox/objects/Radar.cc
r2087 r2485 99 99 void Radar::tick(float dt) 100 100 { 101 SUPER(Radar, tick, dt); 102 101 103 if (this->focus_ != *(this->itFocus_)) 102 104 { … … 112 114 for (ObjectList<RadarViewable>::iterator itElement = ObjectList<RadarViewable>::begin(); itElement; ++itElement) 113 115 { 114 /* 115 if ((*itElement) != SpaceShip::getLocalShip() && (*itListener)->getRadarSensitivity() > (*itElement)->getRadarObjectCamouflage()) 116 if ((*itListener)->getRadarSensitivity() > (*itElement)->getRadarObjectCamouflage()) 116 117 (*itListener)->displayObject(*itElement, *itElement == this->focus_); 117 */118 118 } 119 119 } … … 128 128 this->focus_ = 0; 129 129 } 130 else 131 { 132 Vector3 localPosition;// = SpaceShip::getLocalShip()->getPosition(); 130 /* 131 else if (this->owner_) 132 { 133 Vector3 localPosition = this->owner_->getPosition(); 133 134 Vector3 targetPosition = localPosition; 134 135 if (*(this->itFocus_)) 135 targetPosition = this->itFocus_->get WorldPosition();136 targetPosition = this->itFocus_->getRVWorldPosition(); 136 137 137 138 // find the closed object further away than targetPosition … … 143 144 for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it) 144 145 { 145 /* 146 if (*it == SpaceShip::getLocalShip()) 146 if (*it == (RadarViewable*)this->owner_) 147 147 continue; 148 */ 149 float targetDistance = localPosition.squaredDistance((*it)->get WorldPosition());148 149 float targetDistance = localPosition.squaredDistance((*it)->getRVWorldPosition()); 150 150 if (targetDistance > currentDistance && targetDistance < nextDistance) 151 151 { … … 171 171 } 172 172 } 173 */ 173 174 } 174 175 … … 186 187 for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it, ++i) 187 188 { 188 COUT(3) << i++ << ": " << (*it)->get WorldPosition() << std::endl;189 COUT(3) << i++ << ": " << (*it)->getRVWorldPosition() << std::endl; 189 190 } 190 191 }
Note: See TracChangeset
for help on using the changeset viewer.