More reformatting.

This commit is contained in:
Andrzej Kapolka 2013-05-30 10:33:45 -07:00
parent fff9d1c372
commit 3330b20232
2 changed files with 31 additions and 30 deletions

View file

@ -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) {

View file

@ -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;