Node::SetVisibilityCallback
Defined in:
Sets the function that handles visibility testing for a node.
C4Node.h
Prototype
void SetVisibilityCallback(VisibilityCallback *callback);
Parameters
callback |
A pointer to the function that performs the visibility test. |
Description
The SetVisibilityCallback
function installs the callback function that is called when visibility testing is needed for a node. The VisibilityCallback
type is defined as follows.
typedef bool VisibilityCallback(const Node *, const VisibilityRegion *);
VisibilityRegion
class.VisibilityRegion::PolygonVisible
VisibilityRegion::SphereVisible
VisibilityRegion::EllipsoidVisible
VisibilityRegion::BoxVisible
VisibilityRegion::CylinderVisible
The visibility 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 visibility callback function. This function passes the node's bounding sphere to the VisibilityRegion::SphereVisible
function to determine whether the node is visible.The
Node::AlwaysVisible
function may be installed as the visibility callback function to force a node to be visible all the time.If a custom visibility procedure is installed using the
SetVisibilityCallback
, then a custom occlusion callback function should also be installed using the Node::SetOcclusionCallback
function if occlusion portals are in use.
See Also