mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 19:03:07 +02:00
Fix overlay findRayIntersection not properly handing multiple drawInFront overlays
This commit is contained in:
parent
9880d40cfb
commit
8a1bd781f0
1 changed files with 3 additions and 1 deletions
|
@ -431,7 +431,9 @@ RayToOverlayIntersectionResult Overlays::findRayIntersectionInternal(const PickR
|
||||||
if (thisOverlay->findRayIntersectionExtraInfo(ray.origin, ray.direction, thisDistance,
|
if (thisOverlay->findRayIntersectionExtraInfo(ray.origin, ray.direction, thisDistance,
|
||||||
thisFace, thisSurfaceNormal, thisExtraInfo)) {
|
thisFace, thisSurfaceNormal, thisExtraInfo)) {
|
||||||
bool isDrawInFront = thisOverlay->getDrawInFront();
|
bool isDrawInFront = thisOverlay->getDrawInFront();
|
||||||
if (thisDistance < bestDistance && (!bestIsFront || isDrawInFront)) {
|
if ((bestIsFront && isDrawInFront && thisDistance < bestDistance)
|
||||||
|
|| (!bestIsFront && (isDrawInFront || thisDistance < bestDistance))) {
|
||||||
|
|
||||||
bestIsFront = isDrawInFront;
|
bestIsFront = isDrawInFront;
|
||||||
bestDistance = thisDistance;
|
bestDistance = thisDistance;
|
||||||
result.intersects = true;
|
result.intersects = true;
|
||||||
|
|
Loading…
Reference in a new issue