-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsun.h
More file actions
51 lines (36 loc) · 1 KB
/
Copy pathsun.h
File metadata and controls
51 lines (36 loc) · 1 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
// ----------------------------------------------------------
// sun.h
// ----------------------------------------------------------
#ifndef __SUN_H__
#define __SUN_H__
#include <iostream>
#include <math.h>
class Sun
{
public:
Sun();
~Sun();
void calculatePosition(double, double, double, double,
int);
inline void setColor(double c[4])
{
m_color[0] = c[0];
m_color[1] = c[1];
m_color[2] = c[2];
m_color[3] = c[3];
}
inline double getTheta() const
{ return m_theta; }
inline double getPhi() const
{ return m_phi; }
private:
double m_theta; // angle from surface normal
// 0 = directly overhead
// pi/2 = at horizon
double m_phi; // angle from south direction
// 0 = south
// pi/2 = west
// -pi/2 = east
double m_color[4];
};
#endif // __SUN_H__