Upgrade Utility

This commit is contained in:
Jérôme Leclercq
2021-05-24 19:10:53 +02:00
parent b936946154
commit cce32a64d4
120 changed files with 2328 additions and 2971 deletions

View File

@@ -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;
};
}