Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2008, 6:16:48 PM (16 years ago)
Author:
landauf
Message:

fixed mouselook in SpaceShip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/objects/worldentities/pawns/SpaceShip.cc

    r2485 r2487  
    120120        if (this->hasLocalController())
    121121        {
     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
    122131            if (!this->isInMouseLook())
    123132            {
    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);
    132136            }
    133 
    134             this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
    135             this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
    136             this->localAngularAcceleration_.setValue(0, 0, 0);
    137137        }
    138138    }
Note: See TracChangeset for help on using the changeset viewer.