using UnityEngine;

public class GazeDirection : MonoBehaviour
{
    [Header("Head and Eye-Transforms")]
    public Transform headcam;
    public Transform eyeLeft;
    public Transform eyeRight;

    [Header("Renderer Feature")]
    public GazeOverlayRendererFeature overlayRendererFeature;

    GazeOverlayRendererFeature.GazeRenderPass pass;

    private void Awake()
    {
        pass = overlayRendererFeature.GetPass();
    }

    private void LateUpdate()
    {
        pass.gazeOrigin = (eyeLeft.position + eyeRight.position) * 0.5f; // Mittelpunkt zwischen den Augen
        pass.gazeDirection = ((eyeLeft.forward + eyeRight.forward) * 0.5f).normalized; // Errechnete mittlere Blickrichtung
    }
}
