Missed a spot.

This commit is contained in:
Andrzej Kapolka 2014-04-08 15:17:05 -07:00
parent faf8c35358
commit 083e9076a9
2 changed files with 3 additions and 1 deletions

View file

@ -534,7 +534,8 @@ void Application::paintGL() {
glm::vec3 relativePosition = glm::inverse(_myCamera.getTargetRotation()) *
(eyePosition - _myCamera.getTargetPosition());
const float PUSHBACK_RADIUS = 0.01f;
float pushback = relativePosition.z + _myCamera.getNearClip() + _myAvatar->getScale() * PUSHBACK_RADIUS;
float pushback = relativePosition.z + _myCamera.getNearClip() +
_myAvatar->getScale() * PUSHBACK_RADIUS - _myCamera.getDistance();
if (pushback > 0.0f) {
_myCamera.setTargetPosition(_myCamera.getTargetPosition() +
_myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, pushback));

View file

@ -54,6 +54,7 @@ public:
const glm::quat& getRotation() const { return _rotation; }
CameraMode getMode() const { return _mode; }
float getModeShiftPeriod() const { return _modeShiftPeriod; }
float getDistance() const { return _distance; }
const glm::vec3& getTargetPosition() const { return _targetPosition; }
const glm::quat& getTargetRotation() const { return _targetRotation; }
float getFieldOfView() const { return _fieldOfView; }