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

Public Member Functions

 Dielectric (double refractionIndex)
 Construct a new Dielectric object.
 
 Dielectric (double refractionIndex, const Utils::Color &albedo)
 Construct a new Dielectric object.
 
bool scatter (const Core::Ray &ray, const Core::Payload &payload, Utils::Color &attenuation, Core::Ray &scattered) const override
 Scatter the ray with the dielectric material.
 
Utils::Color emitted (double u, double v, const Utils::Point3 &point) const override
 Calculate the refracted ray.
 

Static Public Member Functions

static double reflectance (double cosine, double index)
 Calculate the reflectance of the dielectric material.
 

Constructor & Destructor Documentation

◆ Dielectric() [1/2]

Raytracer::Materials::Dielectric::Dielectric ( double refractionIndex)

Construct a new Dielectric object.

This function constructs a new Dielectric object with the given refraction index.

Parameters
refractionIndexThe refraction index of the dielectric.
Returns
A new Dielectric object.

◆ Dielectric() [2/2]

Raytracer::Materials::Dielectric::Dielectric ( double refractionIndex,
const Utils::Color & albedo )

Construct a new Dielectric object.

This function constructs a new Dielectric object with the given refraction index and albedo.

Parameters
refractionIndexThe refraction index of the dielectric.
albedoThe albedo of the dielectric.
Returns
A new Dielectric object.

Member Function Documentation

◆ emitted()

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

Calculate the refracted ray.

This function calculates the refracted ray. The function returns the refracted ray.

Parameters
uvThe unit vector.
normalThe normal vector.
indexThe refraction index.
Returns
The refracted ray.

Implements Raytracer::Interfaces::IMaterial.

◆ reflectance()

double Raytracer::Materials::Dielectric::reflectance ( double cosine,
double index )
static

Calculate the reflectance of the dielectric material.

This function calculates the reflectance of the dielectric material. The function returns the reflectance of the dielectric material.

Parameters
cosineThe cosine of the angle.
indexThe refraction index.
Returns
The reflectance of the dielectric material.

◆ scatter()

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

Scatter the ray with the dielectric material.

This function scatters the ray with the dielectric 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: