PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
skinned_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 SkinnedMesh
16{
17public:
18 SkinnedMesh() = default;
19 SkinnedMesh(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() && !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<glm::mat4>& GetInverseBindMatrices() const
44 {
45 return inverse_bind_matrices_;
46 }
47 const MeshBounds& GetBounds() const
48 {
49 return bounds_;
50 }
51
52private:
53 void Clear();
54
55private:
56 VirtualPath filename_;
57 std::vector<SkinnedMeshVertex> vertices_;
58 std::vector<uint32_t> indices_;
59 std::vector<glm::mat4> inverse_bind_matrices_;
60 MeshBounds bounds_;
61};
62} // namespace pixelbullet
Definition filesystem.h:19
Definition virtual_path.h:10
Definition mesh_types.h:38