// 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 class NzSkeleton; using NzSkeletonConstRef = NzObjectRef; using NzSkeletonLibrary = NzObjectLibrary; using NzSkeletonRef = NzObjectRef; struct NzSkeletonImpl; class NAZARA_API NzSkeleton : public NzRefCounted { friend NzJoint; friend NzSkeletonLibrary; friend class NzUtility; public: NzSkeleton() = default; NzSkeleton(const NzSkeleton& skeleton); ~NzSkeleton(); bool Create(unsigned int jointCount); void Destroy(); const NzBoxf& GetAABB() const; NzJoint* GetJoint(const NzString& jointName); NzJoint* GetJoint(unsigned int index); const NzJoint* GetJoint(const NzString& jointName) const; const NzJoint* GetJoint(unsigned int index) const; NzJoint* GetJoints(); const NzJoint* GetJoints() const; unsigned int GetJointCount() const; int GetJointIndex(const NzString& jointName) const; void Interpolate(const NzSkeleton& skeletonA, const NzSkeleton& skeletonB, float interpolation); void Interpolate(const NzSkeleton& skeletonA, const NzSkeleton& skeletonB, float interpolation, unsigned int* indices, unsigned int indiceCount); bool IsValid() const; NzSkeleton& operator=(const NzSkeleton& skeleton); template static NzSkeletonRef New(Args&&... args); // Signals: NazaraSignal(OnSkeletonDestroy, const NzSkeleton*); //< Args: me NazaraSignal(OnSkeletonJointsInvalidated, const NzSkeleton*); //< Args: me NazaraSignal(OnSkeletonRelease, const NzSkeleton*); //< Args: me private: void InvalidateJoints(); void InvalidateJointMap(); void UpdateJointMap() const; static bool Initialize(); static void Uninitialize(); NzSkeletonImpl* m_impl = nullptr; static NzSkeletonLibrary::LibraryMap s_library; }; #include #endif // NAZARA_SKELETON_HPP