//----------------------------------------------------------------------------
// William Baxter III's Ray Tracer
//
//     Project for Comp 238, Raster Graphics
//     University of North Carolina at Chapel Hill
//     
// $Id:$
//----------------------------------------------------------------------------

#include <math.h>
#include "wb3AreaLight.hpp"
#include "wb3Material.hpp"
#include "wb3Artifact.hpp"
#include "wb3Scene.hpp"

//----------------------------------------------------------------------------
wb3AreaLight::wb3AreaLight()
{
}
//----------------------------------------------------------------------------
wb3AreaLight::wb3AreaLight(const Vec3f& color)
  : wb3Light(color)
{
  SetSampling(5,5);
}
//----------------------------------------------------------------------------
wb3AreaLight::wb3AreaLight(
  const Vec3f& color, 
  const Vec3f& origin, const Vec3f& U, const Vec3f& V,
  unsigned int Usamp, unsigned int Vsamp
  )
  : wb3Light(color)
{
  SetOrigin(origin);
  SetUV(U, V);
  SetSampling(Usamp, Vsamp);
}
//----------------------------------------------------------------------------

// Jitters the sample point a bit in the Origin,U,V plane.
// Just 
void wb3AreaLight::PerturbSample(Vec3f& pt) const
{
  
}


// Computes the local portion of the illumination for a point
void wb3AreaLight::Contribute(
  const wb3Scene *scene, const wb3Artifact *hit,
  const Ray3f& I, 
  const Vec3f &isect, 
  const Vec3f &N, Vec3f& color) const
{
  // Not implemented just yet...
}
