VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
Mesh.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <venom/common/String.h>
13
15
16#include <vector>
17
18namespace venom
19{
20namespace common
21{
22class ModelImpl;
23class VENOM_COMMON_API MeshImpl : public PluginObjectImpl, public GraphicsPluginObject
24{
25public:
26 MeshImpl();
27 virtual ~MeshImpl() = default;
28
29 void SetMaterial(const Material & material);
30 bool HasMaterial() const;
31 const Material & GetMaterial() const;
32 virtual void Draw() = 0;
33
34private:
40 virtual vc::Error __LoadMeshFromCurrentData() = 0;
41
42protected:
43 friend class ModelImpl;
44 vc::Vector<vcm::VertexPos> _positions;
45 vc::Vector<vcm::VertexNormal> _normals;
46 vc::Vector<vcm::VertexColor> _colors[8];
47 vc::Vector<vcm::VertexUV> _uvs[8];
48 vc::Vector<uint32_t> _indices;
49 vc::Vector<vcm::VertexTangent> _tangents;
50 vc::Vector<vcm::VertexBitangent> _bitangents;
52};
53
56class VENOM_COMMON_API Mesh : public PluginObjectImplWrapper
57{
58public:
59 Mesh();
60 ~Mesh();
61
66 inline void SetMaterial(const Material & material) {
67 _impl->As<MeshImpl>()->SetMaterial(material);
68 }
69
74 inline bool HasMaterial() const {
75 return _impl->As<MeshImpl>()->HasMaterial();
76 }
77
82 inline const Material & GetMaterial() const {
83 return _impl->As<MeshImpl>()->GetMaterial();
84 }
85
89 inline void Draw() const {
90 _impl->As<MeshImpl>()->Draw();
91 }
92
93private:
94 friend class ModelImpl;
95};
96
97
98}
99}
Definition Material.h:68
void Draw() const
Draws the mesh.
Definition Mesh.h:89
bool HasMaterial() const
Checks if the mesh has a Material assigned.
Definition Mesh.h:74
const Material & GetMaterial() const
Returns the Material assigned to the mesh.
Definition Mesh.h:82
void SetMaterial(const Material &material)
Assigns Material to mesh.
Definition Mesh.h:66
Definition Mesh.h:24
Definition Model.h:32
Container for the PluginObjectImplWrapper Important to avoid it from loading the PluginObjectImpl if ...
Definition PluginObject.h:111
High-Level Frontend of the VenomEngine project. It also contains all the code shared between every AP...
Definition Callback.h:15
Contains the entirety of the code of the VenomEngine project.
Definition Callback.h:13