Ray Tracer  2020
Public Member Functions | Public Attributes | List of all members
Material Class Reference

Class defining Material colours and properties. More...

#include <Material.h>

Public Member Functions

 Material ()
 Material default constructor. More...
 
 Material (const Material &material)=default
 Matieral copy constructor. More...
 
 ~Material ()=default
 Material destructor. More...
 
Materialoperator= (const Material &material)=default
 Matieral assignment operator. More...
 

Public Attributes

Colour ambientColour
 Colour of Material under white ambient light. Usually, but not always, the same as diffuseColour. More...
 
Colour diffuseColour
 Colour of Material under direct white light. Usually, but not always, the same as ambientColour. More...
 
Colour specularColour
 Colour of Material's specular highlights. If this is zero then there are no highlights. More...
 
double specularExponent
 'Hardness' of Material's specular hightlights - high values give small, sharp highlights. More...
 
Colour mirrorColour
 Colour of reflected rays under direct white light. If this is zero then there are no reflections. More...
 

Detailed Description

Class defining Material colours and properties.

The interaction between light and various sorts of material can be very complex. In this ray tracer, we use a simplified model, which still has several components. A Material for an object has a number of different Colour properties. The observed Colour of an object comes from the interaction of different types of light and different Material properties:

Constructor & Destructor Documentation

◆ Material() [1/2]

Material::Material ( )

Material default constructor.

By default a Material is white, but has no specuar or mirror component.

◆ Material() [2/2]

Material::Material ( const Material material)
default

Matieral copy constructor.

Parameters
materialThe Material to copy.

◆ ~Material()

Material::~Material ( )
default

Material destructor.

Member Function Documentation

◆ operator=()

Material& Material::operator= ( const Material material)
default

Matieral assignment operator.

Parameters
materialThe Material to assign to this.
Returns
A reference to this to allow for chaining of assignment.

Member Data Documentation

◆ ambientColour

Colour Material::ambientColour

Colour of Material under white ambient light. Usually, but not always, the same as diffuseColour.

◆ diffuseColour

Colour Material::diffuseColour

Colour of Material under direct white light. Usually, but not always, the same as ambientColour.

◆ mirrorColour

Colour Material::mirrorColour

Colour of reflected rays under direct white light. If this is zero then there are no reflections.

◆ specularColour

Colour Material::specularColour

Colour of Material's specular highlights. If this is zero then there are no highlights.

◆ specularExponent

double Material::specularExponent

'Hardness' of Material's specular hightlights - high values give small, sharp highlights.


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