--- /dev/null
+#ifndef MSP_GL_POINTLIGHT_H_
+#define MSP_GL_POINTLIGHT_H_
+
+#include "light.h"
+#include "vector.h"
+
+namespace Msp {
+namespace GL {
+
+/**
+A positional, omnidirectional light source. The light's strength can be
+attenuated based on distance.
+*/
+class PointLight: public Light
+{
+public:
+ class Loader: public DataFile::DerivedObjectLoader<PointLight, Light::Loader>
+ {
+ private:
+ static ActionMap shared_actions;
+
+ public:
+ Loader(PointLight &);
+
+ private:
+ virtual void init_actions();
+
+ void attenuation(float, float, float);
+ void position(float, float, float);
+ };
+
+private:
+ Vector3 position;
+ float attenuation[3];
+
+public:
+ PointLight();
+
+private:
+ void update_matrix();
+
+public:
+ /** Sets the light's position from a matrix. Only the translation part is
+ used. */
+ virtual void set_matrix(const Matrix &);
+
+ void set_position(const Vector3 &);
+ const Vector3 &get_position();
+
+ void set_attenuation(float, float, float);
+ const float *get_attenuation() const { return attenuation; }
+
+protected:
+ virtual void update_shader_data(ProgramData &, const std::string &) const;
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif