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