--- /dev/null
+#ifndef MSP_GL_DIRECTIONALLIGHT_H_
+#define MSP_GL_DIRECTIONALLIGHT_H_
+
+#include "light.h"
+#include "vector.h"
+
+namespace Msp {
+namespace GL {
+
+/**
+A light source which has uniform direction and strength everywhere.
+*/
+class DirectionalLight: public Light
+{
+public:
+ class Loader: public DataFile::DerivedObjectLoader<DirectionalLight, Light::Loader>
+ {
+ private:
+ static ActionMap shared_actions;
+
+ public:
+ Loader(DirectionalLight &);
+
+ private:
+ virtual void init_actions();
+
+ void direction(float, float, float);
+ };
+
+private:
+ Color transmittance;
+ Vector3 direction;
+
+public:
+ DirectionalLight();
+
+private:
+ void update_matrix();
+
+public:
+ /** Sets the light's direction from a matrix. The negative Z axis is used
+ as the direction. Other axes and translation are ignored. */
+ virtual void set_matrix(const Matrix &);
+
+ void set_direction(const Vector3 &);
+
+ const Vector3 &get_direction() const { return direction; }
+
+ /** Sets a multiplier on how much light actually reaches the target. Used
+ when modeling an atmosphere. */
+ void set_transmittance(const Color &);
+
+protected:
+ virtual void update_shader_data(ProgramData &, const std::string &) const;
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif