BEPUutilities2.ConvexHullHelper.IsTriangleVisibleFromPoint C# (CSharp) 메소드

IsTriangleVisibleFromPoint() 개인적인 메소드

private IsTriangleVisibleFromPoint ( QuickList &indices, QuickList &points, int triangleIndex, Vector3 &point ) : bool
indices QuickList
points QuickList
triangleIndex int
point Vector3
리턴 bool
        private static bool IsTriangleVisibleFromPoint(ref QuickList<int> indices, ref QuickList<Vector3> points, int triangleIndex, ref Vector3 point)
        {
            //Compute the normal of the triangle.
            var a = points.Elements[indices.Elements[triangleIndex]];
            Vector3 ab = points.Elements[indices.Elements[triangleIndex + 1]] - a;
            Vector3 ac = points.Elements[indices.Elements[triangleIndex + 2]] - a;
            Vector3 normal;
            Vector3x.Cross(ref ac, ref ab, out normal);
            //Assume a consistent winding.  Check to see if the normal points at the point.
            Vector3 offset = point - a;
            float dot = Vector3.Dot(offset, normal);
            return dot >= 0;
        }