--- /dev/null
+#include "Light.hxx"
+
+Light::Light(Scene* scene)
+ : m_scene(scene)
+{
+}
+
+Light::~Light()
+{
+}
+
+Light::Light()
+ : m_scene(0)
+{
+}
+
+Light::Light(const Light& l)
+{
+ operator=(l);
+}
+
+Light&
+Light::operator=(const Light& )
+{
+ return *this;
+}
--- /dev/null
+#ifndef LIGHT_HXX
+#define LIGHT_HXX
+
+#include "Vec3f.hxx"
+#include "Ray.hxx"
+
+// forward declaration
+class Scene;
+
+class Light
+{
+public:
+ Light(Scene* scene);
+ virtual ~Light();
+
+ virtual bool Illuminate(Ray& shadowray, Vec3f& intensity) = 0;
+protected:
+ Scene* m_scene;
+
+private:
+ Light();
+ Light(const Light& );
+ Light& operator=(const Light& );
+};
+#endif
--- /dev/null
+#include "PhongShader.hxx"
+
+PhongShader::PhongShader(Scene* scene,
+ const Vec3f& am_c,
+ const Vec3f& di_c,
+ const Vec3f& sp_c,
+ float ka,
+ float kd,
+ float ks,
+ float ke)
+ : Shader(scene),
+ m_ambient_color(am_c),
+ m_diffuse_color(di_c),
+ m_specular_color(sp_c),
+ m_ka(ka),
+ m_kd(kd),
+ m_ks(ks),
+ m_ke(ke)
+{
+}
+
+PhongShader::PhongShader()
+ : Shader(0)
+{
+}
+
+PhongShader::~PhongShader()
+{
+}
+
+Vec3f
+PhongShader::Shade(Ray& ray)
+{
+ return Vec3f();
+}
--- /dev/null
+#ifndef PHONGSHADER_HXX
+#define PHONGSHADER_HXX
+
+#include "Shader.hxx"
+
+class PhongShader : public Shader
+{
+public:
+ PhongShader(Scene* scene,
+ const Vec3f& ambient_color,
+ const Vec3f& diffuse_color,
+ const Vec3f& specular_color,
+ float ka,
+ float kd,
+ float ks,
+ float ke);
+ virtual ~PhongShader();
+
+ virtual Vec3f Shade(Ray& ray);
+private:
+ PhongShader();
+
+ Vec3f m_ambient_color, m_diffuse_color, m_specular_color;
+ float m_ka, m_kd, m_ks, m_ke;
+};
+#endif
--- /dev/null
+#include "PointLight.hxx"
+
+PointLight::PointLight(Scene* scene, const Vec3f& pos, const Vec3f& intensity)
+ : Light(scene),
+ m_pos(pos),
+ m_intensity(intensity)
+{
+}
+
+PointLight::~PointLight()
+{
+}
+
+PointLight::PointLight()
+ : Light(0),
+ m_pos(Vec3f()),
+ m_intensity(Vec3f())
+{
+}
+
+bool
+PointLight::Illuminate(Ray& ray, Vec3f& intensity)
+{
+
+ return false;
+}
+
+const Vec3f&
+PointLight::position() const
+{
+ return m_pos;
+}
+
+const Vec3f&
+PointLight::intensity() const
+{
+ return m_intensity;
+}
+
+
--- /dev/null
+#ifndef POINTLIGHT_HXX
+#define POINTLIGHT_HXX
+
+#include "Light.hxx"
+
+class PointLight : public Light
+{
+public:
+ PointLight(Scene* scene, const Vec3f& pos, const Vec3f& intensity);
+ virtual ~PointLight();
+
+ virtual bool Illuminate(Ray& ray, Vec3f& intensity);
+
+ const Vec3f& position() const;
+ const Vec3f& intensity() const;
+
+private:
+ PointLight();
+
+ // origin
+ Vec3f m_pos;
+ // emission ( red, green, blue )
+ Vec3f m_intensity;
+};
+#endif
--- /dev/null
+#include "SpotLight.hxx"
+
+SpotLight::SpotLight(Scene* scene,
+ const Vec3f& pos,
+ const Vec3f& dir,
+ const Vec3f& intensity,
+ float alpha_min,
+ float alpha_max)
+ : Light(scene),
+ m_pos(pos),
+ m_dir(dir),
+ m_intensity(intensity),
+ m_alpha_min(alpha_min),
+ m_alpha_max(alpha_max)
+{
+}
+
+SpotLight::~SpotLight()
+{
+}
+
+SpotLight::SpotLight()
+ : Light(0),
+ m_pos(Vec3f()),
+ m_dir(Vec3f()),
+ m_intensity(Vec3f()),
+ m_alpha_min(0.0f),
+ m_alpha_max(0.0f)
+{
+}
+
+bool
+SpotLight::Illuminate(Ray& ray, Vec3f& intensity)
+{
+ return false;
+}
+
+const Vec3f&
+SpotLight::position() const
+{
+ return m_pos;
+}
+
+const Vec3f&
+SpotLight::direction() const
+{
+ return m_dir;
+}
--- /dev/null
+#ifndef SPOTLIGHT_HXX
+#define SPOTLIGHT_HXX
+
+#include "Light.hxx"
+
+class SpotLight : public Light
+{
+public:
+ SpotLight(Scene* scene, const Vec3f& pos, const Vec3f& dir, const Vec3f& intensity, float alpha_min, float alpha_max);
+ virtual ~SpotLight();
+
+ virtual bool Illuminate(Ray& ray, Vec3f& intensity);
+
+ const Vec3f& position() const;
+ const Vec3f& direction() const;
+
+private:
+ SpotLight();
+
+ // position and direction
+ Vec3f m_pos, m_dir;
+ // emission (red, green, blue)
+ Vec3f m_intensity;
+ // opening angles
+ float m_alpha_min, m_alpha_max;
+};
+#endif