/// <summary> /// Check whether an edge cuts through the W=0 plane /// </summary> /// <param name="a">Point a that describes the side</param> /// <param name="b">Point b that describes the side</param> /// <param name="sides">A list of all vertices</param> /// <returns>1 if it cuts through 0 if it doesn't</returns> private int SingleSide(float4 a, float4 b, List <float3> verts) { //check wheter or not one is lower then 0 in w if (a.w * b.w <= 0) { float3 result = a.LerpByW(b); verts.Add(result); return(verts.Count - 1); } return(-1); }