mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-02 04:37:54 +08:00
Fixed errors in skeletal animation code
This commit is contained in:
@@ -22,7 +22,7 @@ public:
|
||||
m_FinalBoneMatrices.push_back(glm::mat4(1.0f));
|
||||
}
|
||||
|
||||
void Animator::UpdateAnimation(float dt)
|
||||
void UpdateAnimation(float dt)
|
||||
{
|
||||
m_DeltaTime = dt;
|
||||
if (m_CurrentAnimation)
|
||||
@@ -33,13 +33,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void Animator::PlayAnimation(Animation* pAnimation)
|
||||
void PlayAnimation(Animation* pAnimation)
|
||||
{
|
||||
m_CurrentAnimation = pAnimation;
|
||||
m_CurrentTime = 0.0f;
|
||||
}
|
||||
|
||||
void Animator::CalculateBoneTransform(const AssimpNodeData* node, glm::mat4 parentTransform)
|
||||
void CalculateBoneTransform(const AssimpNodeData* node, glm::mat4 parentTransform)
|
||||
{
|
||||
std::string nodeName = node->name;
|
||||
glm::mat4 nodeTransform = node->transformation;
|
||||
@@ -77,4 +77,4 @@ private:
|
||||
float m_CurrentTime;
|
||||
float m_DeltaTime;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -160,7 +160,7 @@ private:
|
||||
|
||||
}
|
||||
|
||||
glm::mat4 Bone::InterpolateScaling(float animationTime)
|
||||
glm::mat4 InterpolateScaling(float animationTime)
|
||||
{
|
||||
if (1 == m_NumScalings)
|
||||
return glm::scale(glm::mat4(1.0f), m_Scales[0].scale);
|
||||
|
||||
Reference in New Issue
Block a user