From 340882a3308f2e79d6e1609055ec092f79ab1efc Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Tue, 21 May 2013 10:22:05 -0700 Subject: [PATCH] Changed 1P view to turn off head rendering when close/inside head rather than showing disembodied neck --- interface/src/Application.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d4ab79b09c..3cf26ef2e5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -316,6 +316,10 @@ void Application::paintGL() { 0.0f, //-_myAvatar.getAbsoluteHeadPitch(), 0.0f); + // Take a look at whether we are inside head, don't render it if so. + const float HEAD_RENDER_DISTANCE = 0.5; + glm::vec3 distanceToHead(_myCamera.getPosition() - _myAvatar.getSpringyHeadPosition()); + if (glm::length(distanceToHead) < HEAD_RENDER_DISTANCE) { _myAvatar.setDisplayingHead(false); } } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { _myCamera.setTargetPosition(_myAvatar.getHeadPosition()); @@ -1052,7 +1056,7 @@ void Application::setRenderFirstPerson(bool firstPerson) { a.distance = 0.0f; a.tightness = 100.0f; _myCamera.setMode(CAMERA_MODE_FIRST_PERSON, a); - _myAvatar.setDisplayingHead(false); + _myAvatar.setDisplayingHead(true); } else { Camera::CameraFollowingAttributes a;