Files
NazaraEngine/include/Nazara/Utility/Skeleton.hpp
Jérôme Leclercq 03e2801dbe Split engine to packages NazaraUtils and NZSL (#375)
* Move code to NazaraUtils and NZSL packages

* Reorder includes

* Tests: Remove glslang and spirv-tools deps

* Tests: Remove glslang init

* Remove NazaraUtils tests and fix Vector4Test

* Fix Linux compilation

* Update msys2-build.yml

* Fix assimp package

* Update xmake.lua

* Update xmake.lua

* Fix shader compilation on MinGW

* Final fixes

* The final fix 2: the fix strikes back!

* Disable cache on CI

* The return of the fix™️
2022-05-25 19:36:10 +02:00

72 lines
1.9 KiB
C++

// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// 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_UTILITY_SKELETON_HPP
#define NAZARA_UTILITY_SKELETON_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utils/Signal.hpp>
#include <string>
namespace Nz
{
class Joint;
class Skeleton;
using SkeletonLibrary = ObjectLibrary<Skeleton>;
struct SkeletonImpl;
class NAZARA_UTILITY_API Skeleton
{
friend Joint;
public:
Skeleton();
Skeleton(const Skeleton& skeleton);
Skeleton(Skeleton&&) noexcept;
~Skeleton();
bool Create(std::size_t jointCount);
void Destroy();
const Boxf& GetAABB() const;
Joint* GetJoint(const std::string& jointName);
Joint* GetJoint(std::size_t index);
const Joint* GetJoint(const std::string& jointName) const;
const Joint* GetJoint(std::size_t index) const;
Joint* GetJoints();
const Joint* GetJoints() const;
std::size_t GetJointCount() 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, const std::size_t* indices, std::size_t indiceCount);
bool IsValid() const;
Skeleton& operator=(const Skeleton& skeleton);
Skeleton& operator=(Skeleton&&) noexcept;
// Signals:
NazaraSignal(OnSkeletonJointsInvalidated, const Skeleton* /*skeleton*/);
private:
void InvalidateJoints();
void InvalidateJointMap();
void UpdateJointMap() const;
std::unique_ptr<SkeletonImpl> m_impl;
};
}
#include <Nazara/Utility/Skeleton.inl>
#endif // NAZARA_UTILITY_SKELETON_HPP