PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
skinned_morph_mesh.h
1#pragma once
2
3#include "pixelbullet/assets/morph_mesh.h"
4#include "pixelbullet/assets/skinned_mesh.h"
5#include "pixelbullet/filesystem/virtual_path.h"
6
7#include <glm/glm.hpp>
8
9#include <cstdint>
10#include <vector>
11
12namespace pixelbullet
13{
14class Filesystem;
15
16class SkinnedMorphMesh
17{
18public:
19 using Vertex = SkinnedMesh::Vertex;
20 using Bounds = SkinnedMesh::Bounds;
21 using Target = MorphMesh::Target;
22
23 SkinnedMorphMesh() = default;
24 SkinnedMorphMesh(const Filesystem& filesystem, const VirtualPath& asset_path)
25 {
26 Load(filesystem, asset_path);
27 }
28
29 bool Load(const Filesystem& filesystem, const VirtualPath& asset_path);
30
31 explicit operator bool() const noexcept
32 {
33 return !vertices_.empty() && !indices_.empty() && !targets_.empty() && !inverse_bind_matrices_.empty();
34 }
35
36 const VirtualPath& GetFilename() const
37 {
38 return filename_;
39 }
40 const std::vector<Vertex>& GetVertices() const
41 {
42 return vertices_;
43 }
44 const std::vector<uint32_t>& GetIndices() const
45 {
46 return indices_;
47 }
48 const std::vector<Target>& GetTargets() const
49 {
50 return targets_;
51 }
52 const std::vector<glm::mat4>& GetInverseBindMatrices() const
53 {
54 return inverse_bind_matrices_;
55 }
56 const Bounds& GetBounds() const
57 {
58 return bounds_;
59 }
60
61private:
62 void Clear();
63
64private:
65 VirtualPath filename_;
66 std::vector<Vertex> vertices_;
67 std::vector<uint32_t> indices_;
68 std::vector<Target> targets_;
69 std::vector<glm::mat4> inverse_bind_matrices_;
70 Bounds bounds_{};
71};
72} // namespace pixelbullet
Definition filesystem.h:16
Definition virtual_path.h:10
Definition morph_mesh.h:22
Definition skinned_mesh.h:31
Definition skinned_mesh.h:18