Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 28, 2008, 11:12:18 PM (16 years ago)
Author:
rgrieder
Message:
  • fixed bug with shaking camera
  • made part of camera adjustments more fps independent
  • fixed a bug in KeyBinder
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/objects/Camera.cc

    r1409 r1465  
    7676  void Camera::tick(float dt)
    7777  {
    78     if(this->positionNode_ != NULL) {
     78    if (this->positionNode_ != NULL)
     79    {
    7980      // this stuff here may need some adjustments
    80       Vector3 offset = this->positionNode_->getWorldPosition() - this->cameraNode_->getPosition();
    81       this->cameraNode_->translate(15*dt*offset);
     81      Vector3 offset = this->positionNode_->getWorldPosition() - this->cameraNode_->getWorldPosition();
     82      float coeff = 15.0f * dt;
     83      if (coeff > 1.0f)
     84        coeff = 1.0f;
    8285
    83       this->cameraNode_->setOrientation(Quaternion::Slerp(0.7, this->positionNode_->getWorldOrientation(), this->cameraNode_->getWorldOrientation(), false));
     86      this->cameraNode_->translate(coeff * offset);
     87
     88      this->cameraNode_->setOrientation(Quaternion::Slerp(7.0f * dt, this->positionNode_->getWorldOrientation(), this->cameraNode_->getWorldOrientation(), false));
    8489    }
    8590  }
Note: See TracChangeset for help on using the changeset viewer.