AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
material.h
1#pragma once
2#ifndef _material_H_
3#include"resource.h"
4#include"../rendering/texture.h"
5#include<vector>
6#include<glm/glm.hpp>
7namespace Aire
8{
10 enum ColorType
11 {
12 DIFFUSE_COLOR,
13 SPECULAR_COLOR,
14 AMBIENT_COLOR,
15 };
16
17 using MatHandle = int;
18
20 class Material : public Resource
21 {
22 private:
23 glm::vec3* diffuseColor;
24 glm::vec3* specularColor;
25 glm::vec3* ambientColor;
26 float* shininess;
27
28 TexturePtr diffuseMap;
29 TexturePtr specularMap;
30 TexturePtr normalMap;
31 TexturePtr heightMap;
32
33 MatHandle matHandle;
34
35 public:
36 Material();
37 Material(MatHandle&);
38 ~Material();
39
41 bool hasTexture();
42
46 void setColor(glm::vec3& col, ColorType colType);
47
51 glm::vec3* getColor(ColorType colType);
52
56 void setTexture(TexturePtr&, TextureType texType);
57
61 TexturePtr getTexture(TextureType texType);
62
65 void setShininess(float val);
66 float* getShininess();
67
69 uint32_t getSize();
70
72 MatHandle getHandle();
73 };
74 using MaterialPtr = std::shared_ptr<Material>;
75}
76#endif // !_mesh_H_
Class to identify a material for Blinn-Phong rendering.
Definition material.h:21
bool hasTexture()
Definition material.cpp:42
TexturePtr getTexture(TextureType texType)
Definition material.cpp:84
uint32_t getSize()
Definition material.cpp:106
glm::vec3 * getColor(ColorType colType)
Definition material.cpp:60
MatHandle getHandle()
Definition material.cpp:111
void setColor(glm::vec3 &col, ColorType colType)
Definition material.cpp:49
void setTexture(TexturePtr &, TextureType texType)
Definition material.cpp:71
void setShininess(float val)
Definition material.cpp:96
A base resource class.
Definition resource.h:26