mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-14 17:13:15 +02:00
reset works if you're looking straight down
This commit is contained in:
parent
be7053d208
commit
6c40b48204
1 changed files with 1 additions and 1 deletions
|
@ -137,7 +137,7 @@ void OpenVrDisplayPlugin::resetSensors() {
|
|||
vec3 zAxis = vec3(pose[2]);
|
||||
|
||||
// cancel out the roll and pitch
|
||||
vec3 newZ = glm::normalize(vec3(zAxis.x, 0, zAxis.z));
|
||||
vec3 newZ = (zAxis.x == 0 && zAxis.z == 0) ? vec3(1, 0, 0) : glm::normalize(vec3(zAxis.x, 0, zAxis.z));
|
||||
vec3 newX = glm::cross(vec3(0, 1, 0), newZ);
|
||||
vec3 newY = glm::cross(newZ, newX);
|
||||
|
||||
|
|
Loading…
Reference in a new issue