Various additions to better support view dependent overlay node, and updated wrappers

This commit is contained in:
Robert Osfield
2007-05-19 13:43:38 +00:00
parent e3747b1004
commit e37ec98748
8 changed files with 446 additions and 40 deletions

View File

@@ -59,13 +59,26 @@ class OSG_EXPORT Polytope
/** Create a Polytope which is a cube, centered at 0,0,0, with sides of 2 units.*/
void setToUnitFrustum(bool withNear=true, bool withFar=true)
{
_planeList.erase(_planeList.begin(),_planeList.end());
_planeList.push_back(Plane(1.0f,0.0f,0.0f,1.0f)); // left plane.
_planeList.push_back(Plane(-1.0f,0.0f,0.0f,1.0f)); // right plane.
_planeList.push_back(Plane(0.0f,1.0f,0.0f,1.0f)); // bottom plane.
_planeList.push_back(Plane(0.0f,-1.0f,0.0f,1.0f)); // top plane.
if (withNear) _planeList.push_back(Plane(0.0f,0.0f,-1.0f,1.0f)); // near plane
if (withFar) _planeList.push_back(Plane(0.0f,0.0f,1.0f,1.0f)); // far plane
_planeList.clear();
_planeList.push_back(Plane(1.0,0.0,0.0,1.0)); // left plane.
_planeList.push_back(Plane(-1.0,0.0,0.0,1.0)); // right plane.
_planeList.push_back(Plane(0.0,1.0,0.0,1.0)); // bottom plane.
_planeList.push_back(Plane(0.0,-1.0,0.0,1.0)); // top plane.
if (withNear) _planeList.push_back(Plane(0.0,0.0,-1.0,1.0)); // near plane
if (withFar) _planeList.push_back(Plane(0.0,0.0,1.0,1.0)); // far plane
setupMask();
}
/** Create a Polytope which is a equivilant to BoundingBox.*/
void setToBoundingBox(const BoundingBox& bb)
{
_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
setupMask();
}