Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6115


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

mouselook now also working when steering a rocket

Location:
code/branches/presentation2/src
Files:
3 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   
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc

    r6114 r6115  
    235235            NewHumanController::localController_s->controlMode_ = 0;
    236236    }
     237   
     238    void NewHumanController::changedControllableEntity()
     239    {
     240        this->controlMode_ = 0;
     241        this->currentYaw_ = 0;
     242        this->currentPitch_ = 0;
     243    }
    237244}
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.h

    r6111 r6115  
    5151
    5252            static void changeMode();
     53           
     54            virtual void changedControllableEntity();
    5355
    5456        protected:
     
    5658           
    5759            unsigned int                controlMode_;
    58             static NewHumanController* localController_s;
     60            static NewHumanController*  localController_s;
    5961        private:
    6062            float                       currentYaw_;
    6163            float                       currentPitch_;
    6264            OrxonoxOverlay*             crossHairOverlay_;
    63             float                                   overlaySize_;
     65            float                       overlaySize_;
    6466            ClassTreeMask               targetMask_;
    6567    };
Note: See TracChangeset for help on using the changeset viewer.