-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlight.cpp
79 lines (65 loc) · 1.16 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
#include "light.h"
#define RANDCOORD ((rand()%40-20)/10.0)
Light::Light() :
iS(Qt::white),
iD(Qt::white),
pos(new Vertex(RANDCOORD, RANDCOORD, RANDCOORD)),
rotateWithCamera(false)
{
}
Light::Light(const QColor &iS, const QColor &iD, const Vertex &pos, const bool &rotateWithCamera) :
iS(iS),
iD(iD),
pos(new Vertex(pos)),
rotateWithCamera(rotateWithCamera)
{
}
Light::Light(Light *l) :
iS(l->iS),
iD(l->iD),
pos(new Vertex(l->pos)),
rotateWithCamera(l->rotateWithCamera)
{
}
Light::~Light()
{
delete pos;
}
void Light::setID(const QColor &iD)
{
Light::iD = iD;
}
void Light::setIS(const QColor &iS)
{
Light::iS = iS;
}
void Light::setPos(const Vertex &pos)
{
Vertex *old = Light::pos;
Light::pos = new Vertex(pos);
delete old;
}
void Light::setRotateWithCamera(const bool &rotateWithCamera)
{
Light::rotateWithCamera = rotateWithCamera;
}
QColor Light::getID() const
{
return iD;
}
QColor Light::getIS() const
{
return iS;
}
Vertex Light::getPos() const
{
return *pos;
}
Vertex *Light::getPosPtr()
{
return pos;
}
bool Light::isRotateWithCamera() const
{
return rotateWithCamera;
}