Function setTime

Synopsis

#include <Source/Falcor/Utils/Timing/Clock.h>

Clock & setTime(double seconds, bool deferToNextTick=false)

Description

Set the current time

Parameters:

[ in ] seconds - The time in seconds

[ in ] deferToNextTick - Apply the change on the next tick. No changes will be made to the clock until the next tick

Source

Lines 153-175 in Source/Falcor/Utils/Timing/Clock.cpp. Line 53 in Source/Falcor/Utils/Timing/Clock.h.

Clock& Clock::setTime(double seconds, bool deferToNextTick)
{
    resetDeferredObjects();
    if (deferToNextTick)
    {
        mDeferredTime = seconds;
    }
    else
    {
        updateTimer();
        if (mFramerate)
        {
            mFrames = frameFromTime(seconds, mTicksPerFrame);
            seconds = timeFromFrame(mFrames, mTicksPerFrame);
        }
        else mFrames = 0;
        mTime.delta = mTime.now - seconds;
        mTime.now = seconds;
    }
    return *this;
}





Add Discussion as Guest

Log in to DocsForge