mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 00:43:30 +02:00
reset only pitch and roll on spacebar so that you don’t turn away from someone
This commit is contained in:
parent
8f4fb04021
commit
e439694d72
1 changed files with 5 additions and 1 deletions
|
@ -99,7 +99,11 @@ void MyAvatar::reset() {
|
|||
|
||||
setVelocity(glm::vec3(0.0f));
|
||||
setThrust(glm::vec3(0.0f));
|
||||
setOrientation(glm::quat(glm::vec3(0.0f)));
|
||||
// Reset the pitch and roll components of the avatar's orientation, preserve yaw direction
|
||||
glm::vec3 eulers = safeEulerAngles(getOrientation());
|
||||
eulers.x = 0.f;
|
||||
eulers.z = 0.f;
|
||||
setOrientation(glm::quat(eulers));
|
||||
}
|
||||
|
||||
void MyAvatar::update(float deltaTime) {
|
||||
|
|
Loading…
Reference in a new issue