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/graphics/Camera.cc

    r6191 r6195  
    114114        {
    115115            // this stuff here may need some adjustments
    116             float coeff = 15.0f * dt / this->getTimeFactor();
     116            float poscoeff = 15.0f * dt / this->getTimeFactor();
     117            float anglecoeff = 7.0f * dt / this->getTimeFactor();
    117118            // Only clamp if fps rate is actually falling. Occasional high dts should
    118119            // not be clamped to reducing lagging effects.
    119             if (coeff > 1.0f)
     120            if (poscoeff > 1.0f)
    120121            {
    121122                if (this->lastDtLagged_)
    122                     coeff = 1.0f;
     123                    poscoeff = 1.0f;
     124                else
     125                    this->lastDtLagged_ = true;
     126            }
     127            else
     128                this->lastDtLagged_ = false;
     129
     130            if (anglecoeff > 1.0f)
     131            {
     132                if (this->lastDtLagged_)
     133                    anglecoeff = 1.0f;
    123134                else
    124135                    this->lastDtLagged_ = true;
     
    128139
    129140            Vector3 offset = this->getWorldPosition() - this->cameraNode_->_getDerivedPosition();
    130             this->cameraNode_->translate(coeff * offset);
     141            this->cameraNode_->translate(poscoeff * offset);
    131142
    132             this->cameraNode_->setOrientation(Quaternion::Slerp(coeff, this->cameraNode_->_getDerivedOrientation(), this->getWorldOrientation(), true));
     143            this->cameraNode_->setOrientation(Quaternion::Slerp(anglecoeff, this->cameraNode_->_getDerivedOrientation(), this->getWorldOrientation(), true));
    133144        }
    134145
Note: See TracChangeset for help on using the changeset viewer.