PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
static_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 StaticMesh
14{
15public:
16 StaticMesh() = default;
17 StaticMesh(const Filesystem& filesystem, const VirtualPath& assetPath)
18 {
19 Load(filesystem, assetPath);
20 }
21
22 bool Load(const Filesystem& filesystem, const VirtualPath& assetPath);
23
24 explicit operator bool() const noexcept
25 {
26 return !vertices_.empty() && !indices_.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 MeshBounds& GetBounds() const
42 {
43 return bounds_;
44 }
45
46private:
47 void Clear();
48
49private:
50 VirtualPath filename_;
51 std::vector<MeshVertex> vertices_;
52 std::vector<uint32_t> indices_;
53 MeshBounds bounds_;
54};
55} // namespace pixelbullet
Definition filesystem.h:19
Definition virtual_path.h:10
Definition mesh_types.h:38