Fixed SHAnimationClip::GetTotalTime()

This commit is contained in:
Kah Wei 2023-01-18 19:16:20 +08:00
parent e013112b2c
commit 35b7ac0178
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ namespace SHADE
/*-----------------------------------------------------------------------------------*/
SHAnimationClip::SHAnimationClip(const SHAnimAsset& asset)
: ticksPerSecond { static_cast<int>(asset.ticksPerSecond) }
, totalTime { static_cast<float>(asset.duration) }
, totalTime { static_cast<float>(asset.duration) / static_cast<int>(asset.ticksPerSecond) }
{
// Populate keyframes
for (const auto& channel : asset.nodeChannels)

View File

@ -67,7 +67,7 @@ namespace SHADE
/*---------------------------------------------------------------------------------*/
const std::vector<Channel>& GetChannels() const noexcept { return channels; }
int GetTicksPerSecond() const noexcept { return ticksPerSecond; }
float GetTotalTime() const noexcept { return totalTime/(float)ticksPerSecond; }
float GetTotalTime() const noexcept { return totalTime; }
private:
/*---------------------------------------------------------------------------------*/