Fixed SHAnimationClip::GetTotalTime()
This commit is contained in:
parent
e013112b2c
commit
35b7ac0178
|
@ -21,7 +21,7 @@ namespace SHADE
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
SHAnimationClip::SHAnimationClip(const SHAnimAsset& asset)
|
SHAnimationClip::SHAnimationClip(const SHAnimAsset& asset)
|
||||||
: ticksPerSecond { static_cast<int>(asset.ticksPerSecond) }
|
: 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
|
// Populate keyframes
|
||||||
for (const auto& channel : asset.nodeChannels)
|
for (const auto& channel : asset.nodeChannels)
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace SHADE
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
const std::vector<Channel>& GetChannels() const noexcept { return channels; }
|
const std::vector<Channel>& GetChannels() const noexcept { return channels; }
|
||||||
int GetTicksPerSecond() const noexcept { return ticksPerSecond; }
|
int GetTicksPerSecond() const noexcept { return ticksPerSecond; }
|
||||||
float GetTotalTime() const noexcept { return totalTime/(float)ticksPerSecond; }
|
float GetTotalTime() const noexcept { return totalTime; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in New Issue