private bool IsSaccading(Ray rayOld, Ray rayNew)
        {
            using (IsSaccadingPerfMarker.Auto())
            {
                Vector3 v1 = rayOld.origin + rayOld.direction;
                Vector3 v2 = rayNew.origin + rayNew.direction;

                if (Vector3.Angle(v1, v2) > saccadeThreshInDegree)
                {
                    Vector2 hv1 = new Vector2(v1.x, 0);
                    Vector2 hv2 = new Vector2(v2.x, 0);
                    if (OnSaccadeX != null && Vector2.Angle(hv1, hv2) > saccadeThreshInDegree)
                    {
                        OnSaccadeX.Invoke();
                    }

                    Vector2 vv1 = new Vector2(0, v1.y);
                    Vector2 vv2 = new Vector2(0, v2.y);
                    if (OnSaccadeY != null && Vector2.Angle(vv1, vv2) > saccadeThreshInDegree)
                    {
                        OnSaccadeY.Invoke();
                    }

                    PostOnSaccade();

                    return(true);
                }
                return(false);
            }
        }
예제 #2
0
 private void Post_OnSaccadeVertically()
 {
     OnSaccadeY?.Invoke();
 }
예제 #3
0
 private void PostOnSaccadeVertically() => OnSaccadeY?.Invoke();
 private void GazeSmoother_OnSaccadeY() => OnSaccadeY?.Invoke();