Changeset 6607 for code/branches/ppspickups1/src/orxonox/items
- Timestamp:
- Mar 22, 2010, 10:45:09 PM (15 years ago)
- Location:
- code/branches/ppspickups1/src/orxonox/items
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ppspickups1/src/orxonox/items/Engine.cc
r6540 r6607 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/branches/ppspickups1/src/orxonox/items/Engine.h
r6417 r6607 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 /* not in protected ?? */ 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_;
Note: See TracChangeset
for help on using the changeset viewer.