VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
Model.h
1
8#pragma once
9
13
14#include <vector>
15
16#include <venom/common/ECS.h>
17
18namespace venom
19{
20namespace common
21{
22class Model;
23
24class VENOM_COMMON_API ModelResource : public GraphicsCachedResource
25{
26public:
27 vc::Vector<vc::Mesh> meshes;
28 vc::Vector<vc::Material> materials;
29};
30
31class VENOM_COMMON_API ModelImpl : public PluginObjectImpl, public GraphicsPluginObject, public GraphicsCachedResourceHolder
32{
33public:
34 ModelImpl();
35 virtual ~ModelImpl();
36
37 vc::Error ImportModel(const char * path);
38 virtual void Draw() = 0;
39
40 const vc::Vector<vc::Mesh> & GetMeshes() const;
41 const vc::Vector<vc::Material> & GetMaterials() const;
42 vc::Vector<vc::Material> & GetMaterials();
43
44private:
45 friend class Model;
46
47#ifdef VENOM_DEBUG
48 vc::String __name;
49#endif
50};
51
54class VENOM_COMMON_API Model : public Component, public PluginObjectImplWrapper
55{
56public:
57 Model();
58 Model(const char * path);
59 ~Model();
60
61 void Init(Entity entity) override;
62 void Update(Entity entity) override;
63 void _GUI(const Entity entity) override;
64 vc::String _GetComponentTitle() override;
65 bool CanRemove(Entity entity) override;
66
67 inline void Draw() { _impl->As<ModelImpl>()->Draw(); }
68 inline vc::Error ImportModel(const char * path) { return _impl->As<ModelImpl>()->ImportModel(path); }
69 inline const vc::Vector<vc::Mesh> & GetMeshes() const { return _impl->As<ModelImpl>()->GetMeshes(); }
70 inline const vc::Vector<vc::Material> & GetMaterials() const { return _impl->As<ModelImpl>()->GetMaterials(); }
71 inline vc::Vector<vc::Material> & GetMaterials() { return _impl->As<ModelImpl>()->GetMaterials(); }
72 inline const vc::String & GetName() { return _impl->As<ModelImpl>()->GetResourceName(); }
73 inline const vc::String & GetShortName() { return _impl->As<ModelImpl>()->GetResourceShortName(); }
74};
75
76
77}
78}
Contains all the mesh's data and is the main high-level interface for the user.
Definition Model.h:55
Definition Model.h:32
Definition Model.h:25
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