Changeset 8223 for code/branches/steering/src/orxonox/worldentities/pawns
- Timestamp:
- Apr 10, 2011, 11:09:36 AM (14 years ago)
- Location:
- code/branches/steering/src/orxonox/worldentities/pawns
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/steering/src/orxonox/worldentities/pawns/SpaceShip.cc
r7860 r8223 53 53 this->localAngularAcceleration_.setValue(0, 0, 0); 54 54 this->bBoost_ = false; 55 this->bPermanentBoost_ = false;56 55 this->steering_ = Vector3::ZERO; 57 56 this->engine_ = 0; … … 103 102 registerVariable(this->auxilaryThrust_, VariableDirection::ToClient); 104 103 registerVariable(this->rotationThrust_, VariableDirection::ToClient); 104 registerVariable(this->boostPower_, VariableDirection::ToClient); 105 registerVariable(this->boostPowerRate_, VariableDirection::ToClient); 106 registerVariable(this->boostRate_, VariableDirection::ToClient); 107 registerVariable(this->boostCooldownDuration_, VariableDirection::ToClient); 105 108 } 106 109 … … 207 210 } 208 211 209 // TODO: something seems to call this function every tick, could probably handled a little more efficiently! 210 void SpaceShip::setBoost(bool bBoost) 211 { 212 if(bBoost == this->bBoost_) 213 return; 214 215 if(bBoost) 216 this->boost(); 217 else 218 { 212 void SpaceShip::fire() 213 { 214 } 215 216 /** 217 @brief 218 Starts or stops boosting. 219 @param bBoost 220 Whether to start or stop boosting. 221 */ 222 void SpaceShip::boost(bool bBoost) 223 { 224 if(bBoost && !this->bBoostCooldown_) 225 this->bBoost_ = true; 226 if(!bBoost) 219 227 this->bBoost_ = false; 220 }221 }222 223 void SpaceShip::fire()224 {225 }226 227 void SpaceShip::boost()228 {229 if(!this->bBoostCooldown_)230 this->bBoost_ = true;231 228 } 232 229 -
code/branches/steering/src/orxonox/worldentities/pawns/SpaceShip.h
r7801 r8223 59 59 60 60 virtual void fire(); 61 virtual void boost( );61 virtual void boost(bool bBoost); // Starts or stops boosting. 62 62 63 63 void setEngine(Engine* engine); … … 70 70 { return this->steering_; } 71 71 72 void setBoost(bool bBoost);73 72 inline bool getBoost() const 74 73 { return this->bBoost_; } … … 79 78 { return this->enginetemplate_; } 80 79 81 inline void setPermanentBoost(bool bPermanent)82 { this->bPermanentBoost_ = bPermanent; }83 inline bool getPermanentBoost() const84 { return this->bPermanentBoost_; }85 86 80 protected: 87 81 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const; … … 90 84 bool bBoost_; 91 85 bool bBoostCooldown_; 92 bool bPermanentBoost_;93 86 float boostPower_; 94 87 float initialBoostPower_;
Note: See TracChangeset
for help on using the changeset viewer.