Adde getViewFrustum() to camera.

This commit is contained in:
Robert Osfield
2002-08-06 10:04:06 +00:00
parent 25740b5c7f
commit 8a5d7f9bfb

View File

@@ -12,6 +12,7 @@
#include <osg/Quat>
#include <osg/Viewport>
#include <osg/DisplaySettings>
#include <osg/Polytope>
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;
}