C++ / OpenCL Raytracer
Material Class Referenceabstract

#include <material.h>

Inheritance diagram for Material:
Dielectric Lambertian Metal

Public Member Functions

virtual bool Scatter (const Ray &r_in, const HitRecord &rec, Vector3D &attenuation, Ray &scattered) const =0
 
virtual int MatType () const =0
 
virtual Vector3D MatColor () const =0
 
virtual double MatFuzz () const =0
 
virtual double MatRef () const =0
 

Static Public Member Functions

static Vector3D Reflect (const Vector3D &v, const Vector3D &n)
 
static Vector3D RandomInUnitSphere ()
 

Detailed Description

Renderable Material used to color Objects.

Member Function Documentation

◆ MatColor()

virtual Vector3D Material::MatColor ( ) const
pure virtual

Return Vector3D value for material color.

Example:

MatColor();

Implemented in Dielectric, Metal, and Lambertian.

◆ MatFuzz()

virtual double Material::MatFuzz ( ) const
pure virtual

Return double value for material fuzz.

Example:

MatFuzz();

Implemented in Dielectric, Metal, and Lambertian.

◆ MatRef()

virtual double Material::MatRef ( ) const
pure virtual

Return double value for material refraction index.

Example:

MatRef();

Implemented in Dielectric, Metal, and Lambertian.

◆ MatType()

virtual int Material::MatType ( ) const
pure virtual

Return int value based on which material an object has. Used to determine normal calculation for box

Example:

MatType();

Implemented in Dielectric, Metal, and Lambertian.

◆ RandomInUnitSphere()

static Vector3D Material::RandomInUnitSphere ( )
inlinestatic

Returns a random Vector3D with a length greater than 1.0.

Example:

RandomInUnitSphere();

◆ Reflect()

static Vector3D Material::Reflect ( const Vector3D v,
const Vector3D n 
)
inlinestatic

Return reflected Vector3D for input direction and normal.

Example:

Reflect(ray_direction, normal);

◆ Scatter()

virtual bool Material::Scatter ( const Ray r_in,
const HitRecord rec,
Vector3D attenuation,
Ray scattered 
) const
pure virtual

Return boolean value if ray scatters based on Material attenuation.

Example:

Scatter(StartingRay, rec, attenuation, ScatteredRay);

Implemented in Dielectric, Metal, and Lambertian.


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