-
Notifications
You must be signed in to change notification settings - Fork 1
/
Light.cpp
83 lines (61 loc) · 1.94 KB
/
Light.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Light.cpp: implementation of the CLight class.
//
//////////////////////////////////////////////////////////////////////
#include "Light.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CLight::CLight()
{
}
/*********************************************************************
NAME : CLight
DESCRIPTION: Parametrized constructor
PARAMETER : color : The color of the light
intensity : The brightness of the light.
ptPosition : The position of the light in space.
RETURN : NONE
EXCEPTION : NONE.
*********************************************************************/
CLight::CLight(CColor color, float intensity, CPoint3D ptPosition) : COnScreenObject(ptPosition)
{
this->m_colLight = color;
this->m_fIntensity = intensity;
}
/*********************************************************************
NAME : CLight
DESCRIPTION: Copy constructor
PARAMETER : l1 : The light object to copy.
RETURN : NONE
EXCEPTION : NONE.
*********************************************************************/
CLight::CLight(CLight &l1) : COnScreenObject((COnScreenObject)l1)
{
this->m_colLight = l1.m_colLight;
this->m_fIntensity = l1.m_fIntensity;
}
CLight::~CLight()
{
}
/*********************************************************************
NAME : GetColor
DESCRIPTION: Retrieve the color of the light
PARAMETER : NONE
RETURN : CColor
EXCEPTION : NONE.
*********************************************************************/
CColor CLight::GetColor ()
{
return this->m_colLight;
}
/*********************************************************************
NAME : GetIntensity
DESCRIPTION: Retrieve the intensity of the light
PARAMETER : NONE
RETURN : float
EXCEPTION : NONE.
*********************************************************************/
float CLight::GetIntensity ()
{
return m_fIntensity;
}