public HitRecord intersect(Ray r) {
   HitRecord h = rectangle.intersect(r);
   if (h == null) return null;
   h.intersectable = this;
   h.material = this.areaLightMaterial;
   h.p = 1.f / area;
   return h;
 }
 /** Sample a point on the light geometry. */
 public HitRecord sample(float[] s) {
   HitRecord hitRecord = new HitRecord();
   Vector3f edge1Sampled = new Vector3f(edge1);
   edge1Sampled.scale(s[0]);
   Vector3f edge2Sampled = new Vector3f(edge2);
   edge2Sampled.scale(s[1]);
   Point3f position = new Point3f(this.lightPos);
   position.add(edge1Sampled);
   position.add(edge2Sampled);
   hitRecord.position = position;
   hitRecord.intersectable = this;
   hitRecord.material = this.areaLightMaterial;
   hitRecord.normal = new Vector3f(this.normal);
   hitRecord.p = 1.f / area;
   return hitRecord;
 }