From 3330b2023221c075ebd3a90f8381e302ee768185 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 30 May 2013 10:33:45 -0700 Subject: [PATCH] More reformatting. --- interface/src/Camera.cpp | 6 ++--- interface/src/Camera.h | 55 ++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/interface/src/Camera.cpp b/interface/src/Camera.cpp index 0850006086..21e60c0cc5 100644 --- a/interface/src/Camera.cpp +++ b/interface/src/Camera.cpp @@ -90,10 +90,10 @@ void Camera::updateFollowMode(float deltaTime) { // update rotation (before position!) if (_needsToInitialize || OculusManager::isConnected()) { - _rotation = _idealRotation; + _rotation = _targetRotation; } else { // pull rotation towards ideal - _rotation = safeMix(_rotation, _idealRotation, t); + _rotation = safeMix(_rotation, _targetRotation, t); } _idealPosition = _targetPosition + _rotation * glm::vec3(0.0f, _upShift, _distance); @@ -145,7 +145,7 @@ void Camera::setMode(CameraMode m) { void Camera::setTargetRotation( const glm::quat& targetRotation ) { - _idealRotation = targetRotation; + _targetRotation = targetRotation; } void Camera::setFieldOfView(float f) { diff --git a/interface/src/Camera.h b/interface/src/Camera.h index f1eb764aab..4d56774326 100644 --- a/interface/src/Camera.h +++ b/interface/src/Camera.h @@ -30,35 +30,36 @@ public: void update( float deltaTime ); - void setUpShift ( float u ) { _upShift = u; } - void setDistance ( float d ) { _distance = d; } - void setTargetPosition( glm::vec3 t ) { _targetPosition = t; } - void setPosition ( glm::vec3 p ) { _position = p; } - void setTightness ( float t ) { _tightness = t; } + void setUpShift ( float u ) { _upShift = u; } + void setDistance ( float d ) { _distance = d; } + void setTargetPosition( const glm::vec3& t ) { _targetPosition = t; } + void setPosition ( const glm::vec3& p ) { _position = p; } + void setTightness ( float t ) { _tightness = t; } void setTargetRotation( const glm::quat& rotation ); - void setMode ( CameraMode m ); - void setModeShiftRate ( float r ); - void setFieldOfView ( float f ); - void setAspectRatio ( float a ); - void setNearClip ( float n ); - void setFarClip ( float f ); - void setEyeOffsetPosition ( const glm::vec3& p); - void setEyeOffsetOrientation ( const glm::quat& o); + void setMode ( CameraMode m ); + void setModeShiftRate ( float r ); + void setFieldOfView ( float f ); + void setAspectRatio ( float a ); + void setNearClip ( float n ); + void setFarClip ( float f ); + void setEyeOffsetPosition ( const glm::vec3& p ); + void setEyeOffsetOrientation( const glm::quat& o ); - glm::vec3 getTargetPosition () { return _targetPosition; } - glm::vec3 getPosition () { return _position; } - glm::quat getTargetRotation () { return _idealRotation; } - glm::quat getRotation () { return _rotation; } - CameraMode getMode () { return _mode; } - float getFieldOfView() { return _fieldOfView; } - float getAspectRatio() { return _aspectRatio; } - float getNearClip () { return _nearClip; } - float getFarClip () { return _farClip; } - glm::vec3 getEyeOffsetPosition () { return _eyeOffsetPosition; } - glm::quat getEyeOffsetOrientation () { return _eyeOffsetOrientation; } - bool getFrustumNeedsReshape(); // call to find out if the view frustum needs to be reshaped - void setFrustumWasReshaped(); // call this after reshaping the view frustum. + const glm::vec3& getTargetPosition () { return _targetPosition; } + const glm::vec3& getPosition () { return _position; } + const glm::quat& getTargetRotation () { return _targetRotation; } + const glm::quat& getRotation () { return _rotation; } + CameraMode getMode () { return _mode; } + float getFieldOfView () { return _fieldOfView; } + float getAspectRatio () { return _aspectRatio; } + float getNearClip () { return _nearClip; } + float getFarClip () { return _farClip; } + const glm::vec3& getEyeOffsetPosition () { return _eyeOffsetPosition; } + const glm::quat& getEyeOffsetOrientation () { return _eyeOffsetOrientation; } + + bool getFrustumNeedsReshape(); // call to find out if the view frustum needs to be reshaped + void setFrustumWasReshaped(); // call this after reshaping the view frustum. private: @@ -75,7 +76,7 @@ private: glm::vec3 _eyeOffsetPosition; glm::quat _eyeOffsetOrientation; glm::quat _rotation; - glm::quat _idealRotation; + glm::quat _targetRotation; float _upShift; float _distance; float _tightness;