mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 13:56:24 +02:00
MyAvatar: use coneSphereAngle for eyeTracking look at targets
This commit is contained in:
parent
d9063b199e
commit
71f67c99cc
1 changed files with 2 additions and 1 deletions
|
@ -911,7 +911,8 @@ void MyAvatar::updateLookAtTargetAvatar() {
|
|||
avatar->setIsLookAtTarget(false);
|
||||
if (!avatar->isMyAvatar() && avatar->isInitialized() &&
|
||||
(distanceTo < GREATEST_LOOKING_AT_DISTANCE * getUniformScale())) {
|
||||
float angleTo = glm::angle(lookForward, glm::normalize(avatar->getHead()->getEyePosition() - getHead()->getEyePosition()));
|
||||
float radius = glm::length(avatar->getHead()->getEyePosition() - avatar->getHead()->getRightEyePosition());
|
||||
float angleTo = coneSphereAngle(getHead()->getEyePosition(), lookForward, avatar->getHead()->getEyePosition(), radius);
|
||||
if (angleTo < (smallestAngleTo * (isCurrentTarget ? KEEP_LOOKING_AT_CURRENT_ANGLE_FACTOR : 1.0f))) {
|
||||
_lookAtTargetAvatar = avatarPointer;
|
||||
_targetAvatarPosition = avatarPointer->getPosition();
|
||||
|
|
Loading…
Reference in a new issue