code for assignment 4, gitignored *.ppm, *.png
[MicroTrace.git] / QuadAreaLight.hxx
diff --git a/QuadAreaLight.hxx b/QuadAreaLight.hxx
new file mode 100644 (file)
index 0000000..108d5c4
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef QUADAREALIGHT_HXX
+#define QUADAREALIGHT_HXX
+
+#include "Light.hxx"
+
+class QuadAreaLight : public Light
+{
+public:
+  //! Points p1 to p4 are assumed to define a planar rectangular region and have to be given counter-clockwise
+  QuadAreaLight(Scene* scene, const Vec3f& intensity, const Vec3f& p1, const Vec3f& p2, const Vec3f& p3, const Vec3f& p4);
+  virtual ~QuadAreaLight();
+               
+  virtual bool Illuminate(Ray& shadow_ray, Vec3f& intensity);
+  virtual bool IsArea();
+
+  const Vec3f& GetNormal(const Vec3f& position) const;
+
+private:
+  QuadAreaLight();
+  
+  // defines the quad by one point and to vectors
+  Vec3f m_p0, m_e1, m_e2;
+  // normal
+  Vec3f m_n;
+  // emission(red, green, blue)
+  Vec3f m_intensity;
+  // area
+  float m_area;
+};
+#endif
This page took 0.021762 seconds and 4 git commands to generate.