AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
agxOSG::ModelViewMatrixFinder Struct Reference

Callback when the model view matrix of the main camera has been updated. More...

#include <TransparencyUtils.h>

+ Inheritance diagram for agxOSG::ModelViewMatrixFinder:

Public Types

using OnModelViewUpdated = std::function< void(const osg::Matrixf &)>
 

Public Member Functions

 ModelViewMatrixFinder ()=default
 Default constructor for polling and manual handling of isUpdated.
 
 ModelViewMatrixFinder (OnModelViewUpdated onUpdated)
 Construct given callback fired when the model view matrix of the main camera has been changed.
 
virtual ~ModelViewMatrixFinder ()=default
 
virtual bool cull (osg::NodeVisitor *visitor, osg::Drawable *drawable, osg::RenderInfo *renderInfo) const override
 

Public Attributes

bool isUpdated = false
 
osg::Matrixf modelViewMatrix {}
 
OnModelViewUpdated onUpdated {}
 
osg::Matrixf prevModelViewMatrix {}
 

Detailed Description

Callback when the model view matrix of the main camera has been updated.

Note that the callback is only fired when the model view matrix has been changed, i.e., not each frame, another callback has to be used for that.

For polling use: if ( mvmFinder->isUpdated ) { agxOSG::PrimitiveSetTriangleSorter::sort( *geometry, mvmFinder->modelViewMatrix ); mvmFinder->isUpdated = false; }

The isUpdated flag is set to false if onUpdated callback is valid and has been called, if onUpdated = {} then isUpdated has to be set to false externally when the updated model view matrix has been seen.

Definition at line 229 of file TransparencyUtils.h.

Member Typedef Documentation

◆ OnModelViewUpdated

using agxOSG::ModelViewMatrixFinder::OnModelViewUpdated = std::function<void( const osg::Matrixf& )>

Definition at line 231 of file TransparencyUtils.h.

Constructor & Destructor Documentation

◆ ModelViewMatrixFinder() [1/2]

agxOSG::ModelViewMatrixFinder::ModelViewMatrixFinder ( OnModelViewUpdated  onUpdated)

Construct given callback fired when the model view matrix of the main camera has been changed.

Parameters
onUpdated- callback fired when the main camera model view matrix has been updated

◆ ModelViewMatrixFinder() [2/2]

agxOSG::ModelViewMatrixFinder::ModelViewMatrixFinder ( )
default

Default constructor for polling and manual handling of isUpdated.

◆ ~ModelViewMatrixFinder()

virtual agxOSG::ModelViewMatrixFinder::~ModelViewMatrixFinder ( )
virtualdefault

Member Function Documentation

◆ cull()

virtual bool agxOSG::ModelViewMatrixFinder::cull ( osg::NodeVisitor *  visitor,
osg::Drawable *  drawable,
osg::RenderInfo *  renderInfo 
) const
overridevirtual

Member Data Documentation

◆ isUpdated

bool agxOSG::ModelViewMatrixFinder::isUpdated = false
mutable

Definition at line 252 of file TransparencyUtils.h.

◆ modelViewMatrix

osg::Matrixf agxOSG::ModelViewMatrixFinder::modelViewMatrix {}
mutable

Definition at line 254 of file TransparencyUtils.h.

◆ onUpdated

OnModelViewUpdated agxOSG::ModelViewMatrixFinder::onUpdated {}

Definition at line 251 of file TransparencyUtils.h.

◆ prevModelViewMatrix

osg::Matrixf agxOSG::ModelViewMatrixFinder::prevModelViewMatrix {}
mutable

Definition at line 253 of file TransparencyUtils.h.


The documentation for this struct was generated from the following file: