C4 Engine Terathon Software C4 Engine API Documentation

• World Manager

API Links
Developer Links

Node::SetVisibilityProc

Defined in:  C4Node.h
Sets the function that handles visibility testing for a node.
Prototype

void SetVisibilityProc(VisibilityProc *proc);

Parameters
proc A pointer to the function that performs the visibility test.
Description
The SetVisibilityProc function installs the procedure that is called when visibility testing is needed for a node. The VisibilityProc type is defined as follows.

typedef bool VisibilityProc(const Node *, const Region *);

When the visibility procedure is called, it can use whatever means is appropriate to determine whether the node is visible within the given region. This is normally accomplished by calling one or more of the following member functions of the Region class. Region::PolygonVisible Region::SphereVisible Region::EllipsoidVisible Region::BoxVisible Region::CylinderVisible

By default, the Node::SphereVisible function is installed as a node's visibility procedure. This function passes the node's bounding sphere to the Region::SphereVisible function to determine whether the node is visible.

The Node::AlwaysVisible function may be installed as the visibility procedure to force a node to be visible all the time.

If a custom visibility procedure is installed using the SetVisibilityProc, then a custom occlusion procedure should also be installed using the Node::SetOcclusionProc function if occlusion portals are in use.
See Also

Node::Visible

Node::SetOcclusionProc

Region