mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 21:08:00 +02:00
initialize transform outside of switch statement
This commit is contained in:
parent
a2084259fa
commit
3f85e064b8
1 changed files with 2 additions and 1 deletions
|
@ -3413,6 +3413,7 @@ glm::vec3 MyAvatar::calculateScaledDirection(){
|
|||
auto handRotation = getOffHandRotation();
|
||||
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 transform;
|
||||
switch (getMovementReference()) {
|
||||
case LocomotionRelativeMovementMode::MOVEMENT_HAND_RELATIVE:
|
||||
forward = (handRotation * controllerForward);
|
||||
|
@ -3420,7 +3421,7 @@ glm::vec3 MyAvatar::calculateScaledDirection(){
|
|||
break;
|
||||
case LocomotionRelativeMovementMode::MOVEMENT_HAND_RELATIVE_LEVELED:
|
||||
forward = (handRotation * controllerForward);
|
||||
auto transform = forward - (glm::dot(forward, Vectors::UNIT_Y) * Vectors::UNIT_Y);
|
||||
transform = forward - (glm::dot(forward, Vectors::UNIT_Y) * Vectors::UNIT_Y);
|
||||
if (glm::length(transform) > EPSILON) {
|
||||
forward = glm::normalize(transform);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue