C++ / OpenCL Raytracer
Metal Class Reference

#include <metal.h>

Inheritance diagram for Metal:
Material

Public Member Functions

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

Public Attributes

Vector3D m_vAlbedo
 Vector3D attenuation of light absorbed or reflected from object.
 
double m_dFuzz
 0.3 - 1.0 (double) value setting the randomness of reflections, thus blurring the metal surface.
 

Additional Inherited Members

- Static Public Member Functions inherited from Material
static Vector3D Reflect (const Vector3D &v, const Vector3D &n)
 
static Vector3D RandomInUnitSphere ()
 

Detailed Description

Metal reflective type Material.

Constructor & Destructor Documentation

◆ Metal()

Metal::Metal ( const Vector3D a,
double  f 
)
inline

Create Metal Material for Object with specified Vector3D color and fuzz value.

Example: Lambertian(Vector3D(1, 0, 0), 0.9);

Member Function Documentation

◆ MatColor()

virtual Vector3D Metal::MatColor ( ) const
inlinevirtual

Return Vector3D value for material color.

Example:

MatColor();

Implements Material.

◆ MatFuzz()

virtual double Metal::MatFuzz ( ) const
inlinevirtual

Return double value for material fuzz.

Example:

MatFuzz();

Implements Material.

◆ MatRef()

virtual double Metal::MatRef ( ) const
inlinevirtual

Return double value for material refraction index.

Example:

MatRef();

Implements Material.

◆ MatType()

virtual int Metal::MatType ( ) const
inlinevirtual

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

Example:

MatType();

Implements Material.

◆ Scatter()

virtual bool Metal::Scatter ( const Ray r_in,
const HitRecord rec,
Vector3D attenuation,
Ray scattered 
) const
inlinevirtual

Return boolean value if ray scatters based on Material attenuation.

Example:

Scatter(StartingRay, rec, attenuation, ScatteredRay);

Implements Material.


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