OpenWalnut  1.3.1
Public Member Functions | Protected Attributes | List of all members
WGEShaderAnimationCallback Class Reference

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:

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.

Detailed Description

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.

Constructor & Destructor Documentation

WGEShaderAnimationCallback::WGEShaderAnimationCallback ( int  ticksPerSecond = 100)
explicit

Default constructor.

Creates a new instance and sets the precision

Parameters
ticksPerSecondthe 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.

Member Function Documentation

void WGEShaderAnimationCallback::operator() ( osg::Uniform *  uniform,
osg::NodeVisitor *  nv 
)
virtual

Operator called on uniform update.

Parameters
uniformthe uniform to update
nvthe visitor.

Definition at line 45 of file WGEShaderAnimationCallback.cpp.

References m_start, and m_tickMillisecRatio.

Member Data Documentation

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.


The documentation for this class was generated from the following files: