// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Engine - Utility module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_SKELETON_HPP #define NAZARA_SKELETON_HPP #include #include #include #include #include #include #include #include namespace Nz { class Skeleton; using SkeletonConstRef = ObjectRef; using SkeletonLibrary = ObjectLibrary; using SkeletonRef = ObjectRef; struct SkeletonImpl; class NAZARA_UTILITY_API Skeleton : public RefCounted { friend Joint; friend SkeletonLibrary; friend class Utility; public: Skeleton() = default; Skeleton(const Skeleton& skeleton); ~Skeleton(); bool Create(UInt32 jointCount); void Destroy(); const Boxf& GetAABB() const; Joint* GetJoint(const String& jointName); Joint* GetJoint(UInt32 index); const Joint* GetJoint(const String& jointName) const; const Joint* GetJoint(UInt32 index) const; Joint* GetJoints(); const Joint* GetJoints() const; UInt32 GetJointCount() const; int GetJointIndex(const String& jointName) const; void Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation); void Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation, UInt32* indices, UInt32 indiceCount); bool IsValid() const; Skeleton& operator=(const Skeleton& skeleton); template static SkeletonRef New(Args&&... args); // Signals: NazaraSignal(OnSkeletonDestroy, const Skeleton* /*skeleton*/); NazaraSignal(OnSkeletonJointsInvalidated, const Skeleton* /*skeleton*/); NazaraSignal(OnSkeletonRelease, const Skeleton* /*skeleton*/); private: void InvalidateJoints(); void InvalidateJointMap(); void UpdateJointMap() const; static bool Initialize(); static void Uninitialize(); SkeletonImpl* m_impl = nullptr; static SkeletonLibrary::LibraryMap s_library; }; } #include #endif // NAZARA_SKELETON_HPP