Changeset 6273 for code/branches/presentation2/src/orxonox
- Timestamp:
- Dec 8, 2009, 11:48:52 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/Radar.cc
r5929 r6273 40 40 #include "core/ObjectList.h" 41 41 #include "interfaces/RadarListener.h" 42 #include "controllers/HumanController.h" 43 #include "worldentities/pawns/Pawn.h" 42 44 43 45 namespace orxonox … … 46 48 Radar::Radar() 47 49 : focus_(0) 50 , itFocus_(0) 48 51 , objectTypeCounter_(0) 49 52 { … … 118 121 void Radar::cycleFocus() 119 122 { 120 if (ObjectList<RadarViewable>::begin() == 0)123 if (ObjectList<RadarViewable>::begin() == ObjectList<RadarViewable>::end()) 121 124 { 122 125 // list is empty … … 124 127 this->focus_ = 0; 125 128 } 126 /* 127 else if ( this->owner_)129 130 else if (HumanController::getLocalControllerEntityAsPawn()) 128 131 { 129 Vector3 localPosition = this->owner_->getPosition();132 Vector3 localPosition = HumanController::getLocalControllerEntityAsPawn()->getWorldPosition(); 130 133 Vector3 targetPosition = localPosition; 131 if ( *(this->itFocus_))134 if (this->itFocus_ && *(this->itFocus_)) 132 135 targetPosition = this->itFocus_->getRVWorldPosition(); 133 136 134 // find the close dobject further away than targetPosition137 // find the closest object further away than targetPosition 135 138 float currentDistance = localPosition.squaredDistance(targetPosition); 136 139 float nextDistance = FLT_MAX; … … 140 143 for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it) 141 144 { 142 if (*it == static_cast<RadarViewable*>( this)->owner_)145 if (*it == static_cast<RadarViewable*>(HumanController::getLocalControllerEntityAsPawn())) 143 146 continue; 144 147 … … 167 170 } 168 171 } 169 */170 172 } 171 173
Note: See TracChangeset
for help on using the changeset viewer.