Pathfinding.Polygon.ContainsPoint C# (CSharp) Method

ContainsPoint() public static method

public static ContainsPoint ( Int2 a, Int2 b, Int2 c, Int2 p ) : bool
a Int2
b Int2
c Int2
p Int2
return bool
		public static bool ContainsPoint (Int2 a, Int2 b, Int2 c, Int2 p) {
			return Polygon.IsClockwiseMargin (a,b, p) && Polygon.IsClockwiseMargin (b,c, p) && Polygon.IsClockwiseMargin (c,a, p);
		}
		

Same methods

Polygon::ContainsPoint ( Int3 a, Int3 b, Int3 c, Int3 p ) : bool
Polygon::ContainsPoint ( Vector2 polyPoints, Vector2 p ) : bool
Polygon::ContainsPoint ( Vector3 polyPoints, Vector3 p ) : bool
Polygon::ContainsPoint ( Vector3 a, Vector3 b, Vector3 c, 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::ContainsPoint