#include <sglBitMaskSwitch.hpp>
Inheritance diagram for sglBitMaskSwitch::
Public Methods | |
sglBitMaskSwitch () | |
virtual | ~sglBitMaskSwitch () |
void | setMask (unsigned int mask) |
unsigned int | getMask () |
virtual sglBound::IntersectResultEnum | intersect (sglIntersectf &isector) const |
virtual sglBound::IntersectResultEnum | intersect (sglIntersectd &isector) const |
virtual void | pick (sglPickf &pick_state, unsigned int cull_flags) const |
virtual void | pick (sglPickd &pick_state, unsigned int cull_flags) const |
virtual sglNode* | clone (unsigned int mode) const |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
Protected Methods | |
virtual void | cull (sglCull< float > &trav_state, unsigned int cull_flags) const |
virtual void | cull (sglCull< double > &trav_state, unsigned int cull_flags) const |
void | cull (sglCull< float > &trav_state, unsigned int cull_flags, unsigned int switch_mask) const |
void | cull (sglCull< double > &trav_state, unsigned int cull_flags, unsigned int switch_mask) const |
void | copyTo (sglBitMaskSwitch *dst, unsigned int mode) const |
Protected Attributes | |
unsigned int | m_switch_mask |
The switch mask is an unsigned integer which means it can be used to select one of up to 32 children. If this node has less than 32 children some of the bits are out of range and will be ignored.
Special behaviour for intersect and pick traversals
In addition to this behaviour, the intersect and pick traversals of this node type can be overridden by adding sglProbe::eSWITCH_ALL or sglProbe::eSWITCH_NONE to the mode. The former behaves as if mask 0xffffffff (~0x0) has been set on this node, and the latter corresponds to a mask of 0x0.
Example:
sglBitMaskSwitch *switch_node = new sglBitMaskSwitch; sglGeode *geode0 = new sglGeode; sglGeode *geode1 = new sglGeode; switch_node->addChild(geode0); switch_node->addChild(geode1); switch_node->setMask(0x0); // select neither switch_node->setMask(0x1); // select geode0 switch_node->setMask(0x2); // select geode1 switch_node->setMask(0x3); // select both switch_node->setMask(0x4); // selects neither (no corresponding child) switch_node->setMask(~0x0); // select all children (the default)
Definition at line 75 of file sglBitMaskSwitch.hpp.
|
default constructor.
|
|
destructor.
|
|
Set the bit mask for selecting children. @mask The mask where each bit corresponds to one of up to 32 children. Definition at line 86 of file sglBitMaskSwitch.hpp. Referenced by sglIndexedBitMaskSwitch::setIndex(). |
|
Get the current bit mask.
Definition at line 91 of file sglBitMaskSwitch.hpp. |
|
The single precision intersection traversal function which returns the closest object (bounding volume and/or triangle) that intersects with the given intersect segment.
Reimplemented from sglGroup. |
|
The double precision intersection traversal function which returns the closest object (bounding volume and/or triangle) that intersects with the given intersect segment.
Reimplemented from sglGroup. |
|
The single precision pick traversal function which returns all objects that fall within the pick frustum.
Reimplemented from sglGroup. |
|
The double precision pick traversal function which returns all objects that fall within the pick frustum.
Reimplemented from sglGroup. |
|
Make a copy of the scenegraph rooted at this node.
Reimplemented from sglGroup. Reimplemented in sglIndexedBitMaskSwitch. |
|
Output the state of this node to the specified ostream.
Reimplemented from sglGroup. Reimplemented in sglIndexedBitMaskSwitch. |
|
The single precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.
Reimplemented from sglGroup. Definition at line 115 of file sglBitMaskSwitch.hpp. |
|
The double precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.
Reimplemented from sglGroup. Definition at line 122 of file sglBitMaskSwitch.hpp. |