mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
Merge pull request #4854 from ctrlaltdavid/fix-facetracker-rotation
Fix facetracker rotation
This commit is contained in:
commit
0d00393eff
2 changed files with 2 additions and 2 deletions
|
@ -388,7 +388,7 @@ void DdeFaceTracker::decodePacket(const QByteArray& buffer) {
|
|||
// Compute relative rotation
|
||||
rotation = glm::inverse(_referenceRotation) * rotation;
|
||||
if (isFiltering) {
|
||||
glm::quat r = rotation * glm::inverse(_headRotation);
|
||||
glm::quat r = glm::normalize(rotation * glm::inverse(_headRotation));
|
||||
float theta = 2 * acos(r.w);
|
||||
glm::vec3 angularVelocity;
|
||||
if (theta > EPSILON) {
|
||||
|
|
|
@ -213,7 +213,7 @@ void Faceshift::receive(const QByteArray& buffer) {
|
|||
glm::quat newRotation = glm::quat(data.m_headRotation.w, -data.m_headRotation.x,
|
||||
data.m_headRotation.y, -data.m_headRotation.z);
|
||||
// Compute angular velocity of the head
|
||||
glm::quat r = newRotation * glm::inverse(_headRotation);
|
||||
glm::quat r = glm::normalize(newRotation * glm::inverse(_headRotation));
|
||||
float theta = 2 * acos(r.w);
|
||||
if (theta > EPSILON) {
|
||||
float rMag = glm::length(glm::vec3(r.x, r.y, r.z));
|
||||
|
|
Loading…
Reference in a new issue