mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 23:10:37 +02:00
put in condition for away mode so that when you take the hmd off and put it back on the initial guess to your state is made again.
This commit is contained in:
parent
8e272d6dd2
commit
ae3ae9ce9a
1 changed files with 57 additions and 45 deletions
|
@ -530,8 +530,10 @@ void MyAvatar::update(float deltaTime) {
|
|||
glm::vec3 worldHips = transformPoint(getTransform().getMatrix(), avatarHips);
|
||||
glm::vec3 sensorHips = transformPoint(glm::inverse(getSensorToWorldMatrix()), worldHips);
|
||||
|
||||
const int VELOCITY_COUNT_THRESHOLD = 60;
|
||||
// put update sit stand state counts here
|
||||
if (!getIsSitStandStateLocked() && (_follow._velocityCount > 60)) {
|
||||
if (!getIsSitStandStateLocked() && (_follow._velocityCount > VELOCITY_COUNT_THRESHOLD)) {
|
||||
if (!getIsAway()) {
|
||||
if (getIsInSittingState()) {
|
||||
if (newHeightReading.getTranslation().y > (STANDING_HEIGHT_MULTIPLE * _tippingPoint)) {
|
||||
// if we recenter upwards then no longer in sitting state
|
||||
|
@ -583,6 +585,16 @@ void MyAvatar::update(float deltaTime) {
|
|||
_sitStandStateCount = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 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;
|
||||
setIsInSittingState(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (_drawAverageFacingEnabled) {
|
||||
|
|
Loading…
Reference in a new issue