Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2009, 2:40:22 PM (14 years ago)
Author:
wirthmi
Message:

More camera easing, new center overlay and pauseControl/resumeControl

File:
1 edited

Legend:

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

    r6173 r6195  
    5757        : HumanController(creator)
    5858        , crossHairOverlay_(NULL)
     59        , centerOverlay_(NULL)
    5960    {
    6061        RegisterObject(NewHumanController);
     
    7273            crossHairOverlay_->setBackgroundMaterial("Orxonox/Crosshair3");
    7374            crossHairOverlay_->setSize(Vector2(overlaySize_, overlaySize_));
    74             crossHairOverlay_->show();
     75            crossHairOverlay_->hide();
     76
     77            centerOverlay_ = new OrxonoxOverlay(this);
     78            centerOverlay_->setBackgroundMaterial("Orxonox/CenterOverlay");
     79            centerOverlay_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
     80            centerOverlay_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
     81            centerOverlay_->hide();
    7582        }
    7683
     
    8188
    8289        NewHumanController::localController_s = this;
     90
     91//HumanController::localController_s->getControllableEntity()->getCamera()->setDrag(true);
    8392    }
    8493
     
    99108            {
    100109                this->updateTarget();
    101                 this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5-overlaySize_/2));
    102                 this->crossHairOverlay_->show();
    103             }
    104             else
     110                if ( !controlPaused_ ) {
     111                    this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5-overlaySize_/2));
     112                    this->crossHairOverlay_->show();
     113                    this->centerOverlay_->show();
     114                }
     115            }
     116            else {
    105117                this->crossHairOverlay_->hide();
    106             // TODO: update aimPosition of Pawn
     118                this->centerOverlay_->hide();
     119            }
    107120
    108121            if ( this->acceleration_ > 0 )
     
    229242                }
    230243
    231                 itr->movable->getParentSceneNode()->showBoundingBox(true);
     244                //itr->movable->getParentSceneNode()->showBoundingBox(true);
    232245                //std::cout << itr->movable->getParentSceneNode()->_getDerivedPosition() << endl;
    233246                //return mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance; //or itr->movable->getParentSceneNode()->_getDerivedPosition()
     
    308321        }
    309322    }
     323
     324    void NewHumanController::doResumeControl() {
     325        this->controlPaused_ = false;
     326        this->crossHairOverlay_->show();
     327        this->centerOverlay_->show();
     328    }
     329
     330    void NewHumanController::doPauseControl() {
     331        this->controlPaused_ = true;
     332        this->crossHairOverlay_->hide();
     333        this->centerOverlay_->hide();
     334    }
    310335}
Note: See TracChangeset for help on using the changeset viewer.