-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointlightclass.cpp
More file actions
58 lines (46 loc) · 1.44 KB
/
Copy pathpointlightclass.cpp
File metadata and controls
58 lines (46 loc) · 1.44 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "pointlightclass.h"
PointLightClass::PointLightClass() { }
PointLightClass::PointLightClass(const PointLightClass& other) { }
PointLightClass::~PointLightClass() { }
void PointLightClass::SetDiffuseColor(float red, float green, float blue, float alpha) {
m_pointdiffuseColor = XMFLOAT4(red, green, blue, alpha);
}
void PointLightClass::SetDirection(float x, float y, float z) {
m_direction = XMFLOAT3(x, y, z);
}
void PointLightClass::SetPosition(float x, float y, float z) {
m_position = XMFLOAT4(x, y, z, 1.0f);
}
XMFLOAT4 PointLightClass::GetDiffuseColor() {
return m_pointdiffuseColor;
}
XMFLOAT3 PointLightClass::GetDirection() {
return m_direction;
}
XMFLOAT4 PointLightClass::GetPosition() {
return m_position;
}
// r 82 g 71 b 66 n 78
void PointLightClass::colorsetting(InputClass* m_Input)
{
if ( m_Input->IsKeyDown(82))
{
//m_diffuseColor = XMFLOAT4(1.0f, 0.0f, 0.0f, 1.0f);
SetDiffuseColor(0.5f, 0.0f, 0.0f, 1.0f);
}
if (m_Input->IsKeyDown(71))
{
// m_diffuseColor = XMFLOAT4(0.0f, 1.0f, 0.0f, 1.0f);
SetDiffuseColor(0.0f, 0.5f, 0.0f, 1.0f);
}
if (m_Input->IsKeyDown(66))
{
//m_diffuseColor = XMFLOAT4(0.0f, 0.0f, 1.0f, 1.0f);
SetDiffuseColor(0.0f, 0.0f, 0.5f, 1.0f);
}
if (m_Input->IsKeyDown(78)) // n
{
//m_diffuseColor = XMFLOAT4(0.0f, 0.0f, 1.0f, 1.0f);
SetDiffuseColor(0.0f, 0.0f, 0.0f, 0.0f);
}
}