-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaterial.cpp
34 lines (25 loc) · 1.15 KB
/
Material.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "Material.h"
namespace GEII
{
Material::Material(void) : mDiffuseColor(1.0f, 1.0f, 1.0f), mSpecularColor(1.0f, 1.0f, 1.0f), mSpecularExponent(1.0f), mOpacity(1.0f), mLightSensitive(true),
mDiffuseTexture(nullptr), mNormalMap(nullptr)
{
}
Material::Material(const glm::vec3 &diffuseColor, const glm::vec3 &specularColor, float specularExponent, float opacity,
const Texture_sptr& diffuseTexture, const Texture_sptr& normalMap, bool lightSensitive)
: mDiffuseColor(diffuseColor), mSpecularColor(specularColor), mSpecularExponent(specularExponent), mOpacity(opacity), mLightSensitive(lightSensitive),
mDiffuseTexture(diffuseTexture), mNormalMap(normalMap)
{
}
Material::Material(const Texture_sptr& diffuseTexture, bool lightSensitive)
: mDiffuseColor(1.0f, 1.0f, 1.0f), mSpecularColor(1.0f, 1.0f, 1.0f), mSpecularExponent(1.0f), mOpacity(1.0f), mLightSensitive(lightSensitive),
mDiffuseTexture(diffuseTexture), mNormalMap(nullptr)
{
}
Material::~Material(void)
{
}
bool Material::isTransparent(void) const {
return mOpacity < 1.0f;
}
}