![]() |
OpenWalnut
1.5.0dev
|
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>
Inheritance diagram for WGEShaderAnimationCallback:
Collaboration diagram for WGEShaderAnimationCallback:Public Member Functions | |
| WGEShaderAnimationCallback (int ticksPerSecond=100) | |
| Default constructor. More... | |
| virtual | ~WGEShaderAnimationCallback () |
| Destructor. More... | |
| virtual void | operator() (osg::Uniform *uniform, osg::NodeVisitor *nv) |
| Operator called on uniform update. More... | |
Protected Attributes | |
| boost::posix_time::ptime | m_start |
| Timer that stops the time hopefully OS independent. More... | |
| int | m_ticksPerSec |
| Number of ticks to count per second. More... | |
| double | m_tickMillisecRatio |
| Ratio between milliseconds and m_ticksPerSec. More... | |
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.
|
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.
|
virtual |
Destructor.
Definition at line 40 of file WGEShaderAnimationCallback.cpp.
|
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.
|
protected |
Timer that stops the time hopefully OS independent.
Definition at line 64 of file WGEShaderAnimationCallback.h.
Referenced by operator()().
|
protected |
Ratio between milliseconds and m_ticksPerSec.
Definition at line 74 of file WGEShaderAnimationCallback.h.
Referenced by operator()().
|
protected |
Number of ticks to count per second.
Definition at line 69 of file WGEShaderAnimationCallback.h.