Changeset 2487 for code/branches/presentation
- Timestamp:
- Dec 16, 2008, 6:16:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
r2485 r2487 120 120 if (this->hasLocalController()) 121 121 { 122 this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_); 123 this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_); 124 if (this->localLinearAcceleration_.z() > 0) 125 this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_); 126 else 127 this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_); 128 this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_); 129 this->localLinearAcceleration_.setValue(0, 0, 0); 130 122 131 if (!this->isInMouseLook()) 123 132 { 124 this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_); 125 this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_); 126 if (this->localLinearAcceleration_.z() > 0) 127 this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_); 128 else 129 this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_); 130 this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_); 131 this->localLinearAcceleration_.setValue(0, 0, 0); 133 this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_; 134 this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_); 135 this->localAngularAcceleration_.setValue(0, 0, 0); 132 136 } 133 134 this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;135 this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);136 this->localAngularAcceleration_.setValue(0, 0, 0);137 137 } 138 138 }
Note: See TracChangeset
for help on using the changeset viewer.