Pathfinding.Polygon.IsColinear C# (CSharp) Method

IsColinear() public static method

public static IsColinear ( Int3 a, Int3 b, Int3 c ) : bool
a Int3
b Int3
c Int3
return bool
		public static bool IsColinear (Int3 a, Int3 b, Int3 c) {
			return (long)(b.x - a.x) * (long)(c.z - a.z) - (long)(c.x - a.x) * (long)(b.z - a.z) == 0;
		}
		

Same methods

Polygon::IsColinear ( Vector3 a, Vector3 b, Vector3 c ) : bool

Usage Example

Ejemplo n.º 1
0
 public int GetColinearEdge(Int3 a, Int3 b, int startEdge, int count)
 {
     Int3[] staticVerts = TriangleMeshNode._staticVerts;
     this.GetPoints(out staticVerts[0], out staticVerts[1], out staticVerts[2]);
     for (int i = 0; i < count; i++)
     {
         int num  = (startEdge + i) % 3;
         int num2 = (num + 1) % 3;
         if (Polygon.IsColinear(staticVerts[num], staticVerts[num2], a) && Polygon.IsColinear(staticVerts[num], staticVerts[num2], b))
         {
             return(num);
         }
     }
     return(-1);
 }
All Usage Examples Of Pathfinding.Polygon::IsColinear