Added support for specifying whether view frustum and small feature culling
should be applied to a node or its child with the new osg::Node::setCullingActive() flag. A mechanism has been implemented so that if child has its culling disabled then their parents, all the way up to the root are also have their culling implicitly disabled. The osg::CullVisitor has updated to take account of both the explicit control via setCullingActive and the implicit culling disabling through children being disabled. This feature is useful for nodes which don't have a bounding volume to cull against, earth sky implementations and light sources. The default osg::Node::_cullingActive is true, i.e. culling is enabled by default.
This commit is contained in:
@@ -34,6 +34,22 @@ bool Node_readLocalData(Object& obj, Input& fr)
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
if (fr[0].matchWord("cullingActive"))
|
||||
{
|
||||
if (fr[1].matchWord("FALSE"))
|
||||
{
|
||||
node.setCullingActive(false);
|
||||
iteratorAdvanced = true;
|
||||
fr+=2;
|
||||
}
|
||||
else if (fr[1].matchWord("TRUE"))
|
||||
{
|
||||
node.setCullingActive(true);
|
||||
iteratorAdvanced = true;
|
||||
fr+=2;
|
||||
}
|
||||
}
|
||||
|
||||
// if (fr.matchSequence("user_data {"))
|
||||
// {
|
||||
// notify(DEBUG) << "Matched user_data {"<<endl;
|
||||
@@ -89,6 +105,10 @@ bool Node_writeLocalData(const Object& obj, Output& fw)
|
||||
|
||||
if (!node.getName().empty()) fw.indent() << "name "<<'"'<<node.getName()<<'"'<<endl;
|
||||
|
||||
fw.indent() << "cullingActive ";
|
||||
if (node.getCullingActive()) fw << "TRUE"<<endl;
|
||||
else fw << "FALSE"<<endl;
|
||||
|
||||
// if (_userData)
|
||||
// {
|
||||
// Object* object = dynamic_cast<Object*>(_userData);
|
||||
|
||||
Reference in New Issue
Block a user