OpenWalnut  1.5.0dev
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:
+ 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...
 

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::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::~WGEShaderAnimationCallback ( )
virtual

Destructor.

Definition at line 40 of file WGEShaderAnimationCallback.cpp.

Member Function Documentation

◆ operator()()

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

◆ m_start

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()().

◆ m_tickMillisecRatio

double WGEShaderAnimationCallback::m_tickMillisecRatio
protected

Ratio between milliseconds and m_ticksPerSec.

Definition at line 74 of file WGEShaderAnimationCallback.h.

Referenced by operator()().

◆ m_ticksPerSec

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: