2#ifndef LIBSBX_ANIMATIONS_SKELETON_HPP_
3#define LIBSBX_ANIMATIONS_SKELETON_HPP_
7#include <unordered_map>
11#include <libsbx/utility/logger.hpp>
12#include <libsbx/utility/hashed_string.hpp>
14#include <libsbx/math/matrix4x4.hpp>
17#include <libsbx/animations/animation.hpp>
19namespace sbx::animations {
26 inline static constexpr auto null = std::uint32_t{0xFFFFFFFF};
28 std::uint32_t parent_id;
33 inline static constexpr auto max_bones = std::uint32_t{64u};
37 auto reserve(
const std::size_t size) -> void;
39 auto shrink_to_fit() -> void;
41 auto add_bone(
const std::string& name,
const bone& bone) -> void;
43 auto root_transform() const -> const math::matrix4x4&;
45 auto inverse_root_transform() const -> const math::matrix4x4&;
47 auto set_inverse_root_transform(const math::matrix4x4& inverse_root_transform) ->
void;
49 auto bones() const -> const std::vector<bone>&;
51 auto evaluate_pose(const
animation&
animation, std::float_t time) const -> std::vector<math::matrix4x4>;
53 auto bone_count() const -> std::uint32_t;
55 auto name_for_bone(const std::
size_t index) const -> const utility::hashed_string&;
57 auto bone_index(const utility::hashed_string& name) const -> std::optional<std::uint32_t>;
61 std::vector<bone> _bones;
62 std::vector<utility::hashed_string> _bone_names_by_id;
63 std::unordered_map<utility::hashed_string, std::uint32_t> _bone_id_by_name;
65 math::matrix4x4 _inverse_root_transform;
66 math::matrix4x4 _root_transform;
Definition: animation.hpp:18
Definition: skeleton.hpp:21
Definition: matrix4x4.hpp:26
Matrix casting and decomposition utilities.
Definition: skeleton.hpp:25