mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 22:22:54 +02:00
Merge pull request #25 from wayne-chen/locomotionCRFeedback
more code feedback
This commit is contained in:
commit
bcbff6ace4
2 changed files with 4 additions and 15 deletions
|
@ -3377,14 +3377,6 @@ glm::vec3 MyAvatar::scaleMotorSpeed(const glm::vec3 forward, const glm::vec3 rig
|
||||||
return Vectors::ZERO;
|
return Vectors::ZERO;
|
||||||
}
|
}
|
||||||
case LocomotionControlsMode::CONTROLS_ANALOG:
|
case LocomotionControlsMode::CONTROLS_ANALOG:
|
||||||
if (zSpeed || xSpeed) {
|
|
||||||
glm::vec3 scaledForward = getSensorToWorldScale() * calculateGearedSpeed(zSpeed) * _walkSpeedScalar * ((zSpeed >= stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * forward;
|
|
||||||
glm::vec3 scaledRight = getSensorToWorldScale() * calculateGearedSpeed(xSpeed) * _walkSpeedScalar * ((xSpeed > stickFullOn) ? getSprintSpeed() : getWalkSpeed()) * right;
|
|
||||||
direction = scaledForward + scaledRight;
|
|
||||||
return direction;
|
|
||||||
} else {
|
|
||||||
return Vectors::ZERO;
|
|
||||||
}
|
|
||||||
case LocomotionControlsMode::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;
|
||||||
|
@ -3430,14 +3422,11 @@ glm::vec3 MyAvatar::calculateScaledDirection(){
|
||||||
forward = (handRotation * controllerForward);
|
forward = (handRotation * controllerForward);
|
||||||
if (glm::length(forward) > EPSILON) {
|
if (glm::length(forward) > EPSILON) {
|
||||||
auto transform = 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) {
|
if (glm::length(transform) > EPSILON) {
|
||||||
forward = glm::normalize(transform);
|
forward = glm::normalize(transform);
|
||||||
} else {
|
} else {
|
||||||
forward = Vectors::ZERO;
|
forward = Vectors::ZERO;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
forward = Vectors::ZERO;
|
|
||||||
}
|
|
||||||
right = (handRotation * controllerRight);
|
right = (handRotation * controllerRight);
|
||||||
if (glm::length(right) > EPSILON) {
|
if (glm::length(right) > EPSILON) {
|
||||||
right = glm::normalize(right - (glm::dot(right, Vectors::UNIT_Y) * Vectors::UNIT_Y));
|
right = glm::normalize(right - (glm::dot(right, Vectors::UNIT_Y) * Vectors::UNIT_Y));
|
||||||
|
|
|
@ -49,7 +49,7 @@ enum LocomotionRelativeMovementMode {
|
||||||
MOVEMENT_HMD_RELATIVE = 0,
|
MOVEMENT_HMD_RELATIVE = 0,
|
||||||
MOVEMENT_HAND_RELATIVE,
|
MOVEMENT_HAND_RELATIVE,
|
||||||
MOVEMENT_HAND_RELATIVE_LEVELED
|
MOVEMENT_HAND_RELATIVE_LEVELED
|
||||||
}
|
};
|
||||||
|
|
||||||
enum eyeContactTarget {
|
enum eyeContactTarget {
|
||||||
LEFT_EYE,
|
LEFT_EYE,
|
||||||
|
|
Loading…
Reference in a new issue