This class is an OSG Callback which allows simple linear translation of a matrix transform node along a specified axis. More...
#include <WGELinearTranslationCallback.h>
Inheritance diagram for WGELinearTranslationCallback< T >:
Public Member Functions | |
| WGELinearTranslationCallback (osg::Vec3 axe, T property, osg::ref_ptr< osg::TexMat > texMatrix) | |
| Constructor. | |
| WGELinearTranslationCallback (osg::Vec3 axe, T property, osg::ref_ptr< osg::Uniform > uniform) | |
| Constructor. | |
| WGELinearTranslationCallback (osg::Vec3 axe, T property) | |
| Constructor. | |
| virtual | ~WGELinearTranslationCallback () |
| Destructor. | |
| virtual void | operator() (osg::Node *node, osg::NodeVisitor *nv) |
| This operator gets called by OSG every update cycle. | |
Protected Attributes | |
| osg::Vec3 | m_axe |
| The axis to transform along. | |
| T | m_pos |
| The position. | |
| double | m_oldPos |
| Cache the old position for proper update. | |
| osg::ref_ptr< osg::TexMat > | m_texMat |
| Texture matrix that contains normalized translation. | |
| osg::ref_ptr< osg::Uniform > | m_uniform |
| The uniform to set the matrix to. | |
This class is an OSG Callback which allows simple linear translation of a matrix transform node along a specified axis.
It is controlled by a WPropDouble. This way, one can simply implement movable slices and similar.
| T | the type used as control mechanism. Typically, this should be an property whose type is cast-able to double. The type specified must support access via T->get(). Specialize the class if you do not specify a pointer. |
Definition at line 44 of file WGELinearTranslationCallback.h.
| WGELinearTranslationCallback< T >::WGELinearTranslationCallback | ( | osg::Vec3 | axe, | |
| T | property, | |||
| osg::ref_ptr< osg::TexMat > | texMatrix | |||
| ) |
Constructor.
Creates the callback. You still need to add it to the desired node.
| axe | the axe to translate along. Should be normalized. If not, it scales the translation. | |
| property | the property containing the value | |
| texMatrix | optional pointer to a texture matrix which can be modified too to contain the normalized translation. |
Definition at line 117 of file WGELinearTranslationCallback.h.
| WGELinearTranslationCallback< T >::WGELinearTranslationCallback | ( | osg::Vec3 | axe, | |
| T | property, | |||
| osg::ref_ptr< osg::Uniform > | uniform | |||
| ) |
Constructor.
Creates the callback. You still need to add it to the desired node.
| axe | the axe to translate along. Should be normalized. If not, it scales the translation. | |
| property | the property containing the value | |
| uniform | optional pointer to a uniform that will contain the matrix. Useful if no tex-matrix is available anymore. The matrix is the matrix that is NOT scaled to be in texture space. |
Definition at line 128 of file WGELinearTranslationCallback.h.
| WGELinearTranslationCallback< T >::WGELinearTranslationCallback | ( | osg::Vec3 | axe, | |
| T | property | |||
| ) |
Constructor.
Creates the callback. You still need to add it to the desired node.
| axe | the axe to translate along. Should be normalized. If not, it scales the translation. | |
| property | the property containing the value |
Definition at line 139 of file WGELinearTranslationCallback.h.
| WGELinearTranslationCallback< T >::~WGELinearTranslationCallback | ( | ) | [virtual] |
Destructor.
Definition at line 149 of file WGELinearTranslationCallback.h.
| void WGELinearTranslationCallback< T >::operator() | ( | osg::Node * | node, | |
| osg::NodeVisitor * | nv | |||
| ) | [virtual] |
This operator gets called by OSG every update cycle.
It moves the underlying MatrixTransform according to the specified axis and value.
| node | the osg node | |
| nv | the node visitor |
Definition at line 155 of file WGELinearTranslationCallback.h.
References WGELinearTranslationCallback< T >::m_axe, WGELinearTranslationCallback< T >::m_oldPos, WGELinearTranslationCallback< T >::m_pos, WGELinearTranslationCallback< T >::m_texMat, and WGELinearTranslationCallback< T >::m_uniform.
osg::Vec3 WGELinearTranslationCallback< T >::m_axe [protected] |
The axis to transform along.
Definition at line 92 of file WGELinearTranslationCallback.h.
Referenced by WGELinearTranslationCallback< T >::operator()().
double WGELinearTranslationCallback< T >::m_oldPos [protected] |
Cache the old position for proper update.
Definition at line 102 of file WGELinearTranslationCallback.h.
Referenced by WGELinearTranslationCallback< T >::operator()().
T WGELinearTranslationCallback< T >::m_pos [protected] |
The position.
Definition at line 97 of file WGELinearTranslationCallback.h.
Referenced by WGELinearTranslationCallback< T >::operator()().
osg::ref_ptr< osg::TexMat > WGELinearTranslationCallback< T >::m_texMat [protected] |
Texture matrix that contains normalized translation.
Definition at line 107 of file WGELinearTranslationCallback.h.
Referenced by WGELinearTranslationCallback< T >::operator()().
osg::ref_ptr< osg::Uniform > WGELinearTranslationCallback< T >::m_uniform [protected] |
The uniform to set the matrix to.
Definition at line 112 of file WGELinearTranslationCallback.h.
Referenced by WGELinearTranslationCallback< T >::operator()().
1.7.1