Changeset 11083 for code/trunk/src/orxonox/worldentities
- Timestamp:
- Jan 21, 2016, 1:59:04 PM (9 years ago)
- Location:
- code/trunk/src/orxonox/worldentities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/worldentities/StaticEntity.cc
r11071 r11083 54 54 void StaticEntity::registerVariables() 55 55 { 56 registerVariable(this->getPosition(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged)); 57 registerVariable(this->getOrientation(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged)); 56 // Ugly const casts, but are valid because position and orientation are not actually const 57 registerVariable(const_cast<Vector3&>(this->getPosition()), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged)); 58 registerVariable(const_cast<Quaternion&>(this->getOrientation()), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged)); 58 59 } 59 60 -
code/trunk/src/orxonox/worldentities/WorldEntity.cc
r11071 r11083 190 190 registerVariable(this->bVisible_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility)); 191 191 192 registerVariable(this->getScale3D(), VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged)); 192 // Ugly const cast, but is valid because the scale is not actually const 193 registerVariable(const_cast<Vector3&>(this->getScale3D()), VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged)); 193 194 194 195 // Physics stuff -
code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h
r11071 r11083 46 46 virtual ~FpsPlayer(); 47 47 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;49 virtual void tick(float dt) ;48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 49 virtual void tick(float dt) override; 50 50 void registerVariables(); 51 51 void setConfigValues(); 52 52 53 virtual void moveFrontBack(const Vector2& value) ;54 virtual void moveRightLeft(const Vector2& value) ;55 virtual void moveUpDown(const Vector2& value) ;53 virtual void moveFrontBack(const Vector2& value) override; 54 virtual void moveRightLeft(const Vector2& value) override; 55 virtual void moveUpDown(const Vector2& value) override; 56 56 57 virtual void rotateYaw(const Vector2& value) ;58 virtual void rotatePitch(const Vector2& value) ;59 virtual void rotateRoll(const Vector2& value) ;57 virtual void rotateYaw(const Vector2& value) override; 58 virtual void rotatePitch(const Vector2& value) override; 59 virtual void rotateRoll(const Vector2& value) override; 60 60 61 61 … … 65 65 { return this->meshSrc_; } 66 66 67 void boost(bool bBoost) ; //acctually jump67 void boost(bool bBoost) override; //actually jump 68 68 69 69 virtual void fire(); … … 71 71 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 72 72 73 virtual void addedWeaponPack(WeaponPack* wPack) ;73 virtual void addedWeaponPack(WeaponPack* wPack) override; 74 74 75 75 protected: 76 virtual void setPlayer(PlayerInfo* player) ;77 virtual void startLocalHumanControl() ;76 virtual void setPlayer(PlayerInfo* player) override; 77 virtual void startLocalHumanControl() override; 78 78 bool bInvertYAxis_; 79 79 … … 89 89 90 90 private: 91 virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const ;91 virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const override; 92 92 float speed_; 93 93 -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
r11071 r11083 235 235 236 236 // This function call adds a lift to the ship when it is rotating to make it's movement more "realistic" and enhance the feeling. 237 if (this->getLocalVelocity().z < 0 && abs(this->getLocalVelocity().z) < stallSpeed_)238 this->moveRightLeft(-lift_ / 5.0f * value * sqrt( abs(this->getLocalVelocity().z)));237 if (this->getLocalVelocity().z < 0 && std::abs(this->getLocalVelocity().z) < stallSpeed_) 238 this->moveRightLeft(-lift_ / 5.0f * value * sqrt(std::abs(this->getLocalVelocity().z))); 239 239 } 240 240 … … 257 257 258 258 // This function call adds a lift to the ship when it is pitching to make it's movement more "realistic" and enhance the feeling. 259 if (this->getLocalVelocity().z < 0 && abs(this->getLocalVelocity().z) < stallSpeed_)260 this->moveUpDown(lift_ / 5.0f * pitch * sqrt( abs(this->getLocalVelocity().z)));259 if (this->getLocalVelocity().z < 0 && std::abs(this->getLocalVelocity().z) < stallSpeed_) 260 this->moveUpDown(lift_ / 5.0f * pitch * sqrt(std::abs(this->getLocalVelocity().z))); 261 261 } 262 262 … … 505 505 this->shakeDt_ += dt; 506 506 507 float frequency = this->shakeFrequency_ * (square( abs(this->getLocalVelocity().z)));507 float frequency = this->shakeFrequency_ * (square(std::abs(this->getLocalVelocity().z))); 508 508 509 509 if (this->shakeDt_ >= 1.0f/frequency)
Note: See TracChangeset
for help on using the changeset viewer.