Skeleton class now notify modifications

Former-commit-id: e796d1ea36e4214e31381a10e4bc79eaf1806d28
This commit is contained in:
Lynix 2014-05-28 00:27:43 +02:00
parent cc8a3033ca
commit d81268f204
1 changed files with 11 additions and 6 deletions

View File

@ -16,6 +16,7 @@ struct NzSkeletonImpl
}; };
NzSkeleton::NzSkeleton(const NzSkeleton& skeleton) : NzSkeleton::NzSkeleton(const NzSkeleton& skeleton) :
NzResource(),
m_impl(nullptr) m_impl(nullptr)
{ {
operator=(skeleton); operator=(skeleton);
@ -105,8 +106,7 @@ NzJoint* NzSkeleton::GetJoint(const NzString& jointName)
} }
#endif #endif
// Invalidation de l'AABB InvalidateJoints();
m_impl->aabbUpdated = false;
return &m_impl->joints[it->second]; return &m_impl->joints[it->second];
} }
@ -127,8 +127,7 @@ NzJoint* NzSkeleton::GetJoint(unsigned int index)
} }
#endif #endif
// Invalidation de l'AABB InvalidateJoints();
m_impl->aabbUpdated = false;
return &m_impl->joints[index]; return &m_impl->joints[index];
} }
@ -276,7 +275,7 @@ void NzSkeleton::Interpolate(const NzSkeleton& skeletonA, const NzSkeleton& skel
for (unsigned int i = 0; i < m_impl->joints.size(); ++i) for (unsigned int i = 0; i < m_impl->joints.size(); ++i)
m_impl->joints[i].Interpolate(jointsA[i], jointsB[i], interpolation, nzCoordSys_Local); m_impl->joints[i].Interpolate(jointsA[i], jointsB[i], interpolation, nzCoordSys_Local);
m_impl->aabbUpdated = false; InvalidateJoints();
} }
void NzSkeleton::Interpolate(const NzSkeleton& skeletonA, const NzSkeleton& skeletonB, float interpolation, unsigned int* indices, unsigned int indiceCount) void NzSkeleton::Interpolate(const NzSkeleton& skeletonA, const NzSkeleton& skeletonB, float interpolation, unsigned int* indices, unsigned int indiceCount)
@ -324,7 +323,7 @@ void NzSkeleton::Interpolate(const NzSkeleton& skeletonA, const NzSkeleton& skel
m_impl->joints[index].Interpolate(jointsA[index], jointsB[index], interpolation, nzCoordSys_Local); m_impl->joints[index].Interpolate(jointsA[index], jointsB[index], interpolation, nzCoordSys_Local);
} }
m_impl->aabbUpdated = false; InvalidateJoints();
} }
bool NzSkeleton::IsValid() const bool NzSkeleton::IsValid() const
@ -367,6 +366,12 @@ NzSkeleton& NzSkeleton::operator=(const NzSkeleton& skeleton)
return *this; return *this;
} }
void NzSkeleton::InvalidateJoints()
{
m_impl->aabbUpdated = false;
NotifyModified(0);
}
void NzSkeleton::InvalidateJointMap() void NzSkeleton::InvalidateJointMap()
{ {
#ifdef NAZARA_DEBUG #ifdef NAZARA_DEBUG