Pathfinding.Polygon.IsClockwiseMargin C# (CSharp) Method

IsClockwiseMargin() public static method

public static IsClockwiseMargin ( Int2 a, Int2 b, Int2 c ) : bool
a Int2
b Int2
c Int2
return bool
		public static bool IsClockwiseMargin (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::IsClockwiseMargin ( Int3 a, Int3 b, Int3 c ) : bool
Polygon::IsClockwiseMargin ( Vector3 a, Vector3 b, Vector3 c ) : bool

Usage Example

Ejemplo n.º 1
0
 public static bool ContainsPoint(TriangleMeshNode node, Vector3 pos, Int3[] vertices)
 {
     if (!Polygon.IsClockwiseMargin((Vector3)vertices[node.v0], (Vector3)vertices[node.v1], (Vector3)vertices[node.v2]))
     {
         Debug.LogError("Noes!");
     }
     return(Polygon.IsClockwiseMargin((Vector3)vertices[node.v0], (Vector3)vertices[node.v1], pos) && Polygon.IsClockwiseMargin((Vector3)vertices[node.v1], (Vector3)vertices[node.v2], pos) && Polygon.IsClockwiseMargin((Vector3)vertices[node.v2], (Vector3)vertices[node.v0], pos));
 }
All Usage Examples Of Pathfinding.Polygon::IsClockwiseMargin