From 8a5d7f9bfb01910f0c922359c260d1c3a4e2bae3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 6 Aug 2002 10:04:06 +0000 Subject: [PATCH] Adde getViewFrustum() to camera. --- include/osg/Camera | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/osg/Camera b/include/osg/Camera index 3e30dce76..e49c8d69f 100644 --- a/include/osg/Camera +++ b/include/osg/Camera @@ -12,6 +12,7 @@ #include #include #include +#include namespace osg { @@ -271,8 +272,15 @@ class SG_EXPORT Camera: public osg::Referenced const Matrix getModelViewMatrix() const; - - + /** Get the camera view frsutm.*/ + inline Polytope getViewFrustum() const + { + Polytope cv; + cv.setToUnitFrustum(); + cv.transformProvidingInverse(getModelViewMatrix()* + getProjectionMatrix()); + return cv; + }