-
Notifications
You must be signed in to change notification settings - Fork 0
/
DirectionalLight.h
51 lines (41 loc) · 1.54 KB
/
DirectionalLight.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
47
48
49
50
51
// ----------------------------------------------------------------------------------------------------
//
// File name: DirectionalLight.h
// Created By: Haard Panchal
// Create Date: 03/16/2020
//
// Description:
// File has the definition and implementation of the DirectionalLight class
// A directional light means that the light is coming with
// equal intensity and direction at all the points.
//
// History:
// 03/16/19: H. Panchal Created the file
//
// ----------------------------------------------------------------------------------------------------
#ifndef DIRECTIONALLIGHTH
#define DIRECTIONALLIGHTH
#include "Vector3.h"
#include "Light.h"
#include "Helpers.h"
class DirectionalLight: public Light {
private:
Vector3 n; // Direction of the light
public:
__device__ DirectionalLight();
__device__ DirectionalLight(Vector3& direction);
__device__ ~DirectionalLight();
__device__ Vector3 getLightAtPoint(Vector3& point);
__device__ Vector3 getLightPosition() { return LARGENUMBER * n; } // The direction is multiplied with a large number to indicate
// light infinitly away
};
__device__ DirectionalLight::DirectionalLight() {}
__device__ DirectionalLight::DirectionalLight(Vector3& direction) {
n = direction;
n.make_unit_vector();
}
__device__ DirectionalLight::~DirectionalLight() {}
__device__ Vector3 DirectionalLight::getLightAtPoint(Vector3& point) {
return n;
}
#endif