TDME2 1.9.121
Material.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <tdme/tdme.h>
8
9using std::string;
10
14
15/**
16 * Represents a material
17 * @author andreas.drewke
18 * @version $Id$
19 */
21{
22private:
25
26public:
27
28 /**
29 * @return default material
30 */
31 inline static Material* getDefaultMaterial() {
32 return defaultMaterial;
33 }
34
35private:
36 string id;
39 bool doubleSided { false };
41
42public:
43 /**
44 * Public constructor
45 * @param id id
46 */
47 Material(const string& id);
48
49 /**
50 * Destructor
51 */
52 ~Material();
53
54 /**
55 * @return material id
56 */
57 inline const string& getId() const {
58 return id;
59 }
60
61 /**
62 * @return specular material properties
63 */
66 }
67
68 /**
69 * @return specular material properties
70 */
73 }
74
75 /**
76 * @return PBR material properties
77 */
80 }
81
82 /**
83 * @return PBR material properties
84 */
87 }
88
89 /**
90 * Set specular material properties
91 * @param specularMaterialProperties specular material properties
92 */
94
95 /**
96 * Set PBR material properties
97 * @param pbrMaterialProperties PBR material properties
98 */
100
101 /**
102 * @return is double sided
103 */
104 inline bool isDoubleSided() const {
105 return doubleSided;
106 }
107
108 /**
109 * Set double sided
110 * @param texture matrix
111 */
112 inline void setDoubleSided(bool doubleSided) {
113 this->doubleSided = doubleSided;
114 }
115
116 /**
117 * @return texture matrix
118 */
119 inline const Matrix2D3x3& getTextureMatrix() const {
120 return textureMatrix;
121 }
122
123 /**
124 * Set texture matrix
125 * @param textureMatrix texture matrix
126 */
128 this->textureMatrix = textureMatrix;
129 }
130
131};
Represents a material.
Definition: Material.h:21
void setSpecularMaterialProperties(SpecularMaterialProperties *specularMaterialProperties)
Set specular material properties.
Definition: Material.cpp:22
void setPBRMaterialProperties(PBRMaterialProperties *pbrMaterialProperties)
Set PBR material properties.
Definition: Material.cpp:29
static Material * getDefaultMaterial()
Definition: Material.h:31
static STATIC_DLL_IMPEXT string defaultMaterialId
Definition: Material.h:23
SpecularMaterialProperties * specularMaterialProperties
Definition: Material.h:37
const string & getId() const
Definition: Material.h:57
const PBRMaterialProperties * getPBRMaterialProperties() const
Definition: Material.h:78
Material(const string &id)
Public constructor.
Definition: Material.cpp:15
void setTextureMatrix(const Matrix2D3x3 &textureMatrix)
Set texture matrix.
Definition: Material.h:127
const SpecularMaterialProperties * getSpecularMaterialProperties() const
Definition: Material.h:64
void setDoubleSided(bool doubleSided)
Set double sided.
Definition: Material.h:112
static STATIC_DLL_IMPEXT Material * defaultMaterial
Definition: Material.h:24
const Matrix2D3x3 & getTextureMatrix() const
Definition: Material.h:119
PBRMaterialProperties * pbrMaterialProperties
Definition: Material.h:38
PBRMaterialProperties * getPBRMaterialProperties()
Definition: Material.h:85
SpecularMaterialProperties * getSpecularMaterialProperties()
Definition: Material.h:71
Represents specular material properties.
Represents specular material properties.
3x3 2D Matrix class
Definition: Matrix2D3x3.h:22
#define STATIC_DLL_IMPEXT
Definition: tdme.h:11