Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2009, 12:11:25 PM (15 years ago)
Author:
scheusso
Message:

mouselook now also working when steering a rocket

File:
1 edited

Legend:

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

    r6107 r6115  
    6363            this->model_ = new Model(this);
    6464            this->model_->setMeshSource("rocket.mesh");
    65                         this->attach(this->model_);
    66                         ParticleSpawner* fire = new ParticleSpawner(this);
    67                         this->attach(fire);
    68                         fire->setOrientation(this->getOrientation());
     65            this->attach(this->model_);
     66            ParticleSpawner* fire = new ParticleSpawner(this);
     67            this->attach(fire);
     68            fire->setOrientation(this->getOrientation());
    6969            fire->setSource("Orxonox/rocketfire");
    7070       
     
    7979
    8080            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&Rocket::destroyObject, this)));
    81                
    82                        
    8381        }
    8482       
     
    8684        this->camPosition_->setPosition(0,10,40);
    8785        this->camPosition_->setSyncMode(0x0);
     86        this->camPosition_->setAllowMouseLook(true);
    8887        this->attach( this->camPosition_ );
    8988        this->addCameraPosition( this->camPosition_ );
     
    9897        if(this->isInitialized())
    9998        {
    100            
    10199            if (GameMode::isMaster() && this->player_.get())
    102100            {
     
    229227    void Rocket::rotateYaw(const Vector2& value)
    230228    {
    231         this->localAngularVelocity_.y += value.x;
     229        ControllableEntity::rotateYaw(value);
     230       
     231        if( !this->isInMouseLook() )
     232            this->localAngularVelocity_.y += value.x;
    232233    }
    233234
     
    240241    void Rocket::rotatePitch(const Vector2& value)
    241242    {
    242         this->localAngularVelocity_.x += value.x;
     243        ControllableEntity::rotatePitch(value);
     244       
     245        if( !this->isInMouseLook() )
     246            this->localAngularVelocity_.x += value.x;
    243247    }
    244248
     
    251255    void Rocket::rotateRoll(const Vector2& value)
    252256    {
    253         this->localAngularVelocity_.z += value.x;
     257        ControllableEntity::rotateRoll(value);
     258       
     259        if( !this->isInMouseLook() )
     260            this->localAngularVelocity_.z += value.x;
    254261    }
    255262   
Note: See TracChangeset for help on using the changeset viewer.