mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:57:30 +02:00
got rid of velocity count, now use 'away' to trigger when to start computing the sit stand state
This commit is contained in:
parent
9ec999e15e
commit
49b869c5e3
2 changed files with 1 additions and 15 deletions
|
@ -542,7 +542,7 @@ void MyAvatar::update(float deltaTime) {
|
||||||
// put update sit stand state counts here
|
// put update sit stand state counts here
|
||||||
if (!getIsSitStandStateLocked()) {
|
if (!getIsSitStandStateLocked()) {
|
||||||
if (!getIsAway()) {
|
if (!getIsAway()) {
|
||||||
if ((_follow._velocityCount > VELOCITY_COUNT_THRESHOLD) || (qApp->isHMDMode() && (qApp->getActiveDisplayPlugin()->getName() == "Oculus Rift"))) {
|
if (qApp->isHMDMode()) {
|
||||||
if (getIsInSittingState()) {
|
if (getIsInSittingState()) {
|
||||||
if (newHeightReading.getTranslation().y > (STANDING_HEIGHT_MULTIPLE * _tippingPoint)) {
|
if (newHeightReading.getTranslation().y > (STANDING_HEIGHT_MULTIPLE * _tippingPoint)) {
|
||||||
// if we recenter upwards then no longer in sitting state
|
// 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.
|
// if you are away then reset the average and set state to standing.
|
||||||
_squatCount = 0;
|
_squatCount = 0;
|
||||||
_sitStandStateCount = 0;
|
_sitStandStateCount = 0;
|
||||||
_follow._velocityCount = 0;
|
|
||||||
_averageUserHeightCount = 1;
|
_averageUserHeightCount = 1;
|
||||||
_sumUserHeightSensorSpace = DEFAULT_AVATAR_HEIGHT;
|
_sumUserHeightSensorSpace = DEFAULT_AVATAR_HEIGHT;
|
||||||
_tippingPoint = 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 {
|
} else {
|
||||||
if (!isActive(Rotation) && getForceActivateRotation()) {
|
if (!isActive(Rotation) && getForceActivateRotation()) {
|
||||||
activate(Rotation);
|
activate(Rotation);
|
||||||
|
|
|
@ -1760,7 +1760,6 @@ private:
|
||||||
std::atomic<bool> _forceActivateVertical { false };
|
std::atomic<bool> _forceActivateVertical { false };
|
||||||
std::atomic<bool> _forceActivateHorizontal { false };
|
std::atomic<bool> _forceActivateHorizontal { false };
|
||||||
std::atomic<bool> _toggleHipsFollowing { true };
|
std::atomic<bool> _toggleHipsFollowing { true };
|
||||||
int _velocityCount { 0 };
|
|
||||||
};
|
};
|
||||||
FollowHelper _follow;
|
FollowHelper _follow;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue