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

Public Member Functions

 Metal (const Utils::Color &albedo, double fuzz)
 Construct a new Metal object.
 
bool scatter (const Core::Ray &ray, const Core::Payload &payload, Utils::Color &attenuation, Core::Ray &scattered) const override
 Scatter the ray with the Metal material.
 
Utils::Color emitted (double u, double v, const Utils::Point3 &point) const override
 Emitted light of the Metal material.
 

Constructor & Destructor Documentation

◆ Metal()

Raytracer::Materials::Metal::Metal ( const Utils::Color & albedo,
double fuzz )

Construct a new Metal object.

This function constructs a new Metal object with the given albedo and fuzz. The Metal material scatters light with the given albedo and fuzz.

Parameters
albedoThe albedo of the Metal material.
fuzzThe fuzz of the Metal material.
Returns
A new Metal object.

Member Function Documentation

◆ emitted()

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

Emitted light of the Metal material.

This function returns the emitted light of the Metal 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 of intersection.
Returns
The emitted light of the material.

Implements Raytracer::Interfaces::IMaterial.

◆ scatter()

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

Scatter the ray with the Metal material.

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