2
\$\begingroup\$

Should an AABB "contain" a point when the point is:

  • Exclusive: Only exactly inside the aabb

  • Inclusive: Inside the aabb or exactly on the sides

  • Almost: Inside the aabb or a little bit outside of the sides

eaabbe

\$\endgroup\$
4
\$\begingroup\$

Ultimately, it comes down to what you commonly check. To bring up a 4th alternative, I've used half-open intervals, so points belong to exactly one bounding box at a tight boundary.

bb.minX <= point.x < bb.maxX
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Inclusive, because when setting up containing boxes, if an object passes over the line it will be checked twice where your other methods would, and could easily not check a collision, or check too many and do a lot of extra work.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.