mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 04:57:25 +02:00
Merge pull request #11675 from ZappoMan/fixRayPick
fix ray pick in cases where origin is inside of outer bounding box
This commit is contained in:
commit
815f680475
1 changed files with 3 additions and 2 deletions
|
@ -104,8 +104,9 @@ bool TriangleSet::TriangleOctreeCell::findRayIntersectionInternal(const glm::vec
|
|||
if (_bounds.findRayIntersection(origin, direction, boxDistance, face, surfaceNormal)) {
|
||||
|
||||
// if our bounding box intersects at a distance greater than the current known
|
||||
// best distance, than we can safely not check any of our triangles
|
||||
if (boxDistance > bestDistance) {
|
||||
// best distance, and our origin isn't inside the boounds, then we can safely
|
||||
// not check any of our triangles
|
||||
if (boxDistance > bestDistance && !_bounds.contains(origin)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue