Untitled Game engine no.5  1.0
MeshRenderer.hpp
1 //
2 // Created by jibbo on 4/13/21.
3 //
4 
5 #ifndef ENGINE_PROJ_MESHRENDERER_HPP
6 #define ENGINE_PROJ_MESHRENDERER_HPP
7 #include "Mesh.hpp"
8 #include "Texture.hpp"
9 
10 namespace Engine {
15  struct MeshRenderer {
20 
24  Ref<TextureMap> map = nullptr;
25 
29  Ref<Texture> texture = nullptr;
30 
34  std::vector<Ref<Texture>> vertexTextures = std::vector<Ref<Texture>>();
35 
40  Ref<Mesh> mesh = nullptr;
41 
47  void SetMesh(const Ref<Mesh>& renderMesh) {
48  this->mesh = renderMesh;
49  }
50 
56  void SetMap(const Ref<Texture>& tex) {
57  map = tex->getDefaultMapping();
58  texture = tex;
59  }
60  };
61 }
62 
63 #endif //ENGINE_PROJ_MESHRENDERER_HPP
Engine::MeshRenderer
Scene Component for passing drawing data to the renderer. Stores vertex data and references to the te...
Definition: MeshRenderer.hpp:15
Engine::MeshRenderer::SetMap
void SetMap(const Ref< Texture > &tex)
Definition: MeshRenderer.hpp:56
Engine::Ref
std::shared_ptr< T > Ref
Has stuff for making references a lot more easily shared smart pointer.
Definition: Base.hpp:21
Engine::MeshRenderer::map
Ref< TextureMap > map
Definition: MeshRenderer.hpp:24
Engine::MeshRenderer::texture
Ref< Texture > texture
Definition: MeshRenderer.hpp:29
Engine::MeshRenderer::SetMesh
void SetMesh(const Ref< Mesh > &renderMesh)
Definition: MeshRenderer.hpp:47
Engine::MeshRenderer::vertexTextures
std::vector< Ref< Texture > > vertexTextures
Definition: MeshRenderer.hpp:34
Engine
Definition: Animation.hpp:14
Engine::MeshRenderer::mesh
Ref< Mesh > mesh
Definition: MeshRenderer.hpp:40
Engine::MeshRenderer::colorMap
Ref< ColorMap > colorMap
Definition: MeshRenderer.hpp:19