mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:20:08 +02:00
cleaning up the code
This commit is contained in:
parent
9f1f0798cb
commit
571ccb3c20
1 changed files with 0 additions and 22 deletions
|
@ -441,14 +441,6 @@ void MyAvatar::updateFromTrackers(float deltaTime) {
|
||||||
estimatedPosition = tracker->getHeadTranslation();
|
estimatedPosition = tracker->getHeadTranslation();
|
||||||
_trackedHeadPosition = estimatedPosition;
|
_trackedHeadPosition = estimatedPosition;
|
||||||
estimatedRotation = glm::degrees(safeEulerAngles(tracker->getHeadRotation()));
|
estimatedRotation = glm::degrees(safeEulerAngles(tracker->getHeadRotation()));
|
||||||
/* if (qApp->getCamera()->getMode() == CAMERA_MODE_MIRROR) {
|
|
||||||
// Invert yaw and roll when in mirror mode
|
|
||||||
// NOTE: this is kinda a hack, it's the same hack we use to make the head tilt. But it's not really a mirror
|
|
||||||
// it just makes you feel like you're looking in a mirror because the body movements of the avatar appear to
|
|
||||||
// match your body movements.
|
|
||||||
YAW(estimatedRotation) *= -1.0f;
|
|
||||||
ROLL(estimatedRotation) *= -1.0f;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rotate the body if the head is turned beyond the screen
|
// Rotate the body if the head is turned beyond the screen
|
||||||
|
@ -489,14 +481,6 @@ void MyAvatar::updateFromTrackers(float deltaTime) {
|
||||||
const float TORSO_LENGTH = 0.5f;
|
const float TORSO_LENGTH = 0.5f;
|
||||||
glm::vec3 relativePosition = estimatedPosition - glm::vec3(0.0f, -TORSO_LENGTH, 0.0f);
|
glm::vec3 relativePosition = estimatedPosition - glm::vec3(0.0f, -TORSO_LENGTH, 0.0f);
|
||||||
|
|
||||||
// Invert left/right lean when in mirror mode
|
|
||||||
// NOTE: this is kinda a hack, it's the same hack we use to make the head tilt. But it's not really a mirror
|
|
||||||
// it just makes you feel like you're looking in a mirror because the body movements of the avatar appear to
|
|
||||||
// match your body movements.
|
|
||||||
/* if ((inHmd || inFacetracker) && qApp->getCamera()->getMode() == CAMERA_MODE_MIRROR) {
|
|
||||||
relativePosition.x = -relativePosition.x;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
const float MAX_LEAN = 45.0f;
|
const float MAX_LEAN = 45.0f;
|
||||||
head->setLeanSideways(glm::clamp(glm::degrees(atanf(relativePosition.x * _leanScale / TORSO_LENGTH)),
|
head->setLeanSideways(glm::clamp(glm::degrees(atanf(relativePosition.x * _leanScale / TORSO_LENGTH)),
|
||||||
-MAX_LEAN, MAX_LEAN));
|
-MAX_LEAN, MAX_LEAN));
|
||||||
|
@ -1401,12 +1385,6 @@ void MyAvatar::updateOrientation(float deltaTime) {
|
||||||
// ... so they need to be converted to degrees before we do math...
|
// ... so they need to be converted to degrees before we do math...
|
||||||
glm::vec3 euler = glm::eulerAngles(localOrientation) * DEGREES_PER_RADIAN;
|
glm::vec3 euler = glm::eulerAngles(localOrientation) * DEGREES_PER_RADIAN;
|
||||||
|
|
||||||
//Invert yaw and roll when in mirror mode
|
|
||||||
/* if (qApp->getCamera()->getMode() == CAMERA_MODE_MIRROR) {
|
|
||||||
YAW(euler) *= -1.0f;
|
|
||||||
ROLL(euler) *= -1.0f;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Head* head = getHead();
|
Head* head = getHead();
|
||||||
head->setBaseYaw(YAW(euler));
|
head->setBaseYaw(YAW(euler));
|
||||||
head->setBasePitch(PITCH(euler));
|
head->setBasePitch(PITCH(euler));
|
||||||
|
|
Loading…
Reference in a new issue