//----------------------------------------------------------------------------
// William Baxter III's Ray Tracer
//
//     Project for Comp 238, Raster Graphics
//     University of North Carolina at Chapel Hill
//     
// $Id:$
//----------------------------------------------------------------------------

#include <math.h>
#include "wb3AmbientLight.hpp"
#include "wb3Material.hpp"
#include "wb3Artifact.hpp"
#include "wb3Scene.hpp"

//----------------------------------------------------------------------------
wb3AmbientLight::wb3AmbientLight()
  : wb3Light()
{
}
//----------------------------------------------------------------------------
wb3AmbientLight::wb3AmbientLight(const Vec3f& color)
  : wb3Light(color)
{
}
//----------------------------------------------------------------------------


// Computes the local portion of the illumination for a point
void wb3AmbientLight::Contribute(
  const wb3Scene *scene, const wb3Artifact *hit,
  const Ray3f& I, 
  const Vec3f &isect, 
  const Vec3f &N, Vec3f& color) const
{
  // No shadow rays here because ambient light is directionless
  // and everywhere.  It surrounds us and penetrates us just like
  // the Force.

  // Contribute Ambient
  Vec3f amb;
  color += GetColor() & hit->GetAmbient(amb, isect);
}

