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