public static bool IsPointWithinFaceExtrusion(Vector3 point, List<Plane> planes, Vector3 centroid)
{
foreach (Plane plane in planes)
{
float centroidPlaneDot;
plane.DotCoordinate(ref centroid, out centroidPlaneDot);
float pointPlaneDot;
plane.DotCoordinate(ref point, out pointPlaneDot);
if (!((centroidPlaneDot <= Epsilon && pointPlaneDot <= Epsilon) || (centroidPlaneDot >= -Epsilon && pointPlaneDot >= -Epsilon)))
{
//Point's NOT the same side of the centroid, so it's 'outside.'
return false;
}
}
return true;
}