Added foveal FOV representation for POV cam

This commit is contained in:
Thorbjoern
2025-07-20 05:35:05 +02:00
parent 2dfa84a0e8
commit 2fa634255a
5 changed files with 464 additions and 6 deletions
@@ -13,6 +13,7 @@ public class FieldOfView : MonoBehaviour
public Transform eyeLeft;
public Transform eyeRight;
public Transform eyeCenter;
public LayerMask targetMask;
public LayerMask obstacleMask;
@@ -40,6 +41,7 @@ public class FieldOfView : MonoBehaviour
private void LateUpdate()
{
Vector3 gazeDirection = ((eyeLeft.forward + eyeRight.forward) * 0.5f).normalized;
eyeCenter.rotation = Quaternion.LookRotation(gazeDirection);
float gazeAngle = AngleFromDir(gazeDirection, true);
DrawFOV(transform.eulerAngles.y, periMesh, periAngle);
DrawFOV(gazeAngle, foveaMesh, foveaAngle);