Added osg::FrameStamp::set/getSimulationTime().
Added setting of osg_SimulationTime and osg_DeltaSimulationTime to the uniforms set by SceneView Added frame(double simulationTime) and advance(double simulationTime) parameters to osgViewer::SimpleViewer, Vewer and CompositeViewer. Updated various examples and Nodes to use SimulationTime where appropriate.
This commit is contained in:
@@ -247,7 +247,7 @@ class AnimateCallback: public osg::Uniform::Callback
|
||||
{
|
||||
if( _enabled )
|
||||
{
|
||||
float angle = 2.0 * nv->getFrameStamp()->getReferenceTime();
|
||||
float angle = 2.0 * nv->getFrameStamp()->getSimulationTime();
|
||||
float sine = sinf( angle ); // -1 -> 1
|
||||
float v01 = 0.5f * sine + 0.5f; // 0 -> 1
|
||||
float v10 = 1.0f - v01; // 1 -> 0
|
||||
|
||||
Reference in New Issue
Block a user