1 #ifndef MSP_GL_DIRECTIONALLIGHT_H_
2 #define MSP_GL_DIRECTIONALLIGHT_H_
11 A light source which has uniform direction and strength everywhere.
13 class DirectionalLight: public Light
16 class Loader: public DataFile::DerivedObjectLoader<DirectionalLight, Light::Loader>
19 static ActionMap shared_actions;
22 Loader(DirectionalLight &);
25 virtual void init_actions();
27 void direction(float, float, float);
31 Color transmittance = { 1.0f };
32 Vector3 direction = { 0.0f, 0.0f, -1.0f };
37 /** Sets the light's direction from a matrix. The negative Z axis is used
38 as the direction. Other axes and translation are ignored. */
39 virtual void set_matrix(const Matrix &);
41 void set_direction(const Vector3 &);
43 const Vector3 &get_direction() const { return direction; }
45 /** Sets a multiplier on how much light actually reaches the target. Used
46 when modeling an atmosphere. */
47 void set_transmittance(const Color &);
50 virtual void update_shader_data(ProgramData &, const std::string &) const;