X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2FCameraGroup.cxx;h=954a591e55d0c41ad761b2772d557aec8eda639b;hb=4be1661305609819703015360b79bbb7e4ae87d6;hp=1feb0eef73d4feaedcd073b3657bce3e55f95a99;hpb=da8dd13138303170947a1fcc5fd1b20e9a5b04d6;p=flightgear.git diff --git a/src/Main/CameraGroup.cxx b/src/Main/CameraGroup.cxx index 1feb0eef7..954a591e5 100644 --- a/src/Main/CameraGroup.cxx +++ b/src/Main/CameraGroup.cxx @@ -14,6 +14,10 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +#ifdef HAVE_CONFIG_H +# include +#endif + #include "CameraGroup.hxx" #include "globals.hxx" @@ -23,6 +27,7 @@ #include "WindowSystemAdapter.hxx" #include #include +#include #include #include @@ -40,6 +45,7 @@ #include #include +#include namespace flightgear { @@ -100,14 +106,12 @@ void makeNewProjMat(Matrixd& oldProj, double znear, void installCullVisitor(Camera* camera) { -#if 0 // Not yet osgViewer::Renderer* renderer = static_cast(camera->getRenderer()); for (int i = 0; i < 2; ++i) { osgUtil::SceneView* sceneView = renderer->getSceneView(i); sceneView->setCullVisitor(new simgear::EffectCullVisitor); } -#endif } } @@ -198,7 +202,7 @@ void CameraGroup::update(const osg::Vec3d& position, camera->setProjectionMatrix(projectionMatrix); camera->setCullMask(camera->getCullMask() | simgear::BACKGROUND_BIT); - camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); farCamera->setNodeMask(0); } else { Matrix nearProj, farProj; @@ -298,7 +302,6 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode) WindowBuilder *wBuild = WindowBuilder::getWindowBuilder(); const SGPropertyNode* windowNode = cameraNode->getNode("window"); GraphicsWindow* window = 0; - static int cameraNum = 0; int cameraFlags = DO_INTERSECTION_TEST; if (windowNode) { // New style window declaration / definition @@ -318,7 +321,11 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode) | CullSettings::VIEW_FRUSTUM_CULLING); camera->setInheritanceMask(CullSettings::ALL_VARIABLES & ~(CullSettings::CULL_MASK - | CullSettings::CULLING_MODE)); + | CullSettings::CULLING_MODE +#if defined(HAVE_CULLSETTINGS_CLEAR_MASK) + | CullSettings::CLEAR_MASK +#endif + )); osg::Matrix pOff; osg::Matrix vOff; @@ -400,7 +407,6 @@ CameraInfo* CameraGroup::buildGUICamera(SGPropertyNode* cameraNode, const SGPropertyNode* windowNode = (cameraNode ? cameraNode->getNode("window") : 0); - static int cameraNum = 0; if (!window) { if (windowNode) { // New style window declaration / definition @@ -420,7 +426,11 @@ CameraInfo* CameraGroup::buildGUICamera(SGPropertyNode* cameraNode, camera->setClearMask(0); camera->setInheritanceMask(CullSettings::ALL_VARIABLES & ~(CullSettings::COMPUTE_NEAR_FAR_MODE - | CullSettings::CULLING_MODE)); + | CullSettings::CULLING_MODE +#if defined(HAVE_CULLSETTINGS_CLEAR_MASK) + | CullSettings::CLEAR_MASK +#endif + )); camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); camera->setCullingMode(osg::CullSettings::NO_CULLING); camera->setProjectionResizePolicy(Camera::FIXED);