Robotran C Documentation
MbsPointLight.hh
Go to the documentation of this file.
1 
6 #ifdef OPEN_GL
7 
8 #ifndef _MBS_POINT_LIGHT_HH_
9 #define _MBS_POINT_LIGHT_HH_
10 
11 #include "MbsLight.hh"
12 
13 namespace OpenGLMbs{
14 
15 class MbsPointLight: public MbsLight
16 {
17  public:
18  MbsPointLight(glm::vec3 const& rel_pos = glm::vec3(0.0f),
19  glm::vec3 const& attenuation = glm::vec3(1.0f, 0.0f, 0.0f),
20  glm::mat4 const& parent_mat = glm::mat4(1.0f),
21  glm::vec3 const& color = glm::vec3(1.0f),
22  float ambient = 0.05f,
23  bool active = true,
24  int depth_x_width = 1024, int depth_y_width = 1024, float shadow_bias = 0.0f,
25  float depth_near = 0.1f, float depth_far = 100.0f,
26  glm::vec3 const& shadow_z_up = glm::vec3(0.0, 0.0, 1.0),
27  float depth_FoV_rad = 1.0f,
28  glm::vec3 const& shadow_rel_dir = glm::vec3(0.0f, -1.0f, 0.0f));
29  virtual ~MbsPointLight();
30 
31  virtual void Update();
32 
34  glm::vec3 GetPos() const { return pos; }
35 
37  glm::vec3 GetAttenuation() const { return attenuation; }
38 
40  void UpdateRelPos(glm::vec3 const& rel_pos)
41  {
42  this->rel_pos = rel_pos;
43 
44  Update();
45  }
46 
48  virtual void UpdateParentPos(glm::mat4 const& parent_mat)
49  {
50  MbsLight::UpdateParentPos(parent_mat);
51 
52  Update();
53  }
54 
55  protected:
56  glm::vec3 attenuation;
57 
58  glm::vec3 pos;
59  glm::vec3 rel_pos;
60 
61  glm::mat4 mat_pos;
62  glm::mat4 mat_rel;
63 
64  // shadow mapping
65  glm::vec4 shadow_rel_dir_4;
66 };
67 
68 }
69 #endif
70 #endif
OpenGLMbs
Definition: MpegFrameCaptureOptions.hh:6
MbsPointLight.hh
MbsPointLight class.
MbsLight.hh
MbsLight class.