예제 #1
0
        public float AngleTo(JarvisElement other, Vector2 dir)
        {
            Vector2 v   = Direction(other);
            float   dot = Vector2.Dot(v, dir);

            return(Mathf.Acos(dot));
        }
예제 #2
0
        public float DistanceTo(JarvisElement other)
        {
            Vector2 v = mPoint - other.mPoint;

            return(v.magnitude);
        }
예제 #3
0
        public Vector2 Direction(JarvisElement other)
        {
            Vector2 v = mPoint - other.mPoint;

            return(v.normalized);
        }