mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:57:13 +02:00
Don't display mini tablet in peripheral vision
This commit is contained in:
parent
c27bb04596
commit
fe8c237d64
1 changed files with 4 additions and 1 deletions
|
@ -545,8 +545,10 @@
|
||||||
|
|
||||||
// Visibility.
|
// Visibility.
|
||||||
MIN_HAND_CAMERA_ANGLE = 30,
|
MIN_HAND_CAMERA_ANGLE = 30,
|
||||||
|
MAX_CAMERA_HAND_ANGLE = 30,
|
||||||
DEGREES_180 = 180,
|
DEGREES_180 = 180,
|
||||||
MIN_HAND_CAMERA_ANGLE_COS = Math.cos(Math.PI * MIN_HAND_CAMERA_ANGLE / DEGREES_180);
|
MIN_HAND_CAMERA_ANGLE_COS = Math.cos(Math.PI * MIN_HAND_CAMERA_ANGLE / DEGREES_180),
|
||||||
|
MAX_CAMERA_HAND_ANGLE_COS = Math.cos(Math.PI * MAX_CAMERA_HAND_ANGLE / DEGREES_180);
|
||||||
|
|
||||||
|
|
||||||
function enterMiniDisabled() {
|
function enterMiniDisabled() {
|
||||||
|
@ -640,6 +642,7 @@
|
||||||
show = Vec3.dot(miniToCameraDirection, Quat.getForward(miniOrientation)) > MIN_HAND_CAMERA_ANGLE_COS;
|
show = Vec3.dot(miniToCameraDirection, Quat.getForward(miniOrientation)) > MIN_HAND_CAMERA_ANGLE_COS;
|
||||||
show = show || (-Vec3.dot(miniToCameraDirection, Quat.getForward(handOrientation)) > MIN_HAND_CAMERA_ANGLE_COS);
|
show = show || (-Vec3.dot(miniToCameraDirection, Quat.getForward(handOrientation)) > MIN_HAND_CAMERA_ANGLE_COS);
|
||||||
cameraToHand = -Vec3.dot(miniToCameraDirection, Quat.getForward(Camera.orientation));
|
cameraToHand = -Vec3.dot(miniToCameraDirection, Quat.getForward(Camera.orientation));
|
||||||
|
show = show && (cameraToHand > MAX_CAMERA_HAND_ANGLE_COS);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue