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:
Robert Osfield
2001-10-19 12:56:37 +00:00
parent e467f44575
commit 54d490e24b
5 changed files with 209 additions and 10 deletions

View File

@@ -105,6 +105,20 @@ class SG_EXPORT Node : public Object
* since they have an AppCallback attached to them or their children.*/
inline const int getNumChildrenRequiringAppTraversal() const { return _numChildrenRequiringAppTraversal; }
/** Set the view frustum/small feature culling of this node to be active or inactive.
* The default value to true for _cullingActive. Used a guide
* to the cull traversal.*/
void setCullingActive(const bool active);
/** Get the view frustum/small feature _cullingActive flag. Used a guide
* to the cull traversal.*/
inline const bool getCullingActive() const { return _cullingActive; }
/** Get the number of Children of this node which have culling disabled.*/
inline const int getNumChildrenWithCullingDisabled() const { return _numChildrenWithCullingDisabled; }
/**
* Set user data. See MemoryAdapter documentation for details
* of how to specify memory management of _userData.
@@ -201,11 +215,14 @@ class SG_EXPORT Node : public Object
ParentList _parents;
friend Group;
ref_ptr<NodeCallback> _appCallback;
int _numChildrenRequiringAppTraversal;
ref_ptr<NodeCallback> _appCallback;
int _numChildrenRequiringAppTraversal;
void setNumChildrenRequiringAppTraversal(const int num);
bool _cullingActive;
int _numChildrenWithCullingDisabled;
void setNumChildrenWithCullingDisabled(const int num);
void* _userData;
ref_ptr<MemoryAdapter> _memoryAdapter;