From 20be46e8668a883d028fdce5de9aaf750bdc10e8 Mon Sep 17 00:00:00 2001 From: Lynix Date: Fri, 23 Nov 2012 21:16:14 +0100 Subject: [PATCH] Made mesh animating/skinning constant Since it doesn't change any of the mesh proprieties Former-commit-id: 47eb21f234570d6ffe3af542029f2086744944b0 --- include/Nazara/Utility/KeyframeMesh.hpp | 4 ++-- include/Nazara/Utility/Mesh.hpp | 5 +++-- include/Nazara/Utility/SkeletalMesh.hpp | 4 ++-- src/Nazara/Utility/KeyframeMesh.cpp | 4 ++-- src/Nazara/Utility/Mesh.cpp | 4 ++-- src/Nazara/Utility/SkeletalMesh.cpp | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/Nazara/Utility/KeyframeMesh.hpp b/include/Nazara/Utility/KeyframeMesh.hpp index e2574cba4..6c47a3421 100644 --- a/include/Nazara/Utility/KeyframeMesh.hpp +++ b/include/Nazara/Utility/KeyframeMesh.hpp @@ -33,7 +33,7 @@ class NAZARA_API NzKeyframeMesh final : public NzSubMesh bool GetVertex(NzMeshVertex* dest, unsigned int frameIndex, unsigned int vertexIndex, bool queryUV = true) const; const NzVertexBuffer* GetVertexBuffer() const override; - void Interpolate(unsigned int frameA, unsigned int frameB, float interpolation); + void Interpolate(unsigned int frameA, unsigned int frameB, float interpolation) const; bool IsAnimated() const override; bool IsValid(); @@ -47,7 +47,7 @@ class NAZARA_API NzKeyframeMesh final : public NzSubMesh void Unlock() const; private: - void InterpolateImpl(unsigned int frameA, unsigned int frameB, float interpolation); + void InterpolateImpl(unsigned int frameA, unsigned int frameB, float interpolation) const; NzKeyframeMeshImpl* m_impl = nullptr; }; diff --git a/include/Nazara/Utility/Mesh.hpp b/include/Nazara/Utility/Mesh.hpp index c6cd4545b..9498c8774 100644 --- a/include/Nazara/Utility/Mesh.hpp +++ b/include/Nazara/Utility/Mesh.hpp @@ -52,7 +52,7 @@ class NAZARA_API NzMesh : public NzResource, NzResourceListener bool AddSubMesh(NzSubMesh* subMesh); bool AddSubMesh(const NzString& identifier, NzSubMesh* subMesh); - void Animate(unsigned int frameA, unsigned int frameB, float interpolation); + void Animate(unsigned int frameA, unsigned int frameB, float interpolation) const; bool CreateKeyframe(); bool CreateSkeletal(unsigned int jointCount); @@ -95,7 +95,8 @@ class NAZARA_API NzMesh : public NzResource, NzResourceListener void RemoveSubMesh(unsigned int index); bool SetAnimation(const NzAnimation* animation); - void Skin(const NzSkeleton* skeleton); + + void Skin(const NzSkeleton* skeleton) const; static const NzVertexDeclaration* GetDeclaration(); diff --git a/include/Nazara/Utility/SkeletalMesh.hpp b/include/Nazara/Utility/SkeletalMesh.hpp index 523e25032..29900f6db 100644 --- a/include/Nazara/Utility/SkeletalMesh.hpp +++ b/include/Nazara/Utility/SkeletalMesh.hpp @@ -50,8 +50,8 @@ class NAZARA_API NzSkeletalMesh final : public NzSubMesh bool IsAnimated() const final; bool IsValid() const; - void Skin(); - void Skin(const NzSkeleton* skeleton); + void Skin() const; + void Skin(const NzSkeleton* skeleton) const; void SetIndexBuffer(const NzIndexBuffer* indexBuffer); diff --git a/src/Nazara/Utility/KeyframeMesh.cpp b/src/Nazara/Utility/KeyframeMesh.cpp index b3459261a..fbd08fcb6 100644 --- a/src/Nazara/Utility/KeyframeMesh.cpp +++ b/src/Nazara/Utility/KeyframeMesh.cpp @@ -222,7 +222,7 @@ const NzVertexBuffer* NzKeyframeMesh::GetVertexBuffer() const return m_impl->vertexBuffer; } -void NzKeyframeMesh::Interpolate(unsigned int frameA, unsigned int frameB, float interpolation) +void NzKeyframeMesh::Interpolate(unsigned int frameA, unsigned int frameB, float interpolation) const { #if NAZARA_UTILITY_SAFE if (!m_parent->HasAnimation()) @@ -419,7 +419,7 @@ void NzKeyframeMesh::Unlock() const } } -void NzKeyframeMesh::InterpolateImpl(unsigned int frameA, unsigned int frameB, float interpolation) +void NzKeyframeMesh::InterpolateImpl(unsigned int frameA, unsigned int frameB, float interpolation) const { #ifdef NAZARA_DEBUG if (!m_impl) diff --git a/src/Nazara/Utility/Mesh.cpp b/src/Nazara/Utility/Mesh.cpp index 50746f107..daa0ac94d 100644 --- a/src/Nazara/Utility/Mesh.cpp +++ b/src/Nazara/Utility/Mesh.cpp @@ -170,7 +170,7 @@ bool NzMesh::AddSubMesh(const NzString& identifier, NzSubMesh* subMesh) return true; } -void NzMesh::Animate(unsigned int frameA, unsigned int frameB, float interpolation) +void NzMesh::Animate(unsigned int frameA, unsigned int frameB, float interpolation) const { #if NAZARA_UTILITY_SAFE if (!m_impl) @@ -805,7 +805,7 @@ bool NzMesh::SetAnimation(const NzAnimation* animation) return true; } -void NzMesh::Skin(const NzSkeleton* skeleton) +void NzMesh::Skin(const NzSkeleton* skeleton) const { #if NAZARA_UTILITY_SAFE if (!m_impl) diff --git a/src/Nazara/Utility/SkeletalMesh.cpp b/src/Nazara/Utility/SkeletalMesh.cpp index 75cd2117e..cbfcbfb0d 100644 --- a/src/Nazara/Utility/SkeletalMesh.cpp +++ b/src/Nazara/Utility/SkeletalMesh.cpp @@ -221,7 +221,7 @@ bool NzSkeletalMesh::IsValid() const return m_impl != nullptr; } -void NzSkeletalMesh::Skin() +void NzSkeletalMesh::Skin() const { #if NAZARA_UTILITY_SAFE if (!m_impl) @@ -234,7 +234,7 @@ void NzSkeletalMesh::Skin() Skin(m_parent->GetSkeleton()); } -void NzSkeletalMesh::Skin(const NzSkeleton* skeleton) +void NzSkeletalMesh::Skin(const NzSkeleton* skeleton) const { #if NAZARA_UTILITY_SAFE if (!m_impl)