#include <Lighting.h>
Collaboration diagram for Lighting:
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 |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|