Improved keyframe mesh interface

Also improved animation performance by using a discard-and-write lock
when interpoling.


Former-commit-id: 277b5ad8f148ab73b99edf83cf8c6e5d0e6dfc82
This commit is contained in:
Lynix
2012-12-03 14:49:56 +01:00
parent 82d6438ec3
commit cc45746799
3 changed files with 38 additions and 45 deletions

View File

@@ -30,7 +30,7 @@ class NAZARA_API NzKeyframeMesh final : public NzSubMesh
nzAnimationType GetAnimationType() const override;
unsigned int GetFrameCount() const;
const NzIndexBuffer* GetIndexBuffer() const override;
bool GetVertex(NzMeshVertex* dest, unsigned int frameIndex, unsigned int vertexIndex, bool queryUV = true) const;
void GetVertex(unsigned int frameIndex, unsigned int vertexIndex, NzMeshVertex* dest) const;
const NzVertexBuffer* GetVertexBuffer() const override;
void Interpolate(const NzAnimation* animation, unsigned int frameA, unsigned int frameB, float interpolation) const;
@@ -42,7 +42,8 @@ class NAZARA_API NzKeyframeMesh final : public NzSubMesh
void SetAABB(unsigned int frameIndex, const NzAxisAlignedBox& aabb);
void SetIndexBuffer(const NzIndexBuffer* indexBuffer);
bool SetVertex(const NzMeshVertex& source, unsigned int frameIndex, unsigned int vertexIndex, bool setUV = true);
void SetVertex(unsigned int frameIndex, unsigned int vertexIndex, const NzMeshVertex& source);
void SetTexCoords(unsigned int vertexIndex, const NzVector2f& uv);
void Unlock() const;