Added overriding of CullSettings::inheritCullSettings() into osg::Camera to
properly inherit the clear colour.
This commit is contained in:
@@ -341,6 +341,18 @@ bool Camera::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void Camera::inheritCullSettings(const CullSettings& settings, unsigned int inheritanceMask)
|
||||
{
|
||||
CullSettings::inheritCullSettings(settings, inheritanceMask);
|
||||
|
||||
if (inheritanceMask & CLEAR_COLOR)
|
||||
{
|
||||
//osg::notify(osg::NOTICE)<<"Inheriting slave Camera"<<std::endl;
|
||||
const Camera* camera = dynamic_cast<const Camera*>(&settings);
|
||||
_clearColor = camera->_clearColor;
|
||||
}
|
||||
}
|
||||
|
||||
void Camera::createCameraThread()
|
||||
{
|
||||
if (!_cameraThread)
|
||||
|
||||
@@ -157,8 +157,7 @@ void View::updateSlave(unsigned int i)
|
||||
slave._camera->setViewMatrix(_camera->getViewMatrix() * slave._viewOffset);
|
||||
}
|
||||
|
||||
slave._camera->inheritCullSettings(*_camera);
|
||||
if (slave._camera->getInheritanceMask() & osg::CullSettings::CLEAR_COLOR) slave._camera->setClearColor(_camera->getClearColor());
|
||||
slave._camera->inheritCullSettings(*_camera, slave._camera->getInheritanceMask());
|
||||
}
|
||||
|
||||
bool View::addSlave(osg::Camera* camera, const osg::Matrix& projectionOffset, const osg::Matrix& viewOffset, bool useMastersSceneData)
|
||||
|
||||
Reference in New Issue
Block a user