From f5d66bbf2eb5fb541cfe46ca895102ce1e392b1b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 24 Nov 2015 09:42:12 +1300 Subject: [PATCH 1/2] Fix avatar rotation rate depending on FPS --- interface/src/Application.cpp | 2 +- interface/src/avatar/Avatar.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ff3cba182c..e85ed9f51a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2841,7 +2841,7 @@ void Application::update(float deltaTime) { const float EXPECTED_FRAME_RATE = 60.0f; float timeFactor = EXPECTED_FRAME_RATE * deltaTime; myAvatar->setDriveKeys(PITCH, -1.0f * userInputMapper->getActionState(controller::Action::PITCH) / timeFactor); - myAvatar->setDriveKeys(YAW, -1.0f * userInputMapper->getActionState(controller::Action::YAW) / timeFactor); + myAvatar->setDriveKeys(YAW, -1.0f * userInputMapper->getActionState(controller::Action::YAW)); myAvatar->setDriveKeys(STEP_YAW, -1.0f * userInputMapper->getActionState(controller::Action::STEP_YAW)); } } diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 44b5d91015..dd317fcacd 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -173,7 +173,7 @@ protected: QVector _attachmentModels; QVector _attachmentsToRemove; QVector _unusedAttachments; - float _bodyYawDelta; + float _bodyYawDelta; // degrees/sec // These position histories and derivatives are in the world-frame. // The derivatives are the MEASURED results of all external and internal forces From d73e3a5490ca8f10cd80a1e40549e4b1221f224e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 24 Nov 2015 09:48:37 +1300 Subject: [PATCH 2/2] Fix avatar pitch rate depending on FPS --- interface/src/Application.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e85ed9f51a..9acd2b82c6 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2834,13 +2834,7 @@ void Application::update(float deltaTime) { myAvatar->setDriveKeys(TRANSLATE_Y, userInputMapper->getActionState(controller::Action::TRANSLATE_Y)); myAvatar->setDriveKeys(TRANSLATE_X, userInputMapper->getActionState(controller::Action::TRANSLATE_X)); if (deltaTime > FLT_EPSILON) { - // For rotations what we really want are meausures of "angles per second" (in order to prevent - // fps-dependent spin rates) so we need to scale the units of the controller contribution. - // (TODO?: maybe we should similarly scale ALL action state info, or change the expected behavior - // controllers to provide a delta_per_second value rather than a raw delta.) - const float EXPECTED_FRAME_RATE = 60.0f; - float timeFactor = EXPECTED_FRAME_RATE * deltaTime; - myAvatar->setDriveKeys(PITCH, -1.0f * userInputMapper->getActionState(controller::Action::PITCH) / timeFactor); + myAvatar->setDriveKeys(PITCH, -1.0f * userInputMapper->getActionState(controller::Action::PITCH)); myAvatar->setDriveKeys(YAW, -1.0f * userInputMapper->getActionState(controller::Action::YAW)); myAvatar->setDriveKeys(STEP_YAW, -1.0f * userInputMapper->getActionState(controller::Action::STEP_YAW)); }