OpenWalnut
1.5.0dev
|
This class is an OSG Callback which allows uniforms to be controlled by properties. More...
#include <WGEPropertyUniformCallback.h>
Public Types | |
typedef wge::UniformType< typename T::element_type::ValueType >::Type | UniformType |
The type which is used for this uniform. More... | |
Public Member Functions | |
WGEPropertyUniformCallback (T property) | |
Constructor. More... | |
virtual | ~WGEPropertyUniformCallback () |
Destructor. More... | |
virtual void | operator() (osg::Uniform *uniform, osg::NodeVisitor *nv) |
The callback. More... | |
Protected Attributes | |
T | m_property |
The property. More... | |
This class is an OSG Callback which allows uniforms to be controlled by properties.
This is useful to simply forward properties to a shader. Please note that you still need to add this callback to the desired uniforms. A convenience class is WGEPropertyUniform which uses this callback. On each traversal of the OSG, the callback sets the value of the property to the uniform but does NOT reset the change flag.
T | the type used as control mechanism. The type specified must support access via T->get(). Specialize the class if you do not specify a pointer. |
Definition at line 43 of file WGEPropertyUniformCallback.h.
typedef wge::UniformType< typename T::element_type::ValueType >::Type WGEPropertyUniformCallback< T >::UniformType |
The type which is used for this uniform.
Definition at line 69 of file WGEPropertyUniformCallback.h.
|
explicit |
Constructor.
Creates the callback. You still need to add it to the desired uniform.
property | the property containing the value |
Definition at line 81 of file WGEPropertyUniformCallback.h.
|
virtual |
Destructor.
Definition at line 89 of file WGEPropertyUniformCallback.h.
|
virtual |
The callback.
Called every render traversal for the uniform. It sets the value of the property to the uniform.
uniform | the uniform for which this callback is. |
nv | the visitor. |
Definition at line 95 of file WGEPropertyUniformCallback.h.
References wge::toUniformType().
|
protected |
The property.
Definition at line 75 of file WGEPropertyUniformCallback.h.