mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:12:46 +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 {
|
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 ||
|
if (_corner.x - radials.x > center.x ||
|
||||||
_corner.y - radials.y > center.y ||
|
_corner.y - radials.y > center.y ||
|
||||||
_corner.z - radials.z > center.z ||
|
_corner.z - radials.z > center.z ||
|
||||||
|
@ -446,6 +447,11 @@ bool AABox::touchesAAEllipsoid(const glm::vec3& center, glm::vec3 radials) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handle case where ellipsoid is entirely inside this AABox
|
||||||
|
if (contains(center)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < FACE_COUNT; i++) {
|
for (int i = 0; i < FACE_COUNT; i++) {
|
||||||
glm::vec3 closest = getClosestPointOnFace(center, (BoxFace)i) - center;
|
glm::vec3 closest = getClosestPointOnFace(center, (BoxFace)i) - center;
|
||||||
float x = closest.x;
|
float x = closest.x;
|
||||||
|
|
Loading…
Reference in a new issue