Changeset 6709 for code/trunk/src/orxonox/items
- Timestamp:
- Apr 13, 2010, 9:32:08 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/ppspickups1 (added) merged: 6552,6574-6575,6579,6607,6643,6645-6648,6681,6694,6703,6705-6706
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/items/Engine.cc
r6540 r6709 64 64 this->boostBlur_ = 0; 65 65 66 this->speedAdd_ = 0.0; 67 this->speedMultiply_ = 1.0; 68 66 69 this->setConfigValues(); 67 70 this->registerVariables(); … … 119 122 registerVariable(this->accelerationLeftRight_, VariableDirection::ToClient); 120 123 registerVariable(this->accelerationUpDown_, VariableDirection::ToClient); 124 125 registerVariable(this->speedAdd_, VariableDirection::ToClient); 126 registerVariable(this->speedMultiply_, VariableDirection::ToClient); 121 127 } 122 128 … … 192 198 } 193 199 194 this->ship_->setAcceleration(this->ship_->getOrientation() * acceleration);200 this->ship_->setAcceleration(this->ship_->getOrientation() * (acceleration*this->getSpeedMultiply()+Vector3(0,0,-this->getSpeedAdd()))); 195 201 196 202 if (!this->ship_->getPermanentBoost()) … … 241 247 return Vector3::ZERO; 242 248 } 249 250 PickupCarrier* Engine::getCarrierParent(void) 251 { 252 return this->ship_; 253 } 254 255 const Vector3& Engine::getCarrierPosition(void) 256 { 257 return this->ship_->getWorldPosition(); 258 } 243 259 } -
code/trunk/src/orxonox/items/Engine.h
r6417 r6709 35 35 #include "Item.h" 36 36 37 #include "interfaces/PickupCarrier.h" 38 37 39 namespace orxonox 38 40 { 39 class _OrxonoxExport Engine : public Item, public Tickable 41 class _OrxonoxExport Engine : public Item, public Tickable, public PickupCarrier 40 42 { 41 43 public: … … 104 106 { return this->accelerationUpDown_; } 105 107 108 inline float getSpeedAdd(void) 109 { return this->speedAdd_; } 110 inline float getSpeedMultiply(void) 111 { return this->speedMultiply_; } 112 106 113 virtual const Vector3& getDirection() const; 114 115 virtual const Vector3& getCarrierPosition(void); 116 117 //TODO: Move to protected or private. How? 118 inline void setSpeedAdd(float speedAdd) 119 { this->speedAdd_=speedAdd; } 120 inline void setSpeedMultiply(float speedMultiply) 121 { this->speedMultiply_=speedMultiply; } 122 123 protected: 124 virtual std::list<PickupCarrier*>* getCarrierChildren(void) 125 { return new std::list<PickupCarrier*>(); } 126 virtual PickupCarrier* getCarrierParent(void); 107 127 108 128 private: … … 114 134 float boostFactor_; 115 135 float speedFactor_; 136 137 float speedAdd_; 138 float speedMultiply_; 116 139 117 140 float maxSpeedFront_; -
code/trunk/src/orxonox/items/MultiStateEngine.cc
r6417 r6709 129 129 else 130 130 this->state_ = Idle; 131 132 if (this->state_ == Idle && this->getSpeedAdd() > 0) 133 this->state_ = Normal; 131 134 } 132 135
Note: See TracChangeset
for help on using the changeset viewer.