mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:06:41 +02:00
Fix desktop movement.
This commit is contained in:
parent
8b670110a9
commit
283ec97bb9
1 changed files with 43 additions and 25 deletions
|
@ -3357,8 +3357,12 @@ glm::vec3 MyAvatar::scaleMotorSpeed(const glm::vec3 forward, const glm::vec3 rig
|
||||||
auto zSpeed = getDriveKey(TRANSLATE_Z);
|
auto zSpeed = getDriveKey(TRANSLATE_Z);
|
||||||
auto xSpeed = getDriveKey(TRANSLATE_X);
|
auto xSpeed = getDriveKey(TRANSLATE_X);
|
||||||
glm::vec3 direction;
|
glm::vec3 direction;
|
||||||
if (qApp->isHMDMode()) {
|
if (!useAdvancedMovementControls() && qApp->isHMDMode()) {
|
||||||
switch(_controlSchemeIndex) {
|
// Walking disabled in settings.
|
||||||
|
return Vectors::ZERO;
|
||||||
|
} else if (qApp->isHMDMode()) {
|
||||||
|
// HMD advanced movement controls.
|
||||||
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_DEFAULT:
|
case CONTROLS_DEFAULT:
|
||||||
// No acceleration curve for this one, constant speed.
|
// No acceleration curve for this one, constant speed.
|
||||||
if (zSpeed || xSpeed) {
|
if (zSpeed || xSpeed) {
|
||||||
|
@ -4768,27 +4772,37 @@ bool MyAvatar::getIsSitStandStateLocked() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float MyAvatar::getWalkSpeed() const {
|
float MyAvatar::getWalkSpeed() const {
|
||||||
switch(_controlSchemeIndex) {
|
if (qApp->isHMDMode()) {
|
||||||
case CONTROLS_ANALOG:
|
switch (_controlSchemeIndex) {
|
||||||
return _analogWalkSpeed.get();
|
case CONTROLS_ANALOG:
|
||||||
case CONTROLS_ANALOG_PLUS:
|
return _analogWalkSpeed.get();
|
||||||
return _analogPlusWalkSpeed.get();
|
case CONTROLS_ANALOG_PLUS:
|
||||||
case CONTROLS_DEFAULT:
|
return _analogPlusWalkSpeed.get();
|
||||||
default:
|
case CONTROLS_DEFAULT:
|
||||||
return _defaultWalkSpeed.get();
|
default:
|
||||||
|
return _defaultWalkSpeed.get();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return _defaultWalkSpeed.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float MyAvatar::getWalkBackwardSpeed() const {
|
float MyAvatar::getWalkBackwardSpeed() const {
|
||||||
switch(_controlSchemeIndex) {
|
if (qApp->isHMDMode()) {
|
||||||
case CONTROLS_ANALOG:
|
switch(_controlSchemeIndex) {
|
||||||
return _analogWalkBackwardSpeed.get();
|
case CONTROLS_ANALOG:
|
||||||
case CONTROLS_ANALOG_PLUS:
|
return _analogWalkBackwardSpeed.get();
|
||||||
return _analogPlusWalkBackwardSpeed.get();
|
case CONTROLS_ANALOG_PLUS:
|
||||||
case CONTROLS_DEFAULT:
|
return _analogPlusWalkBackwardSpeed.get();
|
||||||
default:
|
case CONTROLS_DEFAULT:
|
||||||
return _defaultWalkBackwardSpeed.get();
|
default:
|
||||||
|
return _defaultWalkBackwardSpeed.get();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return _defaultWalkBackwardSpeed.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MyAvatar::isReadyForPhysics() const {
|
bool MyAvatar::isReadyForPhysics() const {
|
||||||
|
@ -4907,13 +4921,17 @@ void MyAvatar::setSprintSpeed(float value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float MyAvatar::getSprintSpeed() const {
|
float MyAvatar::getSprintSpeed() const {
|
||||||
switch(_controlSchemeIndex) {
|
if (qApp->isHMDMode()) {
|
||||||
case CONTROLS_ANALOG:
|
switch (_controlSchemeIndex) {
|
||||||
return _analogSprintSpeed.get();
|
case CONTROLS_ANALOG:
|
||||||
case CONTROLS_ANALOG_PLUS:
|
return _analogSprintSpeed.get();
|
||||||
return _analogPlusSprintSpeed.get();
|
case CONTROLS_ANALOG_PLUS:
|
||||||
case CONTROLS_DEFAULT:
|
return _analogPlusSprintSpeed.get();
|
||||||
default:
|
case CONTROLS_DEFAULT:
|
||||||
|
default:
|
||||||
|
return _defaultSprintSpeed.get();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
return _defaultSprintSpeed.get();
|
return _defaultSprintSpeed.get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue