Raytracer
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Raytracer::Materials::DiffuseLight Class Reference
Inheritance diagram for Raytracer::Materials::DiffuseLight:
Raytracer::Interfaces::IMaterial

Public Member Functions

 DiffuseLight (std::shared_ptr< Interfaces::ITexture > texture)
 Construct a new DiffuseLight object.
 
 DiffuseLight (const Utils::Color &color)
 Construct a new DiffuseLight object.
 
bool scatter (const Core::Ray &ray, const Core::Payload &payload, Utils::Color &attenuation, Core::Ray &scattered) const override
 Scatter the ray with the diffuse light material.
 
Utils::Color emitted (double u, double v, const Utils::Point3 &point) const override
 Emitted light of the diffuse light material.
 

Constructor & Destructor Documentation

◆ DiffuseLight() [1/2]

Raytracer::Materials::DiffuseLight::DiffuseLight ( std::shared_ptr< Interfaces::ITexture > texture)

Construct a new DiffuseLight object.

This function constructs a new DiffuseLight object with the given texture. The diffuse light material emits light with the given texture.

Parameters
textureThe texture of the diffuse light.
Returns
A new DiffuseLight object.

◆ DiffuseLight() [2/2]

Raytracer::Materials::DiffuseLight::DiffuseLight ( const Utils::Color & color)

Construct a new DiffuseLight object.

This function constructs a new DiffuseLight object with the given color. The diffuse light material emits light with the given color.

Parameters
colorThe color of the diffuse light.
Returns
A new DiffuseLight object.

Member Function Documentation

◆ emitted()

Raytracer::Utils::Color Raytracer::Materials::DiffuseLight::emitted ( double u,
double v,
const Utils::Point3 & point ) const
overridevirtual

Emitted light of the diffuse light material.

This function returns the emitted light of the diffuse light material. The function returns the emitted light of the material at the given point.

Parameters
uThe u coordinate of the texture.
vThe v coordinate of the texture.
pointThe point to get the emitted light from.
Returns
The emitted light of the material.

Implements Raytracer::Interfaces::IMaterial.

◆ scatter()

bool Raytracer::Materials::DiffuseLight::scatter ( const Core::Ray & ray,
const Core::Payload & payload,
Utils::Color & attenuation,
Core::Ray & scattered ) const
overridevirtual

Scatter the ray with the diffuse light material.

This function scatters the ray with the diffuse light material. The function returns true if the ray is scattered. The function returns false if the ray is not scattered. The function updates the attenuation and scattered ray.

Parameters
rayThe ray to scatter.
payloadThe payload of the ray.
attenuationThe attenuation of the ray.
scatteredThe scattered ray.
Returns
true if the ray is scattered, false otherwise.

Implements Raytracer::Interfaces::IMaterial.


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