Example #1
0
        /// <summary>
        /// Winding number test for a point in a simplex.
        /// </summary>
        /// <param name="point">The point to be tested.</param>
        /// <param name="edge">The edge that the point is tested against.</param>
        /// <returns>False if the winding number is even and the point is outside
        /// the simplex and True otherwise.</returns>
        private static bool PointInSimplex(FPVector2 point, Edge edge)
        {
            Vertices polygon = new Vertices();

            polygon.Add(FPVector2.zero);
            polygon.Add(edge.EdgeStart);
            polygon.Add(edge.EdgeEnd);
            return(polygon.PointInPolygon(ref point) == 1);
        }