mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 15:59:49 +02:00
Simplify lookForward compute
This commit is contained in:
parent
682b3f5e61
commit
e37ef226fc
1 changed files with 1 additions and 7 deletions
|
@ -892,13 +892,7 @@ void MyAvatar::updateLookAtTargetAvatar() {
|
||||||
_lookAtTargetAvatar.clear();
|
_lookAtTargetAvatar.clear();
|
||||||
_targetAvatarPosition = glm::vec3(0.0f);
|
_targetAvatarPosition = glm::vec3(0.0f);
|
||||||
|
|
||||||
glm::quat faceRotation = Application::getInstance()->getViewFrustum()->getOrientation();
|
glm::vec3 lookForward = getHead()->getFinalOrientationInWorldFrame() * IDENTITY_FRONT;
|
||||||
FaceTracker* tracker = Application::getInstance()->getActiveFaceTracker();
|
|
||||||
if (tracker) {
|
|
||||||
// If faceshift or other face tracker in use, add on the actual angle of the head
|
|
||||||
faceRotation *= tracker->getHeadRotation();
|
|
||||||
}
|
|
||||||
glm::vec3 lookForward = faceRotation * IDENTITY_FRONT;
|
|
||||||
glm::vec3 cameraPosition = Application::getInstance()->getCamera()->getPosition();
|
glm::vec3 cameraPosition = Application::getInstance()->getCamera()->getPosition();
|
||||||
|
|
||||||
float smallestAngleTo = glm::radians(Application::getInstance()->getCamera()->getFieldOfView()) / 2.0f;
|
float smallestAngleTo = glm::radians(Application::getInstance()->getCamera()->getFieldOfView()) / 2.0f;
|
||||||
|
|
Loading…
Reference in a new issue