Changeset 6170 for code/branches/presentation2/src/orxonox
- Timestamp:
- Nov 26, 2009, 11:29:20 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/graphics/Camera.cc
r6158 r6170 69 69 this->bDrag_ = false; 70 70 this->nearClipDistance_ = 1; 71 this->lastDtLagged_ = false; 71 72 72 73 this->setSyncMode(0x0); … … 111 112 if (this->bDrag_) 112 113 { 113 dt = dt / this->getTimeFactor();114 114 // this stuff here may need some adjustments 115 float coeff = std::min(1.0f, 15.0f * dt); 115 float coeff = 15.0f * dt / this->getTimeFactor(); 116 // Only clamp if fps rate is actually falling. Occasional high dts should 117 // not be clamped to reducing lagging effects. 118 if (coeff > 1.0f) 119 { 120 if (this->lastDtLagged_) 121 coeff = 1.0f; 122 else 123 this->lastDtLagged_ = true; 124 } 125 else 126 this->lastDtLagged_ = false; 116 127 117 128 Vector3 offset = this->getWorldPosition() - this->cameraNode_->_getDerivedPosition(); … … 119 130 120 131 this->cameraNode_->setOrientation(Quaternion::Slerp(coeff, this->cameraNode_->_getDerivedOrientation(), this->getWorldOrientation(), true)); 121 //this->cameraNode_->setOrientation(this->getWorldOrientation());122 132 } 123 133 } -
code/branches/presentation2/src/orxonox/graphics/Camera.h
r6158 r6170 73 73 bool bHasFocus_; 74 74 bool bDrag_; 75 bool lastDtLagged_; 75 76 }; 76 77 }
Note: See TracChangeset
for help on using the changeset viewer.