mirror of
https://github.com/lubosz/overte.git
synced 2025-04-15 19:47:38 +02:00
Missed a spot.
This commit is contained in:
parent
faf8c35358
commit
083e9076a9
2 changed files with 3 additions and 1 deletions
|
@ -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));
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue