sandbox
Loading...
Searching...
No Matches
mesh.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_ANIMATIONS_MESH_HPP_
3#define LIBSBX_ANIMATIONS_MESH_HPP_
4
5#include <filesystem>
6
8
9#include <libsbx/math/volume.hpp>
10#include <libsbx/math/sphere.hpp>
11
12#include <libsbx/io/loader_factory.hpp>
13
14#include <libsbx/graphics/pipeline/mesh.hpp>
15
16#include <libsbx/animations/vertex3d.hpp>
17#include <libsbx/animations/skeleton.hpp>
18
19namespace sbx::animations {
20
21class mesh : public graphics::mesh<vertex3d> {
22
24
25public:
26
28
29 using base::mesh;
30
31 mesh(const std::filesystem::path& path);
32
33 ~mesh() override;
34
35 auto skeleton() const -> const animations::skeleton& {
36 return _skeleton;
37 }
38
39private:
40
41 struct skinned_mesh_data {
42 base::mesh_data mesh_data;
44 }; // struct skinned_mesh_data
45
46 mesh(skinned_mesh_data&& data)
47 : base{std::move(data.mesh_data)},
48 _skeleton{std::move(data.skeleton)} { }
49
50 static auto _load(const std::filesystem::path& path) -> skinned_mesh_data;
51
52 animations::skeleton _skeleton;
53
54}; // class mesh
55
56} // namespace sbx::animation
57
58#endif // LIBSBX_ANIMATIONS_MESH_HPP_
Definition: mesh.hpp:21
Definition: skeleton.hpp:21
Definition: mesh.hpp:39
Definition: mesh.hpp:47