C++ / OpenCL Raytracer
Lambertian Class Reference

#include <lambertian.h>

Inheritance diagram for Lambertian:
Material

Public Member Functions

 Lambertian (const Vector3D &a)
 
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.
 

Additional Inherited Members

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

Detailed Description

Lambertian diffuse (matte) type Material.

Constructor & Destructor Documentation

◆ Lambertian()

Lambertian::Lambertian ( const Vector3D a)
inline

Create Lambertian Material for object with specified Vector3D color.

Example:

Lambertian(Vector3D(1, 0, 0));

Member Function Documentation

◆ MatColor()

virtual Vector3D Lambertian::MatColor ( ) const
inlinevirtual

Return Vector3D value for material color.

Example:

MatColor();

Implements Material.

◆ MatFuzz()

virtual double Lambertian::MatFuzz ( ) const
inlinevirtual

Return double value for material fuzz.

Example:

MatFuzz();

Implements Material.

◆ MatRef()

virtual double Lambertian::MatRef ( ) const
inlinevirtual

Return double value for material refraction index.

Example:

MatRef();

Implements Material.

◆ MatType()

virtual int Lambertian::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 Lambertian::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: