OpenWalnut
1.4.0
|
This is a uniform callback setting the uniform to the current time in milliseconds, hundredth of a second or tenth of a second. More...
#include <WGEShaderAnimationCallback.h>
Public Member Functions | |
WGEShaderAnimationCallback (int ticksPerSecond=100) | |
Default constructor. | |
virtual | ~WGEShaderAnimationCallback () |
Destructor. | |
virtual void | operator() (osg::Uniform *uniform, osg::NodeVisitor *nv) |
Operator called on uniform update. | |
Protected Attributes | |
boost::posix_time::ptime | m_start |
Timer that stops the time hopefully OS independent. | |
int | m_ticksPerSec |
Number of ticks to count per second. | |
double | m_tickMillisecRatio |
Ratio between milliseconds and m_ticksPerSec. |
This is a uniform callback setting the uniform to the current time in milliseconds, hundredth of a second or tenth of a second.
Definition at line 37 of file WGEShaderAnimationCallback.h.
WGEShaderAnimationCallback::WGEShaderAnimationCallback | ( | int | ticksPerSecond = 100 | ) | [explicit] |
Default constructor.
Creates a new instance and sets the precision
ticksPerSecond | the uniform will increase by 1 every hundredth second if =100, every 10th second if =10 and every second if =1. |
Definition at line 32 of file WGEShaderAnimationCallback.cpp.
WGEShaderAnimationCallback::~WGEShaderAnimationCallback | ( | ) | [virtual] |
Destructor.
Definition at line 40 of file WGEShaderAnimationCallback.cpp.
void WGEShaderAnimationCallback::operator() | ( | osg::Uniform * | uniform, |
osg::NodeVisitor * | nv | ||
) | [virtual] |
Operator called on uniform update.
uniform | the uniform to update |
nv | the visitor. |
Definition at line 45 of file WGEShaderAnimationCallback.cpp.
References m_start, and m_tickMillisecRatio.
boost::posix_time::ptime WGEShaderAnimationCallback::m_start [protected] |
Timer that stops the time hopefully OS independent.
Definition at line 64 of file WGEShaderAnimationCallback.h.
Referenced by operator()().
double WGEShaderAnimationCallback::m_tickMillisecRatio [protected] |
Ratio between milliseconds and m_ticksPerSec.
Definition at line 74 of file WGEShaderAnimationCallback.h.
Referenced by operator()().
int WGEShaderAnimationCallback::m_ticksPerSec [protected] |
Number of ticks to count per second.
Definition at line 69 of file WGEShaderAnimationCallback.h.