Material Class Reference

#include <material.h>

Inheritance diagram for Material:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual Magick::Color get_color (const Point3D &intersection_point, const Renderable *const obj) const
virtual Magick::Color get_color (const Point3D &intersection_point) const=0
virtual double get_diffuse (const Point3D &intersection_point) const=0
virtual double get_opacity (const Point3D &intersection_point) const=0
virtual double get_reflection (const Point3D &intersection_point) const=0
virtual double get_reflectivity (const Point3D &intersection_point) const=0
virtual double get_refraction_index (const Point3D &intersection_point) const=0
virtual bool is_light (const Point3D &intersection_point) const=0
virtual void set_diffuse (double diffuse)=0
virtual void set_is_light (bool v)=0
virtual void set_opacity (double opacity)=0
virtual ~Material ()
 Virtual destructor.

Detailed Description

This class defines various properties of materials from which primitives are made. Each get_* method takes the point in which the ray intersected with the primitive. Note that the material has no concept of the actual shape of the primitive, and can only make a determination of each attribute based on where in space it is. Therefore, what is rendered could be considered the intersection of the infinite space in which the material exists and the finite space in which the primitive exists.

Having said all that, it might make sense anyway in the future to pass in the surface normal as well, or some other generic data about the primitive, to facilitate materials such as texture-maps or allow for bizarre, abstract materials.

Definition at line 17 of file material.h.


Constructor & Destructor Documentation

virtual Material::~Material (  )  [inline, virtual]

Virtual destructor.

Definition at line 22 of file material.h.


Member Function Documentation

virtual Magick::Color Material::get_color ( const Point3D intersection_point,
const Renderable *const  obj 
) const [inline, virtual]

Calculate color at given point on the material given the surface normal passed in. The default behavior of this is to call Material::get_color(Point3D) ignoring the normal. If this behavior is not desired, override this method in child classes.

Returns:
Color at given point

Reimplemented in ImageMap.

Definition at line 34 of file material.h.

References get_color().

Here is the call graph for this function:

virtual Magick::Color Material::get_color ( const Point3D intersection_point  )  const [pure virtual]

Calculate color at given point on the material.

Returns:
Color at given point

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by Renderable::get_color(), NoiseMaterial::get_color(), MarbleMaterial::get_color(), CheckeredMaterial::get_color(), and get_color().

Here is the caller graph for this function:

virtual double Material::get_diffuse ( const Point3D intersection_point  )  const [pure virtual]

Get the diffusion coefficient at the point.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
the diffusion coefficient at the given point.

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by Renderable::get_diffuse(), NoiseMaterial::get_diffuse(), MarbleMaterial::get_diffuse(), and CheckeredMaterial::get_diffuse().

Here is the caller graph for this function:

virtual double Material::get_opacity ( const Point3D intersection_point  )  const [pure virtual]

Get the opacity of this material at the point.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
opacity at the given point

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by Renderable::get_opacity(), NoiseMaterial::get_opacity(), MarbleMaterial::get_opacity(), and CheckeredMaterial::get_opacity().

Here is the caller graph for this function:

virtual double Material::get_reflection ( const Point3D intersection_point  )  const [pure virtual]

Get reflection coefficient at the point.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
the reflection coefficient at the given point

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by Renderable::get_reflection(), NoiseMaterial::get_reflection(), MarbleMaterial::get_reflection(), and CheckeredMaterial::get_reflection().

Here is the caller graph for this function:

virtual double Material::get_reflectivity ( const Point3D intersection_point  )  const [pure virtual]

Get reflectivity at the point.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
the reflectivity at the given point

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by Renderable::get_reflectivity(), NoiseMaterial::get_reflectivity(), MarbleMaterial::get_reflectivity(), and CheckeredMaterial::get_reflectivity().

Here is the caller graph for this function:

virtual double Material::get_refraction_index ( const Point3D intersection_point  )  const [pure virtual]

Get the index of refraction at the given point. Note that varying the index of refraction across the material will most likely return results that are not accurate.

Parameters:
intersection_point Point in space where ray intersected an object
Returns:
refraction index at the given point

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by Renderable::get_refraction_index(), NoiseMaterial::get_refraction_index(), MarbleMaterial::get_refraction_index(), and CheckeredMaterial::get_refraction_index().

Here is the caller graph for this function:

virtual bool Material::is_light ( const Point3D intersection_point  )  const [pure virtual]

Determine if material emits light at given point. Note: due to the rendering algoritm currently being used, varying this value based on position might have unexpected results.

Returns:
true if material emits light

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by Renderable::is_light().

Here is the caller graph for this function:

virtual void Material::set_diffuse ( double  diffuse  )  [pure virtual]

Set the diffusion coefficient for the object. Subclasses are not required to do anything useful with this information.

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by CheckeredMaterial::set_diffuse().

Here is the caller graph for this function:

virtual void Material::set_is_light ( bool  v  )  [pure virtual]

Set whether or not object emits light. Subclasses are not required to do anything useful with this information.

Parameters:
v True if material emits light

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by Renderable::set_is_light().

Here is the caller graph for this function:

virtual void Material::set_opacity ( double  opacity  )  [pure virtual]

Set opacity for the object. Subclasses are not required to do anything useful with this information.

Parameters:
opacity The suggested opacity for the material

Implemented in CheckeredMaterial, ImageMap, MarbleMaterial, NoiseMaterial, and SolidMaterial.

Referenced by CheckeredMaterial::set_opacity().

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated on Tue Oct 30 22:12:22 2007 for mbrt by  doxygen 1.5.2