correct the sign of yaw for oculus

This commit is contained in:
Stephen Birarda 2013-05-22 18:56:38 -07:00
parent a8ef537fe0
commit 997a10c981
3 changed files with 6 additions and 6 deletions

View file

@ -1377,7 +1377,7 @@ void Application::updateAvatar(float deltaTime) {
float yaw, pitch, roll;
OculusManager::getEulerAngles(yaw, pitch, roll);
_myAvatar.getHead().setYaw(-yaw);
_myAvatar.getHead().setYaw(yaw);
_myAvatar.getHead().setPitch(pitch);
_myAvatar.getHead().setRoll(roll);
}

View file

@ -131,12 +131,12 @@ void Head::calculateGeometry(bool lookingInMirror) {
//generate orientation directions based on Euler angles...
float pitch = _pitch;
float yaw = -_yaw;
float roll = -_roll;
float yaw = _yaw;
float roll = _roll;
if (lookingInMirror) {
yaw = _yaw;
roll = _roll;
yaw = -_yaw;
roll = -_roll;
}
_orientation.setToIdentity();

View file

@ -38,7 +38,7 @@ void OculusManager::connect() {
void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) {
#ifdef __APPLE__
_sensorFusion.GetOrientation().GetEulerAngles<Axis_Y, Axis_X, Axis_Z, Rotate_CW, Handed_R>(&yaw, &pitch, &roll);
_sensorFusion.GetOrientation().GetEulerAngles<Axis_Y, Axis_X, Axis_Z, Rotate_CCW, Handed_R>(&yaw, &pitch, &roll);
// convert each angle to degrees
yaw = glm::degrees(yaw);