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