Upgrade Utility
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Core/ObjectLibrary.hpp>
|
||||
#include <Nazara/Core/ObjectRef.hpp>
|
||||
#include <Nazara/Core/RefCounted.hpp>
|
||||
#include <Nazara/Core/Signal.hpp>
|
||||
#include <Nazara/Math/Box.hpp>
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
@@ -21,21 +19,18 @@ namespace Nz
|
||||
class Joint;
|
||||
class Skeleton;
|
||||
|
||||
using SkeletonConstRef = ObjectRef<const Skeleton>;
|
||||
using SkeletonLibrary = ObjectLibrary<Skeleton>;
|
||||
using SkeletonRef = ObjectRef<Skeleton>;
|
||||
|
||||
struct SkeletonImpl;
|
||||
|
||||
class NAZARA_UTILITY_API Skeleton : public RefCounted
|
||||
class NAZARA_UTILITY_API Skeleton
|
||||
{
|
||||
friend Joint;
|
||||
friend SkeletonLibrary;
|
||||
friend class Utility;
|
||||
|
||||
public:
|
||||
Skeleton() = default;
|
||||
Skeleton();
|
||||
Skeleton(const Skeleton& skeleton);
|
||||
Skeleton(Skeleton&&) noexcept;
|
||||
~Skeleton();
|
||||
|
||||
bool Create(std::size_t jointCount);
|
||||
@@ -49,33 +44,25 @@ namespace Nz
|
||||
Joint* GetJoints();
|
||||
const Joint* GetJoints() const;
|
||||
std::size_t GetJointCount() const;
|
||||
int GetJointIndex(const std::string& jointName) const;
|
||||
std::size_t GetJointIndex(const std::string& jointName) const;
|
||||
|
||||
void Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation);
|
||||
void Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation, std::size_t* indices, std::size_t indiceCount);
|
||||
void Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation, const std::size_t* indices, std::size_t indiceCount);
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
Skeleton& operator=(const Skeleton& skeleton);
|
||||
|
||||
template<typename... Args> static SkeletonRef New(Args&&... args);
|
||||
Skeleton& operator=(Skeleton&&) noexcept;
|
||||
|
||||
// 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;
|
||||
std::unique_ptr<SkeletonImpl> m_impl;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user