From 6cabb0b0127696f906a558cb83fcd8e395c493d9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 24 Dec 2020 09:45:00 +0000 Subject: [PATCH] Added near/far flags to Polytope::setToBoundingBox(). --- include/osg/Polytope | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/osg/Polytope b/include/osg/Polytope index c3dceceb3..04a9c35b3 100644 --- a/include/osg/Polytope +++ b/include/osg/Polytope @@ -70,15 +70,15 @@ class OSG_EXPORT Polytope } /** Create a Polytope which is a equivalent to BoundingBox.*/ - void setToBoundingBox(const BoundingBox& bb) + void setToBoundingBox(const BoundingBox& bb, bool withNear=true, bool withFar=true) { _planeList.clear(); _planeList.push_back(Plane(1.0,0.0,0.0,-bb.xMin())); // left plane. _planeList.push_back(Plane(-1.0,0.0,0.0,bb.xMax())); // right plane. _planeList.push_back(Plane(0.0,1.0,0.0,-bb.yMin())); // bottom plane. _planeList.push_back(Plane(0.0,-1.0,0.0,bb.yMax())); // top plane. - _planeList.push_back(Plane(0.0,0.0,1.0,-bb.zMin())); // near plane - _planeList.push_back(Plane(0.0,0.0,-1.0,bb.zMax())); // far plane + if (withNear) _planeList.push_back(Plane(0.0,0.0,1.0,-bb.zMin())); // near plane + if (withFar) _planeList.push_back(Plane(0.0,0.0,-1.0,bb.zMax())); // far plane setupMask(); }