Ejemplo n.º 1
0
        /// <summary>
        /// Checks if all vertices are colinear preventing a normal computation. If point are coliniear the center vertex is
        /// moved in the direction of the edge to allow normal computations.
        /// </summary>
        /// <returns></returns>
        public bool CheckIfColinear()
        {
            RHVector3 d1    = vertices[1].pos.Subtract(vertices[0].pos);
            RHVector3 d2    = vertices[2].pos.Subtract(vertices[1].pos);
            double    angle = d1.Angle(d2);

            if (angle > 0.001 && angle < Math.PI - 0.001)
            {
                return(false);
            }
            return(true);
        }