Original Post
I would like to keep an AABB 'A' inside the bounds of another AABB 'B'.
First of all I run a test to see if 'A' is fully contained inside 'B':
Now in order to find the penetration/overlap value I can't use my standard AABB/AABB test as that pushes the box 'A' outside 'B' rather than keeping it inside.
How can I find the penetration value that keeps 'A' inside 'B'?
First of all I run a test to see if 'A' is fully contained inside 'B':
public bool Contains(CD_AABB aABB) { return MinPoint.X <= aABB.MinPoint.X && aABB.MaxPoint.X <= MaxPoint.X && MinPoint.Y <= aABB.MinPoint.Y && aABB.MaxPoint.Y <= MaxPoint.Y && MinPoint.Z <= aABB.MinPoint.Z && aABB.MaxPoint.Z <= MaxPoint.Z; }Now in order to find the penetration/overlap value I can't use my standard AABB/AABB test as that pushes the box 'A' outside 'B' rather than keeping it inside.
How can I find the penetration value that keeps 'A' inside 'B'?