-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLight.h
46 lines (35 loc) · 788 Bytes
/
Light.h
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
/* THE LIGHT FILE - DEFINES A LIGHT POSITION AND COLOUR IN A RAYTRACER */
#ifndef _Light_H
#define _Light_H
//Includes
#include "Source.h"
#include "Vect.h"
#include "Colour.h"
//The Light class
class Light : public Source {
//The position of the light source
Vect position;
//The colour of the light
Colour colour;
public:
//Constructor functions
Light ();
Light (Vect, Colour);
//Method functions
//Getters
virtual Vect getLightPosition () { return position; }
virtual Colour getLightColour () { return colour; }
};
//Default Light
Light::Light () {
//Positioned at the origin
position = Vect(0,0,0);
//Has white light
colour = Colour(1,1,1, 0);
}
//Define a Light's position and colour
Light::Light (Vect p, Colour c) {
position = p;
colour = c;
}
#endif