Pathfinding.Polygon.Left C# (CSharp) Method

Left() public static method

public static Left ( Int2 a, Int2 b, Int2 c ) : bool
a Int2
b Int2
c Int2
return bool
		public static bool Left (Int2 a, Int2 b, Int2 c) {
			return (long)(b.x - a.x) * (long)(c.y - a.y) - (long)(c.x - a.x) * (long)(b.y - a.y) <= 0;
		}
		

Same methods

Polygon::Left ( Int3 a, Int3 b, Int3 c ) : bool
Polygon::Left ( Vector3 a, Vector3 b, Vector3 p ) : bool

Usage Example

Ejemplo n.º 1
0
        public bool Contains(GraphNode node)
        {
            Vector3 point = (Vector3)node.position;

            //Debug.DrawRay (node.position,-Vector3.up*2,Color.magenta);

            if (convex)
            {
                if (_convexPoints == null)
                {
                    return(false);
                }

                for (int i = 0, j = _convexPoints.Length - 1; i < _convexPoints.Length; j = i, i++)
                {
                    if (Polygon.Left(_convexPoints[i], _convexPoints[j], point))
                    {
                        return(false);
                    }
                }
            }
            else
            {
                if (_points == null)
                {
                    return(false);
                }

                return(Polygon.ContainsPoint(_points, point));
            }

            //Debug.DrawRay (node.position,Vector3.up*2,Color.blue);

            return(true);
        }
All Usage Examples Of Pathfinding.Polygon::Left