mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:27:04 +02:00
code review feedback/formatting issues
This commit is contained in:
parent
17e559f8e8
commit
4f738a5b42
5 changed files with 110 additions and 163 deletions
|
@ -101,7 +101,7 @@
|
||||||
{ "from": "Standard.RightSecondaryThumb",
|
{ "from": "Standard.RightSecondaryThumb",
|
||||||
"when": "Application.RightHandDominant",
|
"when": "Application.RightHandDominant",
|
||||||
"to": "Actions.Up"
|
"to": "Actions.Up"
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "from": "Standard.Back", "to": "Actions.CycleCamera" },
|
{ "from": "Standard.Back", "to": "Actions.CycleCamera" },
|
||||||
{ "from": "Standard.Start", "to": "Actions.ContextMenu" },
|
{ "from": "Standard.Start", "to": "Actions.ContextMenu" },
|
||||||
|
@ -180,4 +180,4 @@
|
||||||
{ "from": "Standard.TrackedObject14", "to" : "Actions.TrackedObject14" },
|
{ "from": "Standard.TrackedObject14", "to" : "Actions.TrackedObject14" },
|
||||||
{ "from": "Standard.TrackedObject15", "to" : "Actions.TrackedObject15" }
|
{ "from": "Standard.TrackedObject15", "to" : "Actions.TrackedObject15" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,7 @@
|
||||||
"filters": [ { "type": "hysteresis", "min": 0.7, "max": 0.75 } ]
|
"filters": [ { "type": "hysteresis", "min": 0.7, "max": 0.75 } ]
|
||||||
},
|
},
|
||||||
|
|
||||||
{ "from": "Vive.LY", "when": "Vive.LS",
|
{ "from": "Vive.LY", "when": "Vive.LS", "filters": [ { "type": "deadZone", "min": 0.15 }, "invert" ], "to": "Standard.LY" },
|
||||||
"filters": [
|
|
||||||
{ "type": "deadZone", "min": 0.15 },
|
|
||||||
"invert"
|
|
||||||
]
|
|
||||||
, "to": "Standard.LY" },
|
|
||||||
{ "from": "Vive.LX", "when": ["Vive.LS", "Application.RightHandDominant"], "filters": { "type": "deadZone", "min": 0.15 }, "to": "Standard.LX" },
|
{ "from": "Vive.LX", "when": ["Vive.LS", "Application.RightHandDominant"], "filters": { "type": "deadZone", "min": 0.15 }, "to": "Standard.LX" },
|
||||||
{ "from": "Vive.LX", "when": ["Vive.LS", "Vive.LSX", "!Vive.LSY", "Application.LeftHandDominant"], "filters": { "type": "deadZone", "min": 0.15 }, "to": "Standard.LX" },
|
{ "from": "Vive.LX", "when": ["Vive.LS", "Vive.LSX", "!Vive.LSY", "Application.LeftHandDominant"], "filters": { "type": "deadZone", "min": 0.15 }, "to": "Standard.LX" },
|
||||||
{
|
{
|
||||||
|
@ -34,12 +29,7 @@
|
||||||
},
|
},
|
||||||
{ "from": "Vive.LSTouch", "to": "Standard.LSTouch" },
|
{ "from": "Vive.LSTouch", "to": "Standard.LSTouch" },
|
||||||
|
|
||||||
{ "from": "Vive.RY", "when": "Vive.RS",
|
{ "from": "Vive.RY", "when": "Vive.RS", "filters": [ { "type": "deadZone", "min": 0.15 }, "invert" ], "to": "Standard.RY" },
|
||||||
"filters": [
|
|
||||||
{ "type": "deadZone", "min": 0.15 },
|
|
||||||
"invert"
|
|
||||||
]
|
|
||||||
, "to": "Standard.RY" },
|
|
||||||
{ "from": "Vive.RX", "when": ["Vive.RS", "Application.LeftHandDominant"], "filters": { "type": "deadZone", "min": 0.15 }, "to": "Standard.RX" },
|
{ "from": "Vive.RX", "when": ["Vive.RS", "Application.LeftHandDominant"], "filters": { "type": "deadZone", "min": 0.15 }, "to": "Standard.RX" },
|
||||||
{ "from": "Vive.RX", "when": ["Vive.RS", "Vive.RSX", "!Vive.RSY", "Application.RightHandDominant"], "filters": { "type": "deadZone", "min": 0.15 }, "to": "Standard.RX" },
|
{ "from": "Vive.RX", "when": ["Vive.RS", "Vive.RSX", "!Vive.RSY", "Application.RightHandDominant"], "filters": { "type": "deadZone", "min": 0.15 }, "to": "Standard.RX" },
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,7 +136,7 @@ MyAvatar::MyAvatar(QThread* thread) :
|
||||||
_characterController(std::shared_ptr<MyAvatar>(this)),
|
_characterController(std::shared_ptr<MyAvatar>(this)),
|
||||||
_eyeContactTarget(LEFT_EYE),
|
_eyeContactTarget(LEFT_EYE),
|
||||||
_realWorldFieldOfView("realWorldFieldOfView",
|
_realWorldFieldOfView("realWorldFieldOfView",
|
||||||
DEFAULT_REAL_WORLD_FIELD_OF_VIEW_DEGREES),
|
DEFAULT_REAL_WORLD_FIELD_OF_VIEW_DEGREES),
|
||||||
_useAdvancedMovementControls("advancedMovementForHandControllersIsChecked", true),
|
_useAdvancedMovementControls("advancedMovementForHandControllersIsChecked", true),
|
||||||
_showPlayArea("showPlayArea", true),
|
_showPlayArea("showPlayArea", true),
|
||||||
_smoothOrientationTimer(std::numeric_limits<float>::max()),
|
_smoothOrientationTimer(std::numeric_limits<float>::max()),
|
||||||
|
@ -223,7 +223,7 @@ MyAvatar::MyAvatar(QThread* thread) :
|
||||||
|
|
||||||
// connect to AddressManager signal for location jumps
|
// connect to AddressManager signal for location jumps
|
||||||
connect(DependencyManager::get<AddressManager>().data(), &AddressManager::locationChangeRequired,
|
connect(DependencyManager::get<AddressManager>().data(), &AddressManager::locationChangeRequired,
|
||||||
this, static_cast<SlotType>(&MyAvatar::goToFeetLocation));
|
this, static_cast<SlotType>(&MyAvatar::goToFeetLocation));
|
||||||
|
|
||||||
// handle scale constraints imposed on us by the domain-server
|
// handle scale constraints imposed on us by the domain-server
|
||||||
auto& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler();
|
auto& domainHandler = DependencyManager::get<NodeList>()->getDomainHandler();
|
||||||
|
@ -1890,7 +1890,7 @@ void MyAvatar::loadData() {
|
||||||
setDriveGear3(firstRunVal.get() ? DEFAULT_GEAR_3 : _driveGear3Setting.get());
|
setDriveGear3(firstRunVal.get() ? DEFAULT_GEAR_3 : _driveGear3Setting.get());
|
||||||
setDriveGear4(firstRunVal.get() ? DEFAULT_GEAR_4 : _driveGear4Setting.get());
|
setDriveGear4(firstRunVal.get() ? DEFAULT_GEAR_4 : _driveGear4Setting.get());
|
||||||
setDriveGear5(firstRunVal.get() ? DEFAULT_GEAR_5 : _driveGear5Setting.get());
|
setDriveGear5(firstRunVal.get() ? DEFAULT_GEAR_5 : _driveGear5Setting.get());
|
||||||
setControlSchemeIndex(firstRunVal.get() ? CONTROLS_DEFAULT : _controlSchemeIndexSetting.get());
|
setControlSchemeIndex(firstRunVal.get() ? LocomotionControlsMode::CONTROLS_DEFAULT : _controlSchemeIndexSetting.get());
|
||||||
setAnalogWalkSpeed(firstRunVal.get() ? ANALOG_AVATAR_MAX_WALKING_SPEED : _analogWalkSpeedSetting.get());
|
setAnalogWalkSpeed(firstRunVal.get() ? ANALOG_AVATAR_MAX_WALKING_SPEED : _analogWalkSpeedSetting.get());
|
||||||
setAnalogPlusWalkSpeed(firstRunVal.get() ? ANALOG_PLUS_AVATAR_MAX_WALKING_SPEED : _analogPlusWalkSpeedSetting.get());
|
setAnalogPlusWalkSpeed(firstRunVal.get() ? ANALOG_PLUS_AVATAR_MAX_WALKING_SPEED : _analogPlusWalkSpeedSetting.get());
|
||||||
setFlyingEnabled(getFlyingEnabled());
|
setFlyingEnabled(getFlyingEnabled());
|
||||||
|
@ -3363,7 +3363,7 @@ glm::vec3 MyAvatar::scaleMotorSpeed(const glm::vec3 forward, const glm::vec3 rig
|
||||||
} else if (qApp->isHMDMode()) {
|
} else if (qApp->isHMDMode()) {
|
||||||
// HMD advanced movement controls.
|
// HMD advanced movement controls.
|
||||||
switch (_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
// No acceleration curve for this one, constant speed.
|
// No acceleration curve for this one, constant speed.
|
||||||
if (zSpeed || xSpeed) {
|
if (zSpeed || xSpeed) {
|
||||||
direction = (zSpeed * forward) + (xSpeed * right);
|
direction = (zSpeed * forward) + (xSpeed * right);
|
||||||
|
@ -3376,7 +3376,7 @@ glm::vec3 MyAvatar::scaleMotorSpeed(const glm::vec3 forward, const glm::vec3 rig
|
||||||
} else {
|
} else {
|
||||||
return Vectors::ZERO;
|
return Vectors::ZERO;
|
||||||
}
|
}
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
if (zSpeed || xSpeed) {
|
if (zSpeed || xSpeed) {
|
||||||
glm::vec3 scaledForward = getSensorToWorldScale() * calculateGearedSpeed(zSpeed) * _walkSpeedScalar * ((zSpeed >= stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * forward;
|
glm::vec3 scaledForward = getSensorToWorldScale() * calculateGearedSpeed(zSpeed) * _walkSpeedScalar * ((zSpeed >= stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * forward;
|
||||||
glm::vec3 scaledRight = getSensorToWorldScale() * calculateGearedSpeed(xSpeed) * _walkSpeedScalar * ((xSpeed > stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * right;
|
glm::vec3 scaledRight = getSensorToWorldScale() * calculateGearedSpeed(xSpeed) * _walkSpeedScalar * ((xSpeed > stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * right;
|
||||||
|
@ -3385,7 +3385,7 @@ glm::vec3 MyAvatar::scaleMotorSpeed(const glm::vec3 forward, const glm::vec3 rig
|
||||||
} else {
|
} else {
|
||||||
return Vectors::ZERO;
|
return Vectors::ZERO;
|
||||||
}
|
}
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
if (zSpeed || xSpeed) {
|
if (zSpeed || xSpeed) {
|
||||||
glm::vec3 scaledForward = getSensorToWorldScale() * calculateGearedSpeed(zSpeed) * _walkSpeedScalar * ((zSpeed >= stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * forward;
|
glm::vec3 scaledForward = getSensorToWorldScale() * calculateGearedSpeed(zSpeed) * _walkSpeedScalar * ((zSpeed >= stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * forward;
|
||||||
glm::vec3 scaledRight = getSensorToWorldScale() * calculateGearedSpeed(xSpeed) * _walkSpeedScalar * ((xSpeed > stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * right;
|
glm::vec3 scaledRight = getSensorToWorldScale() * calculateGearedSpeed(xSpeed) * _walkSpeedScalar * ((xSpeed > stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * right;
|
||||||
|
@ -3422,14 +3422,19 @@ glm::vec3 MyAvatar::calculateScaledDirection(){
|
||||||
glm::vec3 controllerForward(0.0f, 1.0f, 0.0f);
|
glm::vec3 controllerForward(0.0f, 1.0f, 0.0f);
|
||||||
glm::vec3 controllerRight(0.0f, 0.0f, (getDominantHand() == DOMINANT_RIGHT_HAND ? 1.0f : -1.0f));
|
glm::vec3 controllerRight(0.0f, 0.0f, (getDominantHand() == DOMINANT_RIGHT_HAND ? 1.0f : -1.0f));
|
||||||
switch (getMovementReference()) {
|
switch (getMovementReference()) {
|
||||||
case MOVEMENT_HAND_RELATIVE:
|
case LocomotionRelativeMovementMode::MOVEMENT_HAND_RELATIVE:
|
||||||
forward = (handRotation * controllerForward);
|
forward = (handRotation * controllerForward);
|
||||||
right = (handRotation * controllerRight);
|
right = (handRotation * controllerRight);
|
||||||
break;
|
break;
|
||||||
case MOVEMENT_HAND_RELATIVE_LEVELED:
|
case LocomotionRelativeMovementMode::MOVEMENT_HAND_RELATIVE_LEVELED:
|
||||||
forward = (handRotation * controllerForward);
|
forward = (handRotation * controllerForward);
|
||||||
if (glm::length(forward) > EPSILON) {
|
if (glm::length(forward) > EPSILON) {
|
||||||
forward = glm::normalize(forward - (glm::dot(forward, Vectors::UNIT_Y) * Vectors::UNIT_Y));
|
auto transform = forward - (glm::dot(forward, Vectors::UNIT_Y) * Vectors::UNIT_Y);
|
||||||
|
if (glm::length(transform) > 0.0f) {
|
||||||
|
forward = glm::normalize(transform);
|
||||||
|
} else {
|
||||||
|
forward = Vectors::ZERO;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
forward = Vectors::ZERO;
|
forward = Vectors::ZERO;
|
||||||
}
|
}
|
||||||
|
@ -3440,7 +3445,7 @@ glm::vec3 MyAvatar::calculateScaledDirection(){
|
||||||
right = Vectors::ZERO;
|
right = Vectors::ZERO;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOVEMENT_HMD_RELATIVE:
|
case LocomotionRelativeMovementMode::MOVEMENT_HMD_RELATIVE:
|
||||||
default:
|
default:
|
||||||
forward = IDENTITY_FORWARD;
|
forward = IDENTITY_FORWARD;
|
||||||
right = IDENTITY_RIGHT;
|
right = IDENTITY_RIGHT;
|
||||||
|
@ -4070,13 +4075,13 @@ void MyAvatar::setDriveGear1(float shiftPoint) {
|
||||||
|
|
||||||
float MyAvatar::getDriveGear1() {
|
float MyAvatar::getDriveGear1() {
|
||||||
switch (_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
return ANALOG_AVATAR_GEAR_1;
|
return ANALOG_AVATAR_GEAR_1;
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
return _driveGear1;
|
return _driveGear1;
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
default:
|
default:
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4091,13 +4096,13 @@ void MyAvatar::setDriveGear2(float shiftPoint) {
|
||||||
|
|
||||||
float MyAvatar::getDriveGear2() {
|
float MyAvatar::getDriveGear2() {
|
||||||
switch (_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
return ANALOG_AVATAR_GEAR_2;
|
return ANALOG_AVATAR_GEAR_2;
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
return _driveGear2;
|
return _driveGear2;
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
default:
|
default:
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4112,13 +4117,13 @@ void MyAvatar::setDriveGear3(float shiftPoint) {
|
||||||
|
|
||||||
float MyAvatar::getDriveGear3() {
|
float MyAvatar::getDriveGear3() {
|
||||||
switch (_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
return ANALOG_AVATAR_GEAR_3;
|
return ANALOG_AVATAR_GEAR_3;
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
return _driveGear3;
|
return _driveGear3;
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
default:
|
default:
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4133,13 +4138,13 @@ void MyAvatar::setDriveGear4(float shiftPoint) {
|
||||||
|
|
||||||
float MyAvatar::getDriveGear4() {
|
float MyAvatar::getDriveGear4() {
|
||||||
switch (_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
return ANALOG_AVATAR_GEAR_4;
|
return ANALOG_AVATAR_GEAR_4;
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
return _driveGear4;
|
return _driveGear4;
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
default:
|
default:
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4154,13 +4159,13 @@ void MyAvatar::setDriveGear5(float shiftPoint) {
|
||||||
|
|
||||||
float MyAvatar::getDriveGear5() {
|
float MyAvatar::getDriveGear5() {
|
||||||
switch (_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
return ANALOG_AVATAR_GEAR_5;
|
return ANALOG_AVATAR_GEAR_5;
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
return _driveGear5;
|
return _driveGear5;
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
default:
|
default:
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4774,11 +4779,11 @@ bool MyAvatar::getIsSitStandStateLocked() const {
|
||||||
float MyAvatar::getWalkSpeed() const {
|
float MyAvatar::getWalkSpeed() const {
|
||||||
if (qApp->isHMDMode()) {
|
if (qApp->isHMDMode()) {
|
||||||
switch (_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
return _analogWalkSpeed.get();
|
return _analogWalkSpeed.get();
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
return _analogPlusWalkSpeed.get();
|
return _analogPlusWalkSpeed.get();
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
default:
|
default:
|
||||||
return _defaultWalkSpeed.get();
|
return _defaultWalkSpeed.get();
|
||||||
}
|
}
|
||||||
|
@ -4790,12 +4795,12 @@ float MyAvatar::getWalkSpeed() const {
|
||||||
|
|
||||||
float MyAvatar::getWalkBackwardSpeed() const {
|
float MyAvatar::getWalkBackwardSpeed() const {
|
||||||
if (qApp->isHMDMode()) {
|
if (qApp->isHMDMode()) {
|
||||||
switch(_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
return _analogWalkBackwardSpeed.get();
|
return _analogWalkBackwardSpeed.get();
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
return _analogPlusWalkBackwardSpeed.get();
|
return _analogPlusWalkBackwardSpeed.get();
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
default:
|
default:
|
||||||
return _defaultWalkBackwardSpeed.get();
|
return _defaultWalkBackwardSpeed.get();
|
||||||
}
|
}
|
||||||
|
@ -4873,61 +4878,61 @@ void MyAvatar::setIsSitStandStateLocked(bool isLocked) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::setWalkSpeed(float value) {
|
void MyAvatar::setWalkSpeed(float value) {
|
||||||
switch(_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
_defaultWalkSpeed.set(value);
|
_defaultWalkSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
_analogWalkSpeed.set(value);
|
_analogWalkSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
_analogPlusWalkSpeed.set(value);
|
_analogPlusWalkSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::setWalkBackwardSpeed(float value) {
|
void MyAvatar::setWalkBackwardSpeed(float value) {
|
||||||
switch(_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
_defaultWalkBackwardSpeed.set(value);
|
_defaultWalkBackwardSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
_analogWalkBackwardSpeed.set(value);
|
_analogWalkBackwardSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
_analogPlusWalkBackwardSpeed.set(value);
|
_analogPlusWalkBackwardSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::setSprintSpeed(float value) {
|
void MyAvatar::setSprintSpeed(float value) {
|
||||||
switch(_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
_defaultSprintSpeed.set(value);
|
_defaultSprintSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
_analogSprintSpeed.set(value);
|
_analogSprintSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
_analogPlusSprintSpeed.set(value);
|
_analogPlusSprintSpeed.set(value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float MyAvatar::getSprintSpeed() const {
|
float MyAvatar::getSprintSpeed() const {
|
||||||
if (qApp->isHMDMode()) {
|
if (qApp->isHMDMode()) {
|
||||||
switch (_controlSchemeIndex) {
|
switch (_controlSchemeIndex) {
|
||||||
case CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
return _analogSprintSpeed.get();
|
return _analogSprintSpeed.get();
|
||||||
case CONTROLS_ANALOG_PLUS:
|
case LocomotionControlsMode::CONTROLS_ANALOG_PLUS:
|
||||||
return _analogPlusSprintSpeed.get();
|
return _analogPlusSprintSpeed.get();
|
||||||
case CONTROLS_DEFAULT:
|
case LocomotionControlsMode::CONTROLS_DEFAULT:
|
||||||
default:
|
default:
|
||||||
return _defaultSprintSpeed.get();
|
return _defaultSprintSpeed.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,13 +39,17 @@ class ModelItemID;
|
||||||
class MyHead;
|
class MyHead;
|
||||||
class DetailedMotionState;
|
class DetailedMotionState;
|
||||||
|
|
||||||
const int CONTROLS_DEFAULT = 0;
|
enum LocomotionControlsMode {
|
||||||
const int CONTROLS_ANALOG = 1;
|
CONTROLS_DEFAULT = 0,
|
||||||
const int CONTROLS_ANALOG_PLUS = 2;
|
CONTROLS_ANALOG,
|
||||||
|
CONTROLS_ANALOG_PLUS
|
||||||
|
};
|
||||||
|
|
||||||
const int MOVEMENT_HMD_RELATIVE = 0;
|
enum LocomotionRelativeMovementMode {
|
||||||
const int MOVEMENT_HAND_RELATIVE = 1;
|
MOVEMENT_HMD_RELATIVE = 0,
|
||||||
const int MOVEMENT_HAND_RELATIVE_LEVELED = 2;
|
MOVEMENT_HAND_RELATIVE,
|
||||||
|
MOVEMENT_HAND_RELATIVE_LEVELED
|
||||||
|
}
|
||||||
|
|
||||||
enum eyeContactTarget {
|
enum eyeContactTarget {
|
||||||
LEFT_EYE,
|
LEFT_EYE,
|
||||||
|
|
|
@ -379,58 +379,6 @@ void setupPreferences() {
|
||||||
preferences->addPreference(preference);
|
preferences->addPreference(preference);
|
||||||
}
|
}
|
||||||
|
|
||||||
//static const QString ACCEL_CURVE{ "Acceleration Step Function" };
|
|
||||||
//{
|
|
||||||
// auto getter = [myAvatar]()->float { return myAvatar->getDriveGear1(); };
|
|
||||||
// auto setter = [myAvatar](float value) { myAvatar->setDriveGear1(value); };
|
|
||||||
// auto preference = new SpinnerPreference(ACCEL_CURVE, "Gear 1", getter, setter);
|
|
||||||
// preference->setMin(0.0f);
|
|
||||||
// preference->setMax(1.0f);
|
|
||||||
// preference->setStep(1);
|
|
||||||
// preference->setDecimals(2);
|
|
||||||
// preferences->addPreference(preference);
|
|
||||||
//}
|
|
||||||
//{
|
|
||||||
// auto getter = [myAvatar]()->float { return myAvatar->getDriveGear2(); };
|
|
||||||
// auto setter = [myAvatar](float value) { myAvatar->setDriveGear2(value); };
|
|
||||||
// auto preference = new SpinnerPreference(ACCEL_CURVE, "Gear 2", getter, setter);
|
|
||||||
// preference->setMin(0.0f);
|
|
||||||
// preference->setMax(1.0f);
|
|
||||||
// preference->setStep(1);
|
|
||||||
// preference->setDecimals(2);
|
|
||||||
// preferences->addPreference(preference);
|
|
||||||
//}
|
|
||||||
//{
|
|
||||||
// auto getter = [myAvatar]()->float { return myAvatar->getDriveGear3(); };
|
|
||||||
// auto setter = [myAvatar](float value) { myAvatar->setDriveGear3(value); };
|
|
||||||
// auto preference = new SpinnerPreference(ACCEL_CURVE, "Gear 3", getter, setter);
|
|
||||||
// preference->setMin(0.0f);
|
|
||||||
// preference->setMax(1.0f);
|
|
||||||
// preference->setStep(1);
|
|
||||||
// preference->setDecimals(2);
|
|
||||||
// preferences->addPreference(preference);
|
|
||||||
//}
|
|
||||||
//{
|
|
||||||
// auto getter = [myAvatar]()->float { return myAvatar->getDriveGear4(); };
|
|
||||||
// auto setter = [myAvatar](float value) { myAvatar->setDriveGear4(value); };
|
|
||||||
// auto preference = new SpinnerPreference(ACCEL_CURVE, "Gear 4", getter, setter);
|
|
||||||
// preference->setMin(0.0f);
|
|
||||||
// preference->setMax(1.0f);
|
|
||||||
// preference->setStep(1);
|
|
||||||
// preference->setDecimals(2);
|
|
||||||
// preferences->addPreference(preference);
|
|
||||||
//}
|
|
||||||
//{
|
|
||||||
// auto getter = [myAvatar]()->float { return myAvatar->getDriveGear5(); };
|
|
||||||
// auto setter = [myAvatar](float value) { myAvatar->setDriveGear5(value); };
|
|
||||||
// auto preference = new SpinnerPreference(ACCEL_CURVE, "Gear 5", getter, setter);
|
|
||||||
// preference->setMin(0.0f);
|
|
||||||
// preference->setMax(1.0f);
|
|
||||||
// preference->setStep(1);
|
|
||||||
// preference->setDecimals(2);
|
|
||||||
// preferences->addPreference(preference);
|
|
||||||
//}
|
|
||||||
|
|
||||||
static const QString AVATAR_CAMERA{ "Mouse Sensitivity" };
|
static const QString AVATAR_CAMERA{ "Mouse Sensitivity" };
|
||||||
{
|
{
|
||||||
auto getter = [myAvatar]()->float { return myAvatar->getPitchSpeed(); };
|
auto getter = [myAvatar]()->float { return myAvatar->getPitchSpeed(); };
|
||||||
|
|
Loading…
Reference in a new issue