- Default animation
bandicam.2024-04-14.03-00-08-617.mp4
Easy to use (To learn more, please visit the wiki):
void Sequencer(int32_t Frame/*current Frame*/, HAnimationSystem::HValue value) //Define callback function (The straight part is convertible)
{
const std::vector<int> keys = { 0 , 30 , 64 }; // define key
const std::vector<float> values = { 80,200,80 }; //define key value
HAnimationSystem::PlayerCallBack::HInterpolationInfo info = HAnimationSystem::PlayerCallBack::GetInterpolationInfoFromKeys(keys, Frame); //Get interpolation information
HAnimationSystem::HValue_Get<float>(value) = HAnimationSystem::PlayerCallBack::LinearInterpolation(values[info.PreviousKey], values[info.LastOneKey], info.alpha); //Interpolation and return value
}
...
while (...)
{
...
static float value;
if (ImGui::Button("play"))
HAnimationSystem::Play(Sequencer, 64, &value, &curr, speed, fps, loop); //Play animation (You don’t need to fill in so much data to use it)
ImGui::SliderFloat("Test", &value, 80, 200) //apply testing
...
HAnimationSystem::updata(ImGui::GetIO().DeltaTime); // updata animation manager
}