mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 22:16:39 +02:00
Fix for AABox::touches(otherBox)
This commit is contained in:
parent
31a2e467f4
commit
2fa3fc523d
1 changed files with 4 additions and 4 deletions
|
@ -119,10 +119,10 @@ bool AABox::contains(const AABox& otherBox) const {
|
||||||
|
|
||||||
bool AABox::touches(const AABox& otherBox) const {
|
bool AABox::touches(const AABox& otherBox) const {
|
||||||
glm::vec3 relativeCenter = _corner - otherBox._corner + (glm::vec3(_scale - otherBox._scale) * 0.5f);
|
glm::vec3 relativeCenter = _corner - otherBox._corner + (glm::vec3(_scale - otherBox._scale) * 0.5f);
|
||||||
float totalScale = _scale + otherBox._scale;
|
float totalHalfScale = 0.5f * (_scale + otherBox._scale);
|
||||||
return fabs(relativeCenter.x) <= totalScale &&
|
return fabs(relativeCenter.x) <= totalHalfScale &&
|
||||||
fabs(relativeCenter.y) <= totalScale &&
|
fabs(relativeCenter.y) <= totalHalfScale &&
|
||||||
fabs(relativeCenter.z) <= totalScale;
|
fabs(relativeCenter.z) <= totalHalfScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
// determines whether a value is within the expanded extents
|
// determines whether a value is within the expanded extents
|
||||||
|
|
Loading…
Reference in a new issue