1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0029791: Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped

SelectMgr_RectangularFrustum::computeClippingRange() fix skipping depth range starting behind the ray.
This commit is contained in:
kgv
2018-05-24 20:10:32 +03:00
committed by abv
parent 3e782664b8
commit fad3eca77f
2 changed files with 26 additions and 8 deletions

View File

@@ -675,18 +675,15 @@ void SelectMgr_RectangularFrustum::computeClippingRange (const Graphic3d_Sequenc
}
// compute distance to point of pick line intersection with the plane
Standard_Real aParam = aDistance / aDotProduct;
// check if ray intersects the plane, in case aIntDist < 0
// the plane is "behind" the ray
const Standard_Real aParam = aDistance / aDotProduct;
const gp_Pnt anIntersectionPt = myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * aParam;
Standard_Real aDistToPln = anIntersectionPt.Distance (myNearPickedPnt);
if (aParam < 0.0)
{
continue;
// the plane is "behind" the ray
aDistToPln = -aDistToPln;
}
const gp_Pnt anIntersectionPt = myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * aParam;
const Standard_Real aDistToPln = anIntersectionPt.Distance (myNearPickedPnt);
// change depth limits for case of opposite and directed planes
if (aDotProduct < 0.0)
{