-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSunNode.hpp
32 lines (26 loc) · 907 Bytes
/
SunNode.hpp
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
#ifndef SUN_NODE_H_
#define SUN_NODE_H_
#include "gloo/SceneNode.hpp"
#include "gloo/lights/DirectionalLight.hpp"
#include "gloo/lights/PointLight.hpp"
namespace GLOO {
class SunNode : public SceneNode {
public:
SunNode();
void Update(double delta_time) override;
void ToggleLight(); // switches between directional "full" light and point light
void SetLightType(LightType light_type); // Only supports directional and point light
void SetRadius(float radius);
LightType GetLightType() const;
// Intensity is a value between 0 and 1
void SetIntensity(float intensity);
private:
void UpdateSun(const glm::vec3& eye, const glm::vec3& direction);
void UpdatePosition(const glm::vec3& position);
std::shared_ptr<DirectionalLight> directional_light_;
std::shared_ptr<PointLight> point_light_;
LightType activated_light_;
double time_elapsed_;
};
} // namespace GLOO
#endif