Function getKeyframe

Synopsis

#include <Source/Falcor/Scene/Animation/Animation.h>

const Keyframe & getKeyframe(double time) const

Description

Get the keyframe at the specified time. If the keyframe doesn't exists, the function will throw an exception. If you don't want to handle exceptions, call doesKeyframeExist() first.

Parameters

[ in ] time - Time of the keyframe.

Returns
Returns the keyframe.

Source

Lines 298-305 in Source/Falcor/Scene/Animation/Animation.cpp. Line 125 in Source/Falcor/Scene/Animation/Animation.h.

const Animation::Keyframe& Animation::getKeyframe(double time) const
{
    for (const auto& k : mKeyframes)
    {
        if (k.time == time) return k;
    }
    throw std::runtime_error(("Animation::getKeyframe() - can't find a keyframe at time " + std::to_string(time)).c_str());
}





Add Discussion as Guest

Log in