Changeset 1465 for code/branches/network/src/orxonox
- Timestamp:
- May 28, 2008, 11:12:18 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/objects/Camera.cc
r1409 r1465 76 76 void Camera::tick(float dt) 77 77 { 78 if(this->positionNode_ != NULL) { 78 if (this->positionNode_ != NULL) 79 { 79 80 // 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; 82 85 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)); 84 89 } 85 90 }
Note: See TracChangeset
for help on using the changeset viewer.