TDME2 1.9.121
Material.cpp
Go to the documentation of this file.
2
3#include <tdme/tdme.h>
6
7#include <string>
8
9using std::string;
10
14
15Material::Material(const string& id)
16{
17 this->id = id;
18 this->textureMatrix.identity();
20}
21
23 if (this->specularMaterialProperties != nullptr && this->specularMaterialProperties != specularMaterialProperties) {
24 delete this->specularMaterialProperties;
25 }
26 this->specularMaterialProperties = specularMaterialProperties;
27}
28
30 if (this->pbrMaterialProperties != nullptr && this->pbrMaterialProperties != pbrMaterialProperties) {
31 delete this->pbrMaterialProperties;
32 }
33 this->pbrMaterialProperties = pbrMaterialProperties;
34}
35
37 if (this->specularMaterialProperties != nullptr) delete this->specularMaterialProperties;
38 if (this->pbrMaterialProperties != nullptr) delete this->pbrMaterialProperties;
39}
40
41string Material::defaultMaterialId = "tdme.default_material";
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 STATIC_DLL_IMPEXT string defaultMaterialId
Definition: Material.h:23
SpecularMaterialProperties * specularMaterialProperties
Definition: Material.h:37
static STATIC_DLL_IMPEXT Material * defaultMaterial
Definition: Material.h:24
PBRMaterialProperties * pbrMaterialProperties
Definition: Material.h:38
Represents specular material properties.
Represents specular material properties.
Matrix2D3x3 & identity()
Setup identity matrix.
Definition: Matrix2D3x3.h:116