From d81268f204c6f8fa2b08d207f968ed9c837cea7d Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 28 May 2014 00:27:43 +0200 Subject: [PATCH] Skeleton class now notify modifications Former-commit-id: e796d1ea36e4214e31381a10e4bc79eaf1806d28 --- src/Nazara/Utility/Skeleton.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Nazara/Utility/Skeleton.cpp b/src/Nazara/Utility/Skeleton.cpp index a830d380c..a58ba6a92 100644 --- a/src/Nazara/Utility/Skeleton.cpp +++ b/src/Nazara/Utility/Skeleton.cpp @@ -16,6 +16,7 @@ struct NzSkeletonImpl }; NzSkeleton::NzSkeleton(const NzSkeleton& skeleton) : +NzResource(), m_impl(nullptr) { operator=(skeleton); @@ -105,8 +106,7 @@ NzJoint* NzSkeleton::GetJoint(const NzString& jointName) } #endif - // Invalidation de l'AABB - m_impl->aabbUpdated = false; + InvalidateJoints(); return &m_impl->joints[it->second]; } @@ -127,8 +127,7 @@ NzJoint* NzSkeleton::GetJoint(unsigned int index) } #endif - // Invalidation de l'AABB - m_impl->aabbUpdated = false; + InvalidateJoints(); 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) 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) @@ -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->aabbUpdated = false; + InvalidateJoints(); } bool NzSkeleton::IsValid() const @@ -367,6 +366,12 @@ NzSkeleton& NzSkeleton::operator=(const NzSkeleton& skeleton) return *this; } +void NzSkeleton::InvalidateJoints() +{ + m_impl->aabbUpdated = false; + NotifyModified(0); +} + void NzSkeleton::InvalidateJointMap() { #ifdef NAZARA_DEBUG