From 083e9076a96ff7e3f8276a24144ddf6a3b2803b3 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 8 Apr 2014 15:17:05 -0700 Subject: [PATCH] Missed a spot. --- interface/src/Application.cpp | 3 ++- interface/src/Camera.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 87cdaf8038..a30ed648d8 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -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)); diff --git a/interface/src/Camera.h b/interface/src/Camera.h index 9973fd246e..3fd0efd50a 100644 --- a/interface/src/Camera.h +++ b/interface/src/Camera.h @@ -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; }