Lighting Class Reference

A class that encapsulates Phong lighting operations. More...

#include <Lighting.h>

Collaboration diagram for Lighting:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Lighting (Vector<> l=Vector<>(0,-1,-1).normalize(), const Vector<> &v=Vector<>(0, 0, 1), Color lightColor=Color(255, 255, 255, 255), float kD=0.5, float kS=1.0, float sE=10)
 ~Lighting ()
void updateH ()
void setV (const Vector<> &v)
void setL (const Vector<> &l)
void setKDiffuse (float newKD)
float getKDiffuse () const
void setKSpecular (float newKS)
float getKSpecular () const
void setSExponent (float newSE)
float getSExponent () const
Color getColor (const Color &c, const Vector<> &n) const
void printVectors () const

Private Attributes

Vector mL
Vector mV
Vector mH
Color mLightColor
float mKD
float mKS
float mSE

Detailed Description

A class that encapsulates Phong lighting operations.

The various parameters can be configured using appropriate member functions. Calculating a shaded color is done by calling getColor with the original color value and a normal vector.


Constructor & Destructor Documentation

Lighting::Lighting Vector<>  l = Vector<>(0,-1,-1).normalize(),
const Vector<> &  v = Vector<>(0, 0, 1),
Color  lightColor = Color(255, 255, 255, 255),
float  kD = 0.5,
float  kS = 1.0,
float  sE = 10
 

Lighting::~Lighting  ) 
 


Member Function Documentation

Color Lighting::getColor const Color c,
const Vector<> &  n
const [inline]
 

float Lighting::getKDiffuse  )  const
 

float Lighting::getKSpecular  )  const
 

float Lighting::getSExponent  )  const
 

void Lighting::printVectors  )  const [inline]
 

void Lighting::setKDiffuse float  newKD  ) 
 

void Lighting::setKSpecular float  newKS  ) 
 

void Lighting::setL const Vector<> &  l  ) 
 

void Lighting::setSExponent float  newSE  ) 
 

void Lighting::setV const Vector<> &  v  ) 
 

void Lighting::updateH  ) 
 


Member Data Documentation

Vector Lighting::mH [private]
 

float Lighting::mKD [private]
 

float Lighting::mKS [private]
 

Vector Lighting::mL [private]
 

Color Lighting::mLightColor [private]
 

float Lighting::mSE [private]
 

Vector Lighting::mV [private]
 


The documentation for this class was generated from the following files:
Generated on Mon Dec 19 00:13:42 2005 for Visualization by  doxygen 1.4.5