mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 02:48:12 +02:00
more readable code
This commit is contained in:
parent
3f1944eb8a
commit
858b02f29d
1 changed files with 2 additions and 2 deletions
|
@ -601,8 +601,8 @@ EntityItemID EntityTreeElement::findRayIntersection(const glm::vec3& origin, con
|
||||||
|
|
||||||
// if the ray doesn't intersect with our cube OR the distance to element is less than current best distance
|
// if the ray doesn't intersect with our cube OR the distance to element is less than current best distance
|
||||||
// we can stop searching!
|
// we can stop searching!
|
||||||
if (!_cube.findRayIntersection(origin, direction, distanceToElementCube, localFace, localSurfaceNormal)
|
bool hit = _cube.findRayIntersection(origin, direction, distanceToElementCube, localFace, localSurfaceNormal);
|
||||||
|| (!_cube.contains(origin) && distanceToElementCube > distance)) {
|
if (!hit || (!_cube.contains(origin) && distanceToElementCube > distance)) {
|
||||||
keepSearching = false; // no point in continuing to search
|
keepSearching = false; // no point in continuing to search
|
||||||
return result; // we did not intersect
|
return result; // we did not intersect
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue