Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 26, 2009, 9:58:16 AM (15 years ago)
Author:
scheusso
Message:

fix in NewHumanController which caused the spaceship to shoot always to the origin of universe if in mouslook mode (and if the spaceship hasn't shot before)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc

    r6149 r6157  
    9898            if( this->controllableEntity_ && !this->controllableEntity_->isInMouseLook() )
    9999            {
     100                this->updateTarget();
    100101                this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5-overlaySize_/2));
    101102                this->crossHairOverlay_->show();
     
    145146*/
    146147
    147         if (firemode == 1 && this->controlMode_ == 1) {
     148        if (firemode == 1 && this->controlMode_ == 1)
     149        {
    148150            //unlocked steering, steer on right mouse click
    149151            HumanController::yaw(Vector2(this->currentYaw_, 0));
    150152            HumanController::pitch(Vector2(this->currentPitch_, 0));
    151153        }
    152         else {
    153             if( !NewHumanController::localController_s->getControllableEntity()->isInMouseLook() )
    154                 this->updateTarget();
    155 
     154        else
    156155            HumanController::localController_s->getControllableEntity()->fire(firemode);
    157         }
    158156
    159157    }
     
    285283    void NewHumanController::accelerate()
    286284    {
    287         if ( NewHumanController::localController_s ) {
     285        if ( NewHumanController::localController_s )
     286        {
    288287            NewHumanController::localController_s->acceleration_ += 0.08;
    289288            NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ + 0.08f, 0.0f, 1.0f);
     
    293292    void NewHumanController::decelerate()
    294293    {
    295         if ( NewHumanController::localController_s ) {
     294        if ( NewHumanController::localController_s )
     295        {
    296296            NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ - 0.05f, 0.0f, 1.0f);
    297297        }
Note: See TracChangeset for help on using the changeset viewer.