Changeset 8891 for code/trunk/src/orxonox/worldentities
- Timestamp:
- Oct 12, 2011, 7:50:43 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
r8858 r8891 67 67 this->camera_ = 0; 68 68 this->xmlcontroller_ = 0; 69 this->controller_ = 0;69 //this->controller_ = 0; 70 70 this->reverseCamera_ = 0; 71 71 this->bDestroyWhenPlayerLeft_ = false; … … 74 74 this->bMouseLook_ = false; 75 75 this->mouseLookSpeed_ = 200; 76 this->bIsRocket_ = false; 76 77 77 78 this->server_position_ = Vector3::ZERO; … … 189 190 return counter; 190 191 } 191 192 192 193 bool ControllableEntity::setCameraPosition(unsigned int index) 193 194 { … … 309 310 } 310 311 312 void ControllableEntity::setController(Controller* val) 313 { 314 this->controller_ = val; 315 } 316 311 317 void ControllableEntity::setTarget( WorldEntity* target ) 312 318 { -
code/trunk/src/orxonox/worldentities/ControllableEntity.h
r8706 r8891 99 99 */ 100 100 virtual void boost(bool bBoost) {} 101 101 102 102 virtual void greet() {} 103 103 virtual void switchCamera(); … … 155 155 156 156 inline Controller* getController() const 157 { return this->controller_ ; }158 inline void setController(Controller* val)159 { this->controller_ = val; } 157 { return this->controller_.get(); } 158 void setController(Controller* val); 159 160 160 161 161 virtual void setTarget( WorldEntity* target ); … … 163 163 { return this->target_.get(); } 164 164 void setTargetInternal( uint32_t targetID ); 165 inline bool getRocket() const 166 { return this-> bIsRocket_; } 165 167 166 168 protected: … … 181 183 182 184 Ogre::SceneNode* cameraPositionRootNode_; 185 bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket. 183 186 184 187 private: … … 234 237 std::string cameraPositionTemplate_; 235 238 Controller* xmlcontroller_; 236 Controller*controller_;239 WeakPtr<Controller> controller_; 237 240 CameraPosition* reverseCamera_; 238 241 WeakPtr<WorldEntity> target_; -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r8855 r8891 93 93 94 94 this->isHumanShip_ = this->hasLocalController(); 95 95 96 96 this->setSyncMode(ObjectDirection::Bidirectional); // needed to synchronise e.g. aimposition 97 97 } … … 450 450 this->isHumanShip_ = true; 451 451 } 452 453 void Pawn::changedActivity(void) 454 { 455 SUPER(Pawn, changedActivity); 456 457 this->setRadarVisibility(this->isActive()); 458 } 459 460 void Pawn::changedVisibility(void) 461 { 462 SUPER(Pawn, changedVisibility); 463 //this->setVisible(this->isVisible()); 464 this->setRadarVisibility(this->isVisible()); 465 } 466 452 467 } -
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
r8855 r8891 170 170 virtual const Vector3& getCarrierPosition(void) const 171 171 { return this->getWorldPosition(); }; 172 virtual void changedActivity(void); //!< To enable radarviewability when the activity is changed 173 virtual void changedVisibility(void); //!< To enable proper radarviewability when the visibility is changed 172 174 173 175 protected: … … 195 197 float maxHealth_; 196 198 float initialHealth_; 197 199 198 200 float shieldHealth_; 199 201 float maxShieldHealth_; -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
r8858 r8891 298 298 } 299 299 300 /**301 @brief302 Add an Engine to the SpaceShip.303 @param engine304 A pointer to the Engine to be added.305 */306 300 void SpaceShip::addEngine(orxonox::Engine* engine) 307 301 { … … 504 498 void SpaceShip::resetCamera() 505 499 { 506 Camera *camera = this->getCamera(); 507 if (camera == 0) 508 { 509 orxout(internal_warning) << "Failed to reset camera!" << endl; 510 return; 511 } 512 513 this->shakeDt_ = 0.0f; 514 camera->setPosition(this->cameraOriginalPosition_); 515 camera->setOrientation(this->cameraOriginalOrientation_); 500 if(this->hasLocalController() && this->hasHumanController()) 501 { 502 Camera *camera = this->getCamera(); 503 if (camera == 0) 504 { 505 orxout(internal_warning) << "Failed to reset camera!" << endl; 506 return; 507 } 508 this->shakeDt_ = 0.0f; 509 camera->setPosition(this->cameraOriginalPosition_); 510 camera->setOrientation(this->cameraOriginalOrientation_); 511 } 516 512 } 517 513
Note: See TracChangeset
for help on using the changeset viewer.