4 #include <osg/PolygonMode>
5 #include <osg/ShapeDrawable>
26 virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
28 osgUtil::CullVisitor* cv =
dynamic_cast<osgUtil::CullVisitor*
>(nv);
29 osg::ref_ptr<osg::Geode> geometry =
dynamic_cast<osg::Geode*
> (node);
33 osg::Matrixd view(cv->getCurrentCamera()->getViewMatrix());
34 osg::Matrixd invViewMatrix = osg::Matrixd::inverse(view);
35 osg::Matrixd modelview(*cv->getModelViewMatrix());
36 osg::Matrixd model = modelview*invViewMatrix;
37 osg::Matrixd proj(cv->getCurrentCamera()->getProjectionMatrix());
39 geometry->getOrCreateStateSet()->getUniform(
"ModelMatrix")->set(model);
40 geometry->getOrCreateStateSet()->getUniform(
"ViewMatrix")->set(view);
41 geometry->getOrCreateStateSet()->getUniform(
"ProjectionMatrix")->set(proj);
43 geometry->getOrCreateStateSet()->getUniform(
"light_mv_matrix")->set(
Scene::GetLightCamera()->getViewMatrix());
73 osg::ref_ptr<osg::Geode>
GetNode();
84 osg::ref_ptr<osg::StateSet> nodessSkydome;
85 osg::ref_ptr<osg::Geode> athmosphere;