Utility/Skeleton: Add GetRootJoint method

This commit is contained in:
SirLynix 2022-08-23 18:14:35 +02:00 committed by Jérôme Leclercq
parent 7ada266917
commit 8d39441bd1
2 changed files with 18 additions and 0 deletions

View File

@ -45,6 +45,8 @@ namespace Nz
const Joint* GetJoints() const;
std::size_t GetJointCount() const;
std::size_t GetJointIndex(const std::string& jointName) const;
Joint* GetRootJoint();
const Joint* GetRootJoints() const;
void Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation);
void Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation, const std::size_t* indices, std::size_t indiceCount);

View File

@ -146,6 +146,22 @@ namespace Nz
return it->second;
}
Joint* Skeleton::GetRootJoint()
{
NazaraAssert(m_impl, "skeleton must have been created");
assert(!m_impl->joints.empty());
return &m_impl->joints.front();
}
const Joint* Skeleton::GetRootJoint() const
{
NazaraAssert(m_impl, "skeleton must have been created");
assert(!m_impl->joints.empty());
return &m_impl->joints.front();
}
void Skeleton::Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation)
{
NazaraAssert(m_impl, "skeleton must have been created");