Assignments
Assignments
Ray::SphereLight Class Reference

#include <sphereLight.h>

Inheritance diagram for Ray::SphereLight:
Ray::PointLight Ray::Light

Public Member Functions

std::string name (void) const
 
Util::Point3D transparency (const class RayShapeIntersectionInfo &iInfo, const class Shape &shape, Util::Point3D cLimit, unsigned int samples, unsigned int tIdx) const
 
- Public Member Functions inherited from Ray::PointLight
Util::Point3D getAmbient (Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const
 
Util::Point3D getDiffuse (Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const
 
Util::Point3D getSpecular (Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const
 
bool isInShadow (const class RayShapeIntersectionInfo &iInfo, const class Shape &shape, unsigned int tIdx) const
 
void drawOpenGL (int index, GLSLProgram *glslProgram) const
 
- Public Member Functions inherited from Ray::Light
virtual ~Light (void)
 

Static Public Member Functions

static std::string Directive (void)
 
- Static Public Member Functions inherited from Ray::PointLight
static std::string Directive (void)
 

Protected Attributes

double _radius
 
- Protected Attributes inherited from Ray::PointLight
Util::Point3D _location
 
double _constAtten
 
double _linearAtten
 
double _quadAtten
 
- Protected Attributes inherited from Ray::Light
Util::Point3D _ambient
 
Util::Point3D _diffuse
 
Util::Point3D _specular
 

Private Member Functions

void _write (std::ostream &stream) const
 
void _read (std::istream &stream)
 

Detailed Description

This class describes a spherical area-light light-source. This light has a fixed position in space and a fixed radius. The light attenuates as a function of the distance from the light-source.

Member Function Documentation

◆ _read()

void SphereLight::_read ( std::istream &  stream)
privatevirtual

This method reads the Light from the stream (excluding the starting directive)

Reimplemented from Ray::PointLight.

◆ _write()

void SphereLight::_write ( std::ostream &  stream) const
privatevirtual

This method writes the Light into the stream (including the starting directive)

Reimplemented from Ray::PointLight.

◆ Directive()

static std::string Ray::SphereLight::Directive ( void  )
inlinestatic

This static method returns the directive describing the Light.

◆ name()

std::string Ray::SphereLight::name ( void  ) const
inlinevirtual

This method returns the name of the shape

Reimplemented from Ray::PointLight.

◆ transparency()

Point3D SphereLight::transparency ( const class RayShapeIntersectionInfo iInfo,
const class Shape shape,
Util::Point3D  cLimit,
unsigned int  samples,
unsigned int  tIdx 
) const
virtual

This method tests if the intersection point represented by iInfo is in partial shadow from the light source. A ray is cast from the hit location to the light source, and the transparency values are accumulated. If the light source is an area light source, multiple rays area cast to (uniformly randomly chosen positions on the area light sources and the transparency is set to the average of the transparency values over the samples. If the transparency value falls below cLimit, the testing terminates.

Reimplemented from Ray::PointLight.

Member Data Documentation

◆ _radius

double Ray::SphereLight::_radius
protected

The radius of the area-light


The documentation for this class was generated from the following files: