Aether3D Game Engine
MeshRendererComponent.hpp
1 #ifndef MESH_RENDERER_COMPONENT
2 #define MESH_RENDERER_COMPONENT
3 
4 #include <string>
5 #include <vector>
6 
7 namespace ae3d
8 {
11  {
12  public:
14  class Mesh* GetMesh() const { return mesh; }
15 
18  void SetMaterial( class Material* material, int subMeshIndex );
19 
21  void SetMesh( Mesh* aMesh );
22 
24  std::string GetSerialized() const;
25 
26  private:
27  friend class GameObject;
28  friend class Scene;
29 
31  static int Type() { return 5; }
32 
34  static unsigned New();
35 
37  static MeshRendererComponent* Get( unsigned index );
38 
42  void Render( const struct Matrix44& modelViewProjectionMatrix, const class Frustum& cameraFrustum, const Matrix44& localToWorld, class Shader* overrideShader );
43 
44  Mesh* mesh = nullptr;
45  std::vector< Material* > materials;
46  };
47 }
48 
49 #endif
Material is used to render a mesh.
Definition: Material.hpp:18
std::string GetSerialized() const
Definition: AudioClip.hpp:4
Contains a mesh.
Definition: MeshRendererComponent.hpp:10
Contains a mesh. Can contain submeshes.
Definition: Mesh.hpp:19
void SetMaterial(class Material *material, int subMeshIndex)
void SetMesh(Mesh *aMesh)
class Mesh * GetMesh() const
Definition: MeshRendererComponent.hpp:14
GameObject is composed of components that define its behavior.
Definition: GameObject.hpp:9
Contains game objects in a transform hierarchy.
Definition: Scene.hpp:16