Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6080 for code


Ignore:
Timestamp:
Nov 17, 2009, 11:54:32 AM (15 years ago)
Author:
scheusso
Message:

some improvements in steering, but not yet good

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/particles2/src/modules/weapons/projectiles/Rocket.cc

    r6079 r6080  
    111111           
    112112        this->originalControllableEntity_ = this->owner_->getPlayer()->getControllableEntity();
     113        this->originalControllableEntity_->setDestroyWhenPlayerLeft( false );
    113114        this->owner_->getPlayer()->startControl(this);
    114115    }
     
    125126       
    126127        this->setAngularVelocity(this->localAngularVelocity_);
     128        this->setVelocity( (this->getOrientation()*WorldEntity::FRONT)*100 );
     129        this->localAngularVelocity_ = 0;
     130//         this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
     131//         this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
     132//         if (this->localLinearAcceleration_.z() > 0)
     133//             this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
     134//         else
     135//             this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
     136//         this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
     137//         this->localLinearAcceleration_.setValue(0, 0, 0);
     138//     
     139//         this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
     140//         this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
    127141    }
    128142   
     
    181195    void Rocket::rotateYaw(const Vector2& value)
    182196    {
    183         this->localAngularVelocity_.y = value.x;
     197        this->localAngularVelocity_.x = value.x;
    184198    }
    185199
     
    192206    void Rocket::rotatePitch(const Vector2& value)
    193207    {
    194         this->localAngularVelocity_.x = value.x;
     208        this->localAngularVelocity_.y = value.x;
    195209    }
    196210
Note: See TracChangeset for help on using the changeset viewer.