From e4c0aeb9a0018159bc9b2ff30a6e7e2d78db4af6 Mon Sep 17 00:00:00 2001 From: Jeffrey Ventrella Date: Tue, 28 May 2013 18:15:29 -0700 Subject: [PATCH] added AVATAR_FACING_THRESHOLD to avatarTouch --- interface/src/Application.cpp | 2 +- interface/src/AvatarTouch.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 17a533c102..a8e62a68e7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -937,7 +937,7 @@ void Application::idle() { } } } - + // Update audio stats for procedural sounds #ifndef _WIN32 _audio.setLastAcceleration(_myAvatar.getThrust()); diff --git a/interface/src/AvatarTouch.cpp b/interface/src/AvatarTouch.cpp index c598cc9a03..16c8cc64c7 100644 --- a/interface/src/AvatarTouch.cpp +++ b/interface/src/AvatarTouch.cpp @@ -13,6 +13,7 @@ const float THREAD_RADIUS = 0.007; const float HANDS_CLOSE_ENOUGH_TO_GRASP = 0.2; +const float AVATAR_FACING_THRESHOLD = 0.1f; // (-1 to 1) (larger value indicates narrower angle of influence AvatarTouch::AvatarTouch() { @@ -43,8 +44,8 @@ void AvatarTouch::simulate (float deltaTime) { bool facingEachOther = false; - if (( glm::dot(_myOrientation.getFront(), _yourOrientation.getFront()) < -0.1f) - && ( glm::dot(_myOrientation.getFront(), directionBetweenBodies ) > 0.1f)) { + if (( glm::dot(_myOrientation.getFront(), _yourOrientation.getFront()) < -AVATAR_FACING_THRESHOLD) + && ( glm::dot(_myOrientation.getFront(), directionBetweenBodies ) > AVATAR_FACING_THRESHOLD)) { facingEachOther = true; }