mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-05 21:10:02 +02:00
addressed missing changes for luis
This commit is contained in:
parent
9bc92cb2a3
commit
2df9d6c5e9
2 changed files with 42 additions and 36 deletions
|
@ -530,6 +530,7 @@ void MyAvatar::update(float deltaTime) {
|
||||||
const float PERCENTAGE_WEIGHT_HEAD_VS_SHOULDERS_AZIMUTH = 0.0f; // 100 percent shoulders
|
const float PERCENTAGE_WEIGHT_HEAD_VS_SHOULDERS_AZIMUTH = 0.0f; // 100 percent shoulders
|
||||||
const float COSINE_THIRTY_DEGREES = 0.866f;
|
const float COSINE_THIRTY_DEGREES = 0.866f;
|
||||||
const float SQUATTY_TIMEOUT = 30.0f; // 30 seconds
|
const float SQUATTY_TIMEOUT = 30.0f; // 30 seconds
|
||||||
|
const float HEIGHT_FILTER_COEFFICIENT = 0.01f;
|
||||||
|
|
||||||
float tau = deltaTime / HMD_FACING_TIMESCALE;
|
float tau = deltaTime / HMD_FACING_TIMESCALE;
|
||||||
setHipToHandController(computeHandAzimuth());
|
setHipToHandController(computeHandAzimuth());
|
||||||
|
@ -559,7 +560,7 @@ void MyAvatar::update(float deltaTime) {
|
||||||
controller::Pose newHeightReading = getControllerPoseInSensorFrame(controller::Action::HEAD);
|
controller::Pose newHeightReading = getControllerPoseInSensorFrame(controller::Action::HEAD);
|
||||||
if (newHeightReading.isValid()) {
|
if (newHeightReading.isValid()) {
|
||||||
int newHeightReadingInCentimeters = glm::floor(newHeightReading.getTranslation().y * CENTIMETERS_PER_METER);
|
int newHeightReadingInCentimeters = glm::floor(newHeightReading.getTranslation().y * CENTIMETERS_PER_METER);
|
||||||
_averageUserHeightSensorSpace = lerp(_averageUserHeightSensorSpace, newHeightReading.getTranslation().y, 0.01f);
|
_averageUserHeightSensorSpace = lerp(_averageUserHeightSensorSpace, newHeightReading.getTranslation().y, HEIGHT_FILTER_COEFFICIENT);
|
||||||
_recentModeReadings.insert(newHeightReadingInCentimeters);
|
_recentModeReadings.insert(newHeightReadingInCentimeters);
|
||||||
setCurrentStandingHeight(computeStandingHeightMode(newHeightReading));
|
setCurrentStandingHeight(computeStandingHeightMode(newHeightReading));
|
||||||
setAverageHeadRotation(computeAverageHeadRotation(getControllerPoseInAvatarFrame(controller::Action::HEAD)));
|
setAverageHeadRotation(computeAverageHeadRotation(getControllerPoseInAvatarFrame(controller::Action::HEAD)));
|
||||||
|
@ -4232,7 +4233,7 @@ bool MyAvatar::FollowHelper::shouldActivateVertical(const MyAvatar& myAvatar, co
|
||||||
|
|
||||||
if (myAvatar.getSitStandStateChange()) {
|
if (myAvatar.getSitStandStateChange()) {
|
||||||
returnValue = true;
|
returnValue = true;
|
||||||
}
|
} else {
|
||||||
if (myAvatar.getIsInSittingState()) {
|
if (myAvatar.getIsInSittingState()) {
|
||||||
if (myAvatar.getIsSitStandStateLocked()) {
|
if (myAvatar.getIsSitStandStateLocked()) {
|
||||||
returnValue = (offset.y > CYLINDER_TOP);
|
returnValue = (offset.y > CYLINDER_TOP);
|
||||||
|
@ -4249,6 +4250,7 @@ bool MyAvatar::FollowHelper::shouldActivateVertical(const MyAvatar& myAvatar, co
|
||||||
returnValue = true;
|
returnValue = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,8 @@ void setupPreferences() {
|
||||||
preferences->addPreference(preference);
|
preferences->addPreference(preference);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto getter = [myAvatar]()->int { switch (myAvatar->getUserRecenterModel()) {
|
auto getter = [myAvatar]()->int {
|
||||||
|
switch (myAvatar->getUserRecenterModel()) {
|
||||||
case MyAvatar::SitStandModelType::Auto:
|
case MyAvatar::SitStandModelType::Auto:
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -268,8 +269,10 @@ void setupPreferences() {
|
||||||
return 1;
|
return 1;
|
||||||
case MyAvatar::SitStandModelType::DisableHMDLean:
|
case MyAvatar::SitStandModelType::DisableHMDLean:
|
||||||
return 2;
|
return 2;
|
||||||
}};
|
}
|
||||||
auto setter = [myAvatar](int value) { switch (value) {
|
};
|
||||||
|
auto setter = [myAvatar](int value) {
|
||||||
|
switch (value) {
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
myAvatar->setUserRecenterModel(MyAvatar::SitStandModelType::Auto);
|
myAvatar->setUserRecenterModel(MyAvatar::SitStandModelType::Auto);
|
||||||
|
@ -280,7 +283,8 @@ void setupPreferences() {
|
||||||
case 2:
|
case 2:
|
||||||
myAvatar->setUserRecenterModel(MyAvatar::SitStandModelType::DisableHMDLean);
|
myAvatar->setUserRecenterModel(MyAvatar::SitStandModelType::DisableHMDLean);
|
||||||
break;
|
break;
|
||||||
}};
|
}
|
||||||
|
};
|
||||||
auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Auto / Force Sit / Disable Recenter", getter, setter);
|
auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Auto / Force Sit / Disable Recenter", getter, setter);
|
||||||
QStringList items;
|
QStringList items;
|
||||||
items << "Auto - turns on avatar leaning when standing in real world" << "Seated - disables all avatar leaning while sitting in real world" << "Disabled - allows avatar sitting on the floor [Experimental]";
|
items << "Auto - turns on avatar leaning when standing in real world" << "Seated - disables all avatar leaning while sitting in real world" << "Disabled - allows avatar sitting on the floor [Experimental]";
|
||||||
|
|
Loading…
Reference in a new issue