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 GameObject* GetGameObject() const { return gameObject; }
15 
17  class Mesh* GetMesh() { return mesh; }
18 
21  void SetMaterial( class Material* material, int subMeshIndex );
22 
24  void SetMesh( Mesh* aMesh );
25 
27  std::string GetSerialized() const;
28 
29  private:
30  friend class GameObject;
31  friend class Scene;
32 
34  static int Type() { return 5; }
35 
37  static unsigned New();
38 
40  static MeshRendererComponent* Get( unsigned index );
41 
46  void Render( const struct Matrix44& modelView, const Matrix44& modelViewProjectionMatrix, const class Frustum& cameraFrustum, const Matrix44& localToWorld, class Shader* overrideShader );
47 
48  Mesh* mesh = nullptr;
49  std::vector< Material* > materials;
50  GameObject* gameObject = nullptr;
51  };
52 }
53 
54 #endif
Material is used to render a mesh.
Definition: Material.hpp:14
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)
class Mesh * GetMesh()
Definition: MeshRendererComponent.hpp:17
Shader program containing a vertex and pixel shader.
Definition: Shader.hpp:26
void SetMesh(Mesh *aMesh)
GameObject is composed of components that define its behavior.
Definition: GameObject.hpp:9
class GameObject * GetGameObject() const
Definition: MeshRendererComponent.hpp:14
Contains game objects in a transform hierarchy.
Definition: Scene.hpp:17