Hi,
I need to check if a bounds is encapsulated in another bounds function.
Thanks in advance!
Hi,
I need to check if a bounds is encapsulated in another bounds function.
Thanks in advance!
To extend the answer, you can extend the Bounds class to add a ContainBounds method
public static class Boundsxtension
{
public static bool ContainBounds(this Bounds bounds, Bounds target)
{
return bounds.Contains(target.min) && bounds.Contains(target.max);
}
}
static bool BoundsIsEncapsulated(Bounds Encapsulator, Bounds Encapsulating) { return Encapsulator.Contains(Encapsulating.min) && Encapsulator.Contains(Encapsulating.max); }