Path Tracer
Public Member Functions | List of all members
SpecularMaterial Class Reference

Models a specular material. More...

#include <SpecularMaterial.h>

Inheritance diagram for SpecularMaterial:
[legend]
Collaboration diagram for SpecularMaterial:
[legend]

Public Member Functions

 SpecularMaterial (DoubleVec3D emittance=0)
 Default and main constructor. More...
 
 SpecularMaterial (const SpecularMaterial &material)
 Copy constructor. More...
 
MaterialdeepCopy () const
 Makes a deep copy of this material. More...
 
DoubleUnitVec3D getNewDirection (const Ray &previousRay, const DoubleUnitVec3D &normal) const
 Computes the new ray direction. More...
 
DoubleVec3D computeCurrentRadiance (const DoubleVec3D &recursiveRadiance, double cosAngleNewDirectionNormal, bool nextEventEstimation=false) const
 Computes the new radiance. More...
 
bool worksWithNextEventEstimation () const
 Returns whether this material works with next event estimation. More...
 
std::ostream & getDescription (std::ostream &stream) const
 Returns this material's description. More...
 
std::string getType () const
 Returns "Specular". More...
 
json getSpecificParametersJson () const
 Converts this material's specific parameters to json. More...
 
void setSpecificParametersJson (const json &j)
 Sets this material's specific parameters according to json. More...
 
- Public Member Functions inherited from Material
 Material (DoubleVec3D emittance=0)
 Default and main constructor. More...
 
 Material (const Material &material)
 Copy constructor. More...
 
DoubleVec3D getEmittance () const
 Getter for the emittance attribute. More...
 
void setEmittance (DoubleVec3D emittance)
 Setter for the emittance attribute. More...
 

Detailed Description

Models a specular material.

Constructor & Destructor Documentation

◆ SpecularMaterial() [1/2]

SpecularMaterial::SpecularMaterial ( DoubleVec3D  emittance = 0)

Default and main constructor.

Parameters
emittanceThe radiance this material emits.

◆ SpecularMaterial() [2/2]

SpecularMaterial::SpecularMaterial ( const SpecularMaterial material)

Copy constructor.

Parameters
materialThe material that will be copied.

Member Function Documentation

◆ computeCurrentRadiance()

DoubleVec3D SpecularMaterial::computeCurrentRadiance ( const DoubleVec3D recursiveRadiance,
double  cosAngleNewDirectionNormal,
bool  nextEventEstimation = false 
) const
virtual

Computes the new radiance.

Parameters
recursiveRadianceThe radiance recursively obtained.
cosAngleNewDirectionNormalThe cosine of the angle between the direction of the next ray and the normal at the intersection.
nextEventEstimationWhether the radiance is obtained using the next event estimation algorithm.
Returns
The new radiance.

Implements Material.

◆ deepCopy()

Material * SpecularMaterial::deepCopy ( ) const
virtual

Makes a deep copy of this material.

Returns
A pointer to a deeply copied version of this material.

Implements Material.

◆ getDescription()

std::ostream & SpecularMaterial::getDescription ( std::ostream &  stream) const
virtual

Returns this material's description.

Parameters
streamThe current stream.
Returns
The stream with the description.
See also
operator<<(std::ostream& stream, const Material& material)

Implements Material.

◆ getNewDirection()

DoubleUnitVec3D SpecularMaterial::getNewDirection ( const Ray previousRay,
const DoubleUnitVec3D normal 
) const
virtual

Computes the new ray direction.

Parameters
previousRayThe ray that hits this material.
normalThe normal at the intersection.
Returns
The new ray direction.

Implements Material.

◆ getSpecificParametersJson()

json SpecularMaterial::getSpecificParametersJson ( ) const
virtual

Converts this material's specific parameters to json.

Returns
This material's specific parameters converted to json.

Implements Material.

◆ getType()

std::string SpecularMaterial::getType ( ) const
virtual

Returns "Specular".

Returns
"Specular".

Implements Material.

◆ setSpecificParametersJson()

void SpecularMaterial::setSpecificParametersJson ( const json j)
virtual

Sets this material's specific parameters according to json.

Parameters
jThe json input.

Implements Material.

◆ worksWithNextEventEstimation()

bool SpecularMaterial::worksWithNextEventEstimation ( ) const
virtual

Returns whether this material works with next event estimation.

Returns
False.

Implements Material.


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