- Timestamp:
- Dec 14, 2008, 3:53:05 AM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/orxonox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/Radar.cc
r2361 r2438 134 134 Vector3 targetPosition = localPosition; 135 135 if (*(this->itFocus_)) 136 targetPosition = this->itFocus_->get WorldPosition();136 targetPosition = this->itFocus_->getRVWorldPosition(); 137 137 138 138 // find the closed object further away than targetPosition … … 147 147 continue; 148 148 149 float targetDistance = localPosition.squaredDistance((*it)->get WorldPosition());149 float targetDistance = localPosition.squaredDistance((*it)->getRVWorldPosition()); 150 150 if (targetDistance > currentDistance && targetDistance < nextDistance) 151 151 { … … 187 187 for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it, ++i) 188 188 { 189 COUT(3) << i++ << ": " << (*it)->get WorldPosition() << std::endl;189 COUT(3) << i++ << ": " << (*it)->getRVWorldPosition() << std::endl; 190 190 } 191 191 } -
code/branches/objecthierarchy2/src/orxonox/objects/RadarViewable.cc
r2256 r2438 61 61 } 62 62 63 const Vector3& RadarViewable::get WorldPosition() const63 const Vector3& RadarViewable::getRVWorldPosition() const 64 64 { 65 65 const WorldEntity* object = this->getWorldEntity(); … … 68 68 } 69 69 70 Vector3 RadarViewable::get OrientedVelocity() const70 Vector3 RadarViewable::getRVOrientedVelocity() const 71 71 { 72 72 const WorldEntity* object = this->getWorldEntity(); -
code/branches/objecthierarchy2/src/orxonox/objects/RadarViewable.h
r2256 r2438 72 72 virtual const WorldEntity* getWorldEntity() const = 0; 73 73 74 const Vector3& get WorldPosition() const;75 Vector3 get OrientedVelocity() const;74 const Vector3& getRVWorldPosition() const; 75 Vector3 getRVOrientedVelocity() const; 76 76 77 77 inline void setRadarObjectShape(Shape shape) -
code/branches/objecthierarchy2/src/orxonox/objects/gametypes/Gametype.cc
r2428 r2438 38 38 #include "objects/worldentities/pawns/Spectator.h" 39 39 #include "objects/worldentities/SpawnPoint.h" 40 #include "objects/worldentities/Camera.h" 40 41 41 42 #include "network/Host.h" … … 62 63 { 63 64 SetConfigValue(initialStartCountdown_, 3.0f); 65 SetConfigValue(bAutoStart_, false); 66 SetConfigValue(bForceSpawn_, false); 64 67 } 65 68 … … 146 149 void Gametype::pawnKilled(Pawn* victim, Pawn* killer) 147 150 { 151 if (victim) 152 { 153 std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(victim->getPlayer()); 154 it->second = PlayerState::Dead; 155 156 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator()); 157 if (victim->getCamera()) 158 { 159 entity->setPosition(victim->getCamera()->getWorldPosition()); 160 entity->setOrientation(victim->getCamera()->getWorldOrientation()); 161 } 162 else 163 { 164 entity->setPosition(victim->getWorldPosition()); 165 entity->setOrientation(victim->getWorldOrientation()); 166 } 167 it->first->startControl(entity); 168 } 148 169 } 149 170 -
code/branches/objecthierarchy2/src/orxonox/objects/infos/PlayerInfo.cc
r2428 r2438 115 115 } 116 116 117 void PlayerInfo::startControl(ControllableEntity* entity )117 void PlayerInfo::startControl(ControllableEntity* entity, bool callback) 118 118 { 119 119 if (entity == this->controllableEntity_) … … 121 121 122 122 if (this->controllableEntity_) 123 this->stopControl(this->controllableEntity_ );123 this->stopControl(this->controllableEntity_, callback); 124 124 125 125 this->controllableEntity_ = entity; -
code/branches/objecthierarchy2/src/orxonox/objects/infos/PlayerInfo.h
r2428 r2438 65 65 { return this->bReadyToSpawn_; } 66 66 67 void startControl(ControllableEntity* entity );67 void startControl(ControllableEntity* entity, bool callback = true); 68 68 void stopControl(ControllableEntity* entity, bool callback = true); 69 69 -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/ControllableEntity.cc
r2428 r2438 81 81 if (this->isInitialized()) 82 82 { 83 if (this->bHasLocalController_ )83 if (this->bHasLocalController_ && this->bHasHumanController_) 84 84 this->stopLocalHumanControl(); 85 85 … … 250 250 void ControllableEntity::stopLocalHumanControl() 251 251 { 252 this->camera_->detachFromParent(); 253 delete this->camera_; 254 this->camera_ = 0; 255 256 delete this->hud_; 257 this->hud_ = 0; 252 if (this->camera_) 253 { 254 this->camera_->detachFromParent(); 255 delete this->camera_; 256 this->camera_ = 0; 257 } 258 259 if (this->hud_) 260 { 261 delete this->hud_; 262 this->hud_ = 0; 263 } 258 264 } 259 265 -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2422 r2438 160 160 this->bAlive_ = false; 161 161 162 this->setDestroyWhenPlayerLeft(false); 163 162 164 if (this->getGametype()) 163 165 this->getGametype()->pawnKilled(this, this->lastHitOriginator_); 164 165 this->setDestroyWhenPlayerLeft(false);166 166 167 167 if (this->getPlayer()) -
code/branches/objecthierarchy2/src/orxonox/overlays/hud/HUDNavigation.cc
r2361 r2438 151 151 */ 152 152 // transform to screen coordinates 153 Vector3 pos = /*transformationMatrix * */Radar::getInstance().getFocus()->get WorldPosition();153 Vector3 pos = /*transformationMatrix * */Radar::getInstance().getFocus()->getRVWorldPosition(); 154 154 155 155 bool outOfView; … … 225 225 /* 226 226 Vector3 aimpos = transformationMatrix * getPredictedPosition(SpaceShip::getLocalShip()->getPosition(), 227 Projectile::getSpeed(), Radar::getInstance().getFocus()->get WorldPosition(), Radar::getInstance().getFocus()->getOrientedVelocity());227 Projectile::getSpeed(), Radar::getInstance().getFocus()->getRVWorldPosition(), Radar::getInstance().getFocus()->getRVOrientedVelocity()); 228 228 */ 229 229 if (wasOutOfView_) … … 252 252 /* 253 253 if (Radar::getInstance().getFocus()) 254 return (Radar::getInstance().getFocus()->get WorldPosition() - SpaceShip::getLocalShip()->getPosition()).length();254 return (Radar::getInstance().getFocus()->getRVWorldPosition() - SpaceShip::getLocalShip()->getPosition()).length(); 255 255 else 256 256 */
Note: See TracChangeset
for help on using the changeset viewer.