mirror of
https://github.com/lubosz/overte.git
synced 2025-04-18 04:18:17 +02:00
handle case where AAEllipsoid is entirely inside the AABox
This commit is contained in:
parent
6f6343420c
commit
9789476a73
1 changed files with 6 additions and 0 deletions
|
@ -437,6 +437,7 @@ glm::vec3 AABox::getClosestPointOnFace(const glm::vec4& origin, const glm::vec4&
|
|||
}
|
||||
|
||||
bool AABox::touchesAAEllipsoid(const glm::vec3& center, glm::vec3 radials) const {
|
||||
// handle case where ellipsoid's alix-aligned box doesn't touch this AABox
|
||||
if (_corner.x - radials.x > center.x ||
|
||||
_corner.y - radials.y > center.y ||
|
||||
_corner.z - radials.z > center.z ||
|
||||
|
@ -446,6 +447,11 @@ bool AABox::touchesAAEllipsoid(const glm::vec3& center, glm::vec3 radials) const
|
|||
return false;
|
||||
}
|
||||
|
||||
// handle case where ellipsoid is entirely inside this AABox
|
||||
if (contains(center)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < FACE_COUNT; i++) {
|
||||
glm::vec3 closest = getClosestPointOnFace(center, (BoxFace)i) - center;
|
||||
float x = closest.x;
|
||||
|
|
Loading…
Reference in a new issue