From 2de6d3eb6a0b1a6119e7e237fee1f2edc45550a2 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 3 Jul 2013 22:55:01 -0700 Subject: [PATCH 1/4] Make 'Go Home' an option from the options because it conflicts with 'G' for gravity on/off --- interface/src/Application.cpp | 3 ++- interface/src/Head.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 56469938ff..e6433d845a 100755 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1472,7 +1472,8 @@ void Application::initMenu() { (_testPing = optionsMenu->addAction("Test Ping"))->setCheckable(true); _testPing->setChecked(true); (_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true); - optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true); + optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true); + optionsMenu->addAction("Go Home", this, SLOT(goHome())); QMenu* renderMenu = menuBar->addMenu("Render"); (_renderVoxels = renderMenu->addAction("Voxels"))->setCheckable(true); diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index 75c62ce87e..66f2123e2b 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -228,6 +228,9 @@ void Head::simulate(float deltaTime, bool isMine) { const float CAMERA_STOP_TOLERANCE_DEGREES = 0.25f; const float CAMERA_START_TOLERANCE_DEGREES = 15.0f; float cameraHeadAngleDifference = glm::length(glm::vec2(_pitch - _cameraPitch, _yaw - _cameraYaw)); + //if (cameraHeadAngleDifference > 0.1f) { + // printLog("angleDiff = %0.2f\n", cameraHeadAngleDifference); + //} if (_isCameraMoving) { _cameraFollowHeadRate = glm::clamp(_cameraFollowHeadRate * CAMERA_FOLLOW_HEAD_RATE_RAMP_RATE, 0.f, From 0f312d4c9b432f2b3b249aac1e85650d2ae0399c Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 3 Jul 2013 23:17:43 -0700 Subject: [PATCH 2/4] Tuned smooth gyro look values to feel better. --- interface/src/Head.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index 429b78cd2e..9812d80acf 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -223,11 +223,11 @@ void Head::simulate(float deltaTime, bool isMine) { if (isMine && _cameraFollowsHead) { // If we are using gyros and using gyroLook, have the camera follow head but with a null region // to create stable rendering view with small head movements. - const float CAMERA_FOLLOW_HEAD_RATE_START = 0.05f; - const float CAMERA_FOLLOW_HEAD_RATE_MAX = 0.25f; - const float CAMERA_FOLLOW_HEAD_RATE_RAMP_RATE = 1.5f; - const float CAMERA_STOP_TOLERANCE_DEGREES = 0.25f; - const float CAMERA_START_TOLERANCE_DEGREES = 15.0f; + const float CAMERA_FOLLOW_HEAD_RATE_START = 0.01f; + const float CAMERA_FOLLOW_HEAD_RATE_MAX = 0.5f; + const float CAMERA_FOLLOW_HEAD_RATE_RAMP_RATE = 1.05f; + const float CAMERA_STOP_TOLERANCE_DEGREES = 0.1f; + const float CAMERA_START_TOLERANCE_DEGREES = 2.0f; float cameraHeadAngleDifference = glm::length(glm::vec2(_pitch - _cameraPitch, _yaw - _cameraYaw)); //if (cameraHeadAngleDifference > 0.1f) { // printLog("angleDiff = %0.2f\n", cameraHeadAngleDifference); From 5df09b293248d7c85d9cdb7353a64f0f7de10093 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 3 Jul 2013 23:20:55 -0700 Subject: [PATCH 3/4] remove debugging printf --- interface/src/Head.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index 9812d80acf..6bf6c65341 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -229,9 +229,6 @@ void Head::simulate(float deltaTime, bool isMine) { const float CAMERA_STOP_TOLERANCE_DEGREES = 0.1f; const float CAMERA_START_TOLERANCE_DEGREES = 2.0f; float cameraHeadAngleDifference = glm::length(glm::vec2(_pitch - _cameraPitch, _yaw - _cameraYaw)); - //if (cameraHeadAngleDifference > 0.1f) { - // printLog("angleDiff = %0.2f\n", cameraHeadAngleDifference); - //} if (_isCameraMoving) { _cameraFollowHeadRate = glm::clamp(_cameraFollowHeadRate * CAMERA_FOLLOW_HEAD_RATE_RAMP_RATE, 0.f, From d70eb3854221af3f9a232557154009811a72baa2 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 3 Jul 2013 23:43:53 -0700 Subject: [PATCH 4/4] Properly make the goHome() function in slot group --- interface/src/Application.cpp | 1 + interface/src/Application.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f0ec794ada..a8e96bfbd7 100755 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2791,6 +2791,7 @@ void Application::eyedropperVoxelUnderCursor() { } void Application::goHome() { + printLog("Going Home!\n"); _myAvatar.setPosition(START_LOCATION); } diff --git a/interface/src/Application.h b/interface/src/Application.h index 41ed32ad68..01f85812d6 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -150,6 +150,8 @@ private slots: void copyVoxels(); void pasteVoxels(); void runTests(); + void goHome(); + private: static void broadcastToNodes(unsigned char* data, size_t bytes, const char type); @@ -181,7 +183,6 @@ private: void maybeEditVoxelUnderCursor(); void deleteVoxelUnderCursor(); void eyedropperVoxelUnderCursor(); - void goHome(); void resetSensors(); void setMenuShortcutsEnabled(bool enabled);