World::Material Class Reference

#include <Material.hh>

Collaboration diagram for World::Material:

Collaboration graph
[legend]

List of all members.


Detailed Description

Material data and operations.

Class holds information about material. Including: diffuse, specular, refract, reflect textures and reflective, refractive, absorptive (doubles) properties. Provides means of getting material color at given point.

Definition at line 32 of file Material.hh.


Public Types

enum  Filter { DIFFUSE, SPECULAR, REFRACT, REFLECT }
enum  Property {
  REFLECTIVE, REFRACTIVE, ABSORPTIVE, SHININESS,
  INDEX
}

Public Member Functions

 Material (const Texture &Diffuse=TexLib::Red(), const Texture &Specular=TexLib::White(), const Texture &Refract=TexLib::Black(), const Texture &Reflect=TexLib::Black(), Double Reflective=0.0, Double Refractive=0.0, Double Absorptive=0.9, Double Shininess=12.0, Double Index=1.0)
const TextureGetTexture (Filter f) const
Double GetProperty (Property p) const
Color GetColor (Filter f, const Math::Point &UV) const

Private Attributes

const TextureDiffuse
const TextureSpecular
const TextureRefract
const TextureReflect
Double Reflective
Double Refractive
Double Absorptive
Double Shininess
Double Index

Friends

std::ostream & operator<< (std::ostream &os, const Material &M)

Member Enumeration Documentation

Filter selection

Definition at line 68 of file Material.hh.

Material property selection

Definition at line 70 of file Material.hh.


Constructor & Destructor Documentation

World::Material::Material ( const Texture Diffuse = TexLib::Red(),
const Texture Specular = TexLib::White(),
const Texture Refract = TexLib::Black(),
const Texture Reflect = TexLib::Black(),
Double  Reflective = 0.0,
Double  Refractive = 0.0,
Double  Absorptive = 0.9,
Double  Shininess = 12.0,
Double  Index = 1.0 
) [inline]

Creates material using default values

Definition at line 50 of file Material.hh.


Member Function Documentation

const Texture& World::Material::GetTexture ( Filter  f  )  const [inline]

Get one of material textures

Definition at line 73 of file Material.hh.

References Diffuse, Reflect, Refract, and Specular.

Referenced by GetColor().

Here is the caller graph for this function:

Double World::Material::GetProperty ( Property  p  )  const [inline]

Get material property

Definition at line 86 of file Material.hh.

References Absorptive, Index, Reflective, Refractive, and Shininess.

Referenced by World::Object::GetProperty().

Here is the caller graph for this function:

Color World::Material::GetColor ( Filter  f,
const Math::Point UV 
) const [inline]

Get color of one material at given point

Definition at line 101 of file Material.hh.

References World::Texture::Get(), and GetTexture().

Referenced by World::Object::ColorAt().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Material M 
) [friend]

Pretty-printer

Definition at line 24 of file Material.cc.


Member Data Documentation

Material diffuse color

Definition at line 35 of file Material.hh.

Referenced by GetTexture(), and World::operator<<().

Specular color

Definition at line 36 of file Material.hh.

Referenced by GetTexture(), and World::operator<<().

Applied to refracting rays

Definition at line 37 of file Material.hh.

Referenced by GetTexture(), and World::operator<<().

Applied to reflected rays

Definition at line 38 of file Material.hh.

Referenced by GetTexture(), and World::operator<<().

Double World::Material::Reflective [private]

How many photons are reflected

Definition at line 42 of file Material.hh.

Referenced by GetProperty().

Double World::Material::Refractive [private]

How many photons are refracted

Definition at line 43 of file Material.hh.

Referenced by GetProperty().

Double World::Material::Absorptive [private]

How many photons are absorbed

Definition at line 44 of file Material.hh.

Referenced by GetProperty().

Double World::Material::Shininess [private]

Used for specular calculations in raytracer

Definition at line 45 of file Material.hh.

Referenced by GetProperty(), and World::operator<<().

Double World::Material::Index [private]

Refractive index of material

Definition at line 46 of file Material.hh.

Referenced by GetProperty(), and World::operator<<().


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

Generated on Wed Mar 12 00:36:26 2008 for blaRAY by  doxygen 1.5.5