![]() |
VR-Forces Developer's Guide
|
DtSplitBackfacePolyVisitor identifies two-sided polygons and duplicates the geometry as a set of two single-sided polygons, reversing one set of normals in the process. This is intended to correct some unintended lighting and transparency artifacts that can occur. This visitor splits both transparent and opaque faces unless told to only split transparent, leaving opaque polygons double sided.

Public Member Functions | |
| DtSplitBackfacePolyVisitor (bool transparentOnly=false) | |
| virtual | ~DtSplitBackfacePolyVisitor () |
| virtual void | apply (osg::Node &node) |
| virtual void | apply (osg::Geode &geode) |
| void | processGeometry () |
| void | setTransparentOnly (bool enable) |
| bool | transparentOnly () const |
Protected Member Functions | |
| void | splitGeometry (osg::Geode &geode) const |
| bool | isDoubleSided (const osg::Node &node) const |
| bool | isTransparentMaterial (const osg::StateSet &ss) const |
| bool | isTransparentTextures (const osg::StateSet &ss) const |
| osg::CullFace * | getOrCreateCullFaceAttribute () |
Protected Attributes | |
| osg::ref_ptr< osg::CullFace > | myCullFace |
| osg::NodeList | myGeodes |
| bool | myTransparentOnly |
| makVrv::DtSplitBackfacePolyVisitor::DtSplitBackfacePolyVisitor | ( | bool | transparentOnly = false | ) |
Default CTOR.
| [in] | transparentOnly | is a flag to only split transparent faces. |
|
virtual |
Virtual DTOR.
|
virtual |
The Visitor apply method used to traverse the scene-graph.
| [in] | node | is the osg::Node being visited. |
|
virtual |
The Visitor apply method used to traverse the scene-graph.
| [in] | geode | is the osg::Geode being visited. |
| void makVrv::DtSplitBackfacePolyVisitor::processGeometry | ( | ) |
Split the geometry cached within this visitor.
| void makVrv::DtSplitBackfacePolyVisitor::setTransparentOnly | ( | bool | enable | ) |
Set the visitor to only split transparent polygons, leaving opaque polygons as double sided.
| [in] | enable | is a flag to only split transparent faces, default is false. |
| bool makVrv::DtSplitBackfacePolyVisitor::transparentOnly | ( | ) | const |
Get whether the visitor is only splitting transparent polygons.
| true | visitor only splits transparent double-sided polygons. |
| false | visitor splits all double-sided polygons. |
|
protected |
Split the double-sided geometry into two single-sided geometries.
| [in,out] | geode | is the geode who's geometry will be modified. |
|
protected |
Check the geode for double-sided polygons.
| [in] | node | is the node to check. |
| true | if geometry has double-sided polygons. |
| false | otherwise. |
|
protected |
Check if the material is transparent.
| [in] | ss | is the state-set to check for transparency. |
| true | if there is transparency. |
| false | otherwise. |
|
protected |
Check if any texture is transparent.
| [in] | ss | is the state-set to check for transparency. |
| true | if there is transparency. |
| false | otherwise. |
|
protected |
Get or create a CullFace attribute.
|
protected |
|
protected |
|
protected |