DtInstrumentTextureReplacer traverses a scene graph to find and replace specific textures with render-to-texture (RTT) displays for aircraft instruments. It can also collect geometry information about the textures for proper positioning.
#include <pilotRenderUpdater.h>
|
| virtual bool | replaceTexture (osg::StateSet &ss, osg::Node &node) |
| |
| virtual bool | collectGeometry (const osg::Node &node, const osg::NodePath &nodePath) |
| |
◆ DtInstrumentTextureReplacer()
| makVre::DtInstrumentTextureReplacer::DtInstrumentTextureReplacer |
( |
const std::string & | targetTextureName, |
|
|
osg::ref_ptr< osg::Texture2D > | replacementTexture, |
|
|
bool | isHud = false, |
|
|
bool | findPosition = false, |
|
|
const osg::Vec3 * | overrideNormal = NULL ) |
Constructor.
- Parameters
-
| targetTextureName | Name of the texture to replace |
| replacementTexture | Reference to the replacement texture |
| isHud | Flag indicating if this is a HUD texture |
| findPosition | Flag indicating whether to collect geometry information |
| overrideNormal | Optional normal vector to override the calculated normal |
◆ ~DtInstrumentTextureReplacer()
| virtual makVre::DtInstrumentTextureReplacer::~DtInstrumentTextureReplacer |
( |
| ) |
|
|
overridevirtual |
◆ apply()
| virtual void makVre::DtInstrumentTextureReplacer::apply |
( |
osg::Node & | node | ) |
|
|
overridevirtual |
The visitor apply method used to traverse the scene-graph.
- Parameters
-
| node | The osg::Node being visited |
Called during scene-graph traversal. Do not directly call this function.
◆ foundTarget()
| bool makVre::DtInstrumentTextureReplacer::foundTarget |
( |
| ) |
const |
The visitor apply method for geodes.
- Parameters
-
| geode | The osg::Geode being visited |
Called during scene-graph traversal. Do not directly call this function. Currently commented out and not used.
Checks if the target texture was found
- Returns
- True if the target texture was found, false otherwise
◆ targetNormal()
| osg::Vec3 makVre::DtInstrumentTextureReplacer::targetNormal |
( |
| ) |
const |
Gets the normal vector of the target geometry.
- Returns
- Normal vector of the target geometry
◆ targetBoundsMin()
| osg::Vec3 makVre::DtInstrumentTextureReplacer::targetBoundsMin |
( |
| ) |
const |
Gets the minimum bounds of the target geometry.
- Returns
- Minimum bounds vector
◆ targetBoundsMax()
| osg::Vec3 makVre::DtInstrumentTextureReplacer::targetBoundsMax |
( |
| ) |
const |
Gets the maximum bounds of the target geometry.
- Returns
- Maximum bounds vector
◆ replaceTexture()
| virtual bool makVre::DtInstrumentTextureReplacer::replaceTexture |
( |
osg::StateSet & | ss, |
|
|
osg::Node & | node ) |
|
protectedvirtual |
Replaces a texture in the given state set.
- Parameters
-
| ss | State set containing the texture to replace |
| node | Node associated with the state set |
- Returns
- True if the texture was replaced, false otherwise
◆ collectGeometry()
| virtual bool makVre::DtInstrumentTextureReplacer::collectGeometry |
( |
const osg::Node & | node, |
|
|
const osg::NodePath & | nodePath ) |
|
protectedvirtual |
Collects geometry information for the target texture.
- Parameters
-
| node | Node containing the geometry |
| nodePath | Path to the node in the scene graph |
- Returns
- True if geometry was collected, false otherwise
◆ myTargetTextureName
| std::string makVre::DtInstrumentTextureReplacer::myTargetTextureName |
|
protected |
Name of the texture to replace.
◆ myReplacementTexture
| osg::ref_ptr<osg::Texture2D> makVre::DtInstrumentTextureReplacer::myReplacementTexture |
|
protected |
Reference to the replacement texture.
◆ myIsHud
| bool makVre::DtInstrumentTextureReplacer::myIsHud |
|
protected |
Flag indicating if this is a HUD texture.
◆ myFoundTarget
| bool makVre::DtInstrumentTextureReplacer::myFoundTarget |
|
protected |
Flag indicating if the target texture was found.
◆ myWantsGeometry
| bool makVre::DtInstrumentTextureReplacer::myWantsGeometry |
|
protected |
Flag indicating if geometry information should be collected.
◆ myTraverseOnTarget
| bool makVre::DtInstrumentTextureReplacer::myTraverseOnTarget |
|
protected |
Flag indicating whether to continue traversal after finding the target.
◆ myGeometry
| Geometry makVre::DtInstrumentTextureReplacer::myGeometry |
|
protected |
Collected geometry information for the target texture.
◆ myUseOverrideNormal
| bool makVre::DtInstrumentTextureReplacer::myUseOverrideNormal |
|
protected |
Flag indicating whether to use the provided override normal.
The documentation for this class was generated from the following file: