Added a default StateSet to osg::View's master Camera. Wired up osgViewer::Viewer so

that the master Camera's StateSet is passed to osgUtil::SceneView to use as its global StateSet.
This commit is contained in:
Robert Osfield
2007-01-12 12:10:06 +00:00
parent 5c030413f3
commit 5c78d06dad
4 changed files with 9 additions and 13 deletions

View File

@@ -12,6 +12,7 @@
*/
#include <osg/View>
#include <osg/Notify>
#include <osg/TexEnv>
using namespace osg;
@@ -20,8 +21,12 @@ View::View()
// osg::notify(osg::NOTICE)<<"Constructing osg::View"<<std::endl;
setCamera(new osg::Camera);
_camera->setProjectionMatrixAsFrustum(-0.325, 0.325, -0.26, 0.26, 1.0f,10000.0f);
_camera->setClearColor(osg::Vec4f(0.2f, 0.2f, 0.4f, 1.0f));
osg::StateSet* stateset = _camera->getOrCreateStateSet();
stateset->setGlobalDefaults();
}
View::~View()