- Timestamp:
- Dec 2, 2009, 2:40:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/graphics/Camera.cc
r6191 r6195 114 114 { 115 115 // 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(); 117 118 // Only clamp if fps rate is actually falling. Occasional high dts should 118 119 // not be clamped to reducing lagging effects. 119 if ( coeff > 1.0f)120 if (poscoeff > 1.0f) 120 121 { 121 122 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; 123 134 else 124 135 this->lastDtLagged_ = true; … … 128 139 129 140 Vector3 offset = this->getWorldPosition() - this->cameraNode_->_getDerivedPosition(); 130 this->cameraNode_->translate( coeff * offset);141 this->cameraNode_->translate(poscoeff * offset); 131 142 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)); 133 144 } 134 145
Note: See TracChangeset
for help on using the changeset viewer.