Node::SetOcclusionCallback
Defined in:
Sets the function that handles occlusion testing for a node.
C4Node.h
Prototype
void SetOcclusionCallback(OcclusionCallback *callback);
Parameters
callback |
A pointer to the function that performs the occlusion test. |
Description
The SetOcclusionCallback
function installs the procedure that is called when occlusion testing is needed for a node. The OcclusionCallback
type is defined as follows.
typedef bool OcclusionCallback(const Node *, const VisibilityRegion *, const List<OcclusionRegion> *);
Node::SetVisibilityCallback
function. The occlusion callback function should then use whatever means is appropriate to determine whether the node is occluded within any of the regions in the list specified by the last parameter. This is normally accomplished by calling one or more of the following member functions of the OcclusionRegion
class.OcclusionRegion::PolygonOccluded
OcclusionRegion::SphereOccluded
OcclusionRegion::EllipsoidOccluded
OcclusionRegion::BoxOccluded
OcclusionRegion::CylinderOccluded
The occlusion callback function should return
true
if the node is visible and false
otherwise.By default, the
Node::SphereVisible
function is installed as a node's occlusion callback function. This function passes the node's bounding sphere to the OcclusionRegion::SphereOccluded
function for each region in the list to determine whether the node is visible.The
Node::AlwaysVisible
function may be installed as the occlusion callback function to force a node to be unoccluded all the time.If a custom occlusion callback function is installed using the
SetOcclusionCallback
, then a custom visibility callback function should also be installed using the Node::SetVisibilityCallback
function.
See Also