nngn
Loading...
Searching...
No Matches
sun.h
Go to the documentation of this file.
1#ifndef NNGN_SUN_H
2#define NNGN_SUN_H
3
4#include <chrono>
5
6#include "math/vec3.h"
7
8namespace nngn {
9
10class Sun {
11public:
12 using duration = std::chrono::milliseconds;
13private:
14 float m_incidence = 0, m_sin = 0, m_cos = 0, m_arc_len = 0;
16 bool m_updated = false;
17public:
18 Sun();
19 float incidence() const { return this->m_incidence; }
20 duration time() const { return this->m_time; }
21 auto time_ms() const { return this->m_time.count(); }
22 bool updated(void) const { return this->m_updated; }
23 void set_incidence(float a);
24 void set_time(duration t);
25 void set_time_ms(unsigned t) { return this->set_time(Sun::duration(t)); }
26 void set_updated(bool b) { this->m_updated = b; }
27 vec3 dir() const;
28};
29
30}
31
32#endif
Definition sun.h:10
bool updated(void) const
Definition sun.h:22
void set_updated(bool b)
Definition sun.h:26
void set_incidence(float a)
Definition sun.cpp:11
void set_time_ms(unsigned t)
Definition sun.h:25
float m_arc_len
Definition sun.h:14
vec3 dir() const
Definition sun.cpp:24
std::chrono::milliseconds duration
Definition sun.h:12
void set_time(duration t)
Definition sun.cpp:18
duration m_time
Definition sun.h:15
float m_sin
Definition sun.h:14
duration time() const
Definition sun.h:20
Sun()
Definition sun.cpp:9
float m_cos
Definition sun.h:14
auto time_ms() const
Definition sun.h:21
float incidence() const
Definition sun.h:19
float m_incidence
Definition sun.h:14
bool m_updated
Definition sun.h:16
Definition audio.cpp:7
local a
Definition input.lua:35