11 #ifndef degreesToRadians
12 #define degreesToRadians(x) x*(3.141592f/180.0f)
15 #ifndef GLM_FORCE_RADIANS
16 #define GLM_FORCE_RADIANS
24 enum {POINT_LIGHT, SPOT_LIGHT, DIR_LIGHT, NB_LIGHT_TYPES};
31 MbsLight(glm::mat4
const& parent_mat = glm::mat4(1.0f), glm::vec3
const& color = glm::vec3(1.0f),
32 float ambient = 0.05f,
bool active =
true,
33 int depth_x_width = 1024,
int depth_y_width = 1024,
float shadow_bias = 0.0f,
34 float depth_near = -10.0f,
float depth_far = 20.0f,
35 glm::vec3
const& rel_shadow_z_up = glm::vec3(0.0, 0.0, 1.0),
36 float depth_scale = 0.0015f,
float depth_FoV_rad = 1.0f,
37 glm::vec3
const& shadow_point = glm::vec3(0.0f),
38 glm::vec3
const& shadow_dir = glm::vec3(1.0f));
41 virtual void Update();
44 virtual void UpdateParentPos(glm::mat4
const& parent_mat) { this->parent_mat = parent_mat; }
47 bool IsActive()
const {
return active; }
50 int GetType()
const {
return type; }
53 glm::vec3 GetColor()
const {
return color; }
56 float GetAmbient()
const {
return ambient; }
59 int GetDepthXWidth()
const {
return depth_x_width; }
62 int GetDepthYWidth()
const {
return depth_y_width; }
65 float GetShadowBias()
const {
return shadow_bias; }
68 float GetDepthNear()
const {
return depth_near; }
71 float GetDepthFar()
const {
return depth_far; }
74 glm::vec3 GetShadowZUp()
const {
return shadow_z_up; }
77 float GetDepthScale()
const {
return depth_scale; }
80 float GetDepthFoVRad()
const {
return depth_FoV_rad; }
83 glm::vec3 GetShadowDir()
const {
return shadow_dir; }
86 glm::vec3 GetShadowPoint()
const {
return shadow_point; }
100 glm::vec4 rel_z_up_4;
110 glm::vec3 shadow_z_up;
114 glm::vec3 shadow_point;
120 glm::vec3 shadow_dir;