
Added ability to hold shift and skip the terrain generation when loading Added ability for the perlin terrain to save a raw image of the terrain to use as a cache
39 lines
845 B
C++
39 lines
845 B
C++
#include "GlobalLighting.h"
|
|
|
|
GlobalLighting::GlobalLighting()
|
|
{
|
|
// Set the default lighting to 0
|
|
_ambientLight = XMFLOAT4(0.0f, 0.0f, 0.0f, 0.0f);
|
|
_directionalLightVector = XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);
|
|
_directionalLightColor = XMFLOAT4(0.0f, 0.0f, 0.0f, 0.0f);
|
|
}
|
|
|
|
GlobalLighting::~GlobalLighting()
|
|
{
|
|
}
|
|
|
|
void GlobalLighting::SetAmbientLight(XMFLOAT4 ambientLight)
|
|
{
|
|
_ambientLight = ambientLight;
|
|
}
|
|
|
|
XMFLOAT4 GlobalLighting::GetAmbientLight() const
|
|
{
|
|
return _ambientLight;
|
|
}
|
|
|
|
void GlobalLighting::SetDirectionalLight(FXMVECTOR direction, XMFLOAT4 lightColor)
|
|
{
|
|
_directionalLightVector = direction;
|
|
_directionalLightColor = lightColor;
|
|
}
|
|
|
|
XMVECTOR GlobalLighting::GetDirectionalLightDirection() const
|
|
{
|
|
return _directionalLightVector;
|
|
}
|
|
|
|
XMFLOAT4 GlobalLighting::GetDirectionalLightColor() const
|
|
{
|
|
return _directionalLightColor;
|
|
} |