From 49b869c5e31c7d0b45ff51eaa54af28850cd26bf Mon Sep 17 00:00:00 2001 From: amantley Date: Mon, 15 Oct 2018 18:02:50 -0700 Subject: [PATCH] got rid of velocity count, now use 'away' to trigger when to start computing the sit stand state --- interface/src/avatar/MyAvatar.cpp | 15 +-------------- interface/src/avatar/MyAvatar.h | 1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index c809a2d614..66e8570743 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -542,7 +542,7 @@ void MyAvatar::update(float deltaTime) { // put update sit stand state counts here if (!getIsSitStandStateLocked()) { if (!getIsAway()) { - if ((_follow._velocityCount > VELOCITY_COUNT_THRESHOLD) || (qApp->isHMDMode() && (qApp->getActiveDisplayPlugin()->getName() == "Oculus Rift"))) { + if (qApp->isHMDMode()) { if (getIsInSittingState()) { if (newHeightReading.getTranslation().y > (STANDING_HEIGHT_MULTIPLE * _tippingPoint)) { // if we recenter upwards then no longer in sitting state @@ -602,7 +602,6 @@ void MyAvatar::update(float deltaTime) { // if you are away then reset the average and set state to standing. _squatCount = 0; _sitStandStateCount = 0; - _follow._velocityCount = 0; _averageUserHeightCount = 1; _sumUserHeightSensorSpace = DEFAULT_AVATAR_HEIGHT; _tippingPoint = DEFAULT_AVATAR_HEIGHT; @@ -4244,18 +4243,6 @@ void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat } } } - const int VELOCITY_COUNT_THRESHOLD = 60; - const float MINIMUM_HMD_VELOCITY = 0.1f; - if (_velocityCount > VELOCITY_COUNT_THRESHOLD) { - if (!isActive(Vertical) && (shouldActivateVertical(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) { - activate(Vertical); - } - } else { - if ((glm::length(myAvatar.getControllerPoseInSensorFrame(controller::Action::HEAD).getVelocity()) > MINIMUM_HMD_VELOCITY)) { - _velocityCount++; - qCDebug(interfaceapp) << "velocity count is " << _velocityCount << " is away " << myAvatar.getIsAway() << " hmd mode "<< qApp->isHMDMode() << " " << qApp->getActiveDisplayPlugin()->getName(); - } - } } else { if (!isActive(Rotation) && getForceActivateRotation()) { activate(Rotation); diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 61eed672ef..e8d9090e03 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -1760,7 +1760,6 @@ private: std::atomic _forceActivateVertical { false }; std::atomic _forceActivateHorizontal { false }; std::atomic _toggleHipsFollowing { true }; - int _velocityCount { 0 }; }; FollowHelper _follow;