Changeset 2256 for code/branches/objecthierarchy2/src/orxonox/objects/items
- Timestamp:
- Nov 25, 2008, 1:14:19 AM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/orxonox/objects/items
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/items/Engine.cc
r2254 r2256 64 64 Engine::~Engine() 65 65 { 66 if (this->isInitialized() && this->ship_) 67 this->ship_->setEngine(0); 66 68 } 67 69 … … 111 113 Synchronisable* object = Synchronisable::getSynchronisable(this->shipID_); 112 114 if (object) 113 this-> ship_ = dynamic_cast<SpaceShip*>(object);115 this->addToSpaceShip(dynamic_cast<SpaceShip*>(object)); 114 116 } 115 117 } … … 182 184 this->ship_ = ship; 183 185 if (ship) 186 { 184 187 this->shipID_ = ship->getObjectID(); 188 if (ship->getEngine() != this) 189 ship->setEngine(this); 190 } 185 191 } 186 192 -
code/branches/objecthierarchy2/src/orxonox/objects/items/Engine.h
r2254 r2256 72 72 { this->maxSpeedUpDown_ = speed; } 73 73 74 inline float getMaxSpeedFront() const 75 { return this->maxSpeedFront_; } 76 inline float getMaxSpeedBack() const 77 { return this->maxSpeedBack_; } 78 inline float getMaxSpeedLeftRight() const 79 { return this->maxSpeedLeftRight_; } 80 inline float getMaxSpeedUpDown() const 81 { return this->maxSpeedUpDown_; } 82 74 83 inline void setAccelerationFront(float acceleration) 75 84 { this->accelerationFront_ = acceleration; } … … 82 91 inline void setAccelerationUpDown(float acceleration) 83 92 { this->accelerationUpDown_ = acceleration; } 93 94 inline float getAccelerationFront() const 95 { return this->accelerationFront_; } 96 inline float getAccelerationBrake() const 97 { return this->accelerationBrake_; } 98 inline float getAccelerationBack() const 99 { return this->accelerationBack_; } 100 inline float getAccelerationLeftRight() const 101 { return this->accelerationLeftRight_; } 102 inline float getAccelerationUpDown() const 103 { return this->accelerationUpDown_; } 84 104 85 105 virtual const Vector3& getDirection() const;
Note: See TracChangeset
for help on using the changeset viewer.