Function getKeyframe


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

const Keyframe & getKeyframe(uint32_t channelID, double time) const


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


Lines 243-251 in Source/Falcor/Scene/Animation/Animation.cpp. Line 84 in Source/Falcor/Scene/Animation/Animation.h.

const Animation::Keyframe& Animation::getKeyframe(uint32_t channelID, double time) const
    assert(channelID < mChannels.size());
    for (const auto& k : mChannels[channelID].keyframes)
        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 to DocsForge