RavEngine
Loading...
Searching...
No Matches
StaticMesh.hpp
1#pragma once
2#if !RVE_SERVER
3
4#include "Material.hpp"
5#include "MeshAsset.hpp"
6#include "BuiltinMaterials.hpp"
7#include "mathtypes.hpp"
8#include "Transform.hpp"
9#include "ComponentWithOwner.hpp"
10
11namespace RavEngine {
12 struct MeshCollectionStatic;
13
15 private:
17 Ref<MaterialInstance> material;
18 StaticMesh(Entity owner, decltype(mesh) m) : ComponentWithOwner(owner){
19 SetMesh(m);
20 }
21 void updateMaterialInWorldRenderData(decltype(material) mat);
22 inline void SetMesh(decltype(mesh) m) {
23 mesh = m;
24 //TODO: notify world render datastructure of this change
25 }
26 public:
27
28 StaticMesh(Entity owner, Ref<MeshCollectionStatic> m, decltype(material) mat) : StaticMesh(owner, m) {
29 SetMaterial(mat);
30 }
31
32 MOVE_NO_COPY(StaticMesh);
33
34 virtual ~StaticMesh(){}
35
36 inline auto GetMesh() const{
37 return mesh;
38 }
39
44 inline void SetMaterial(decltype(material) mat){
45 updateMaterialInWorldRenderData(mat);
46 material = mat;
47 }
48
52 inline auto GetMaterial() const{
53 return material;
54 }
55
56
57 // shadow Disableable::SetEnabled
58 void SetEnabled(bool);
59 };
60}
61#endif
Definition ComponentWithOwner.hpp:17
Definition ComponentWithOwner.hpp:6
Definition StaticMesh.hpp:14
void SetMaterial(decltype(material) mat)
Definition StaticMesh.hpp:44
auto GetMaterial() const
Definition StaticMesh.hpp:52
Definition concurrentqueue.h:747
Definition Animation.hpp:6
Definition Entity.hpp:11