In file graphics3D/Light.h:

class Light

OpenGL light

Inheritance:


Public Methods

void setLight (const GLfloat *ambient, const GLfloat *diffuse, const GLfloat *specular, const GLfloat *position, const GLfloat *direction = 0, GLfloat exponent = 0.0, GLfloat cutoff = 180.0, const GLfloat *attenuation = 0)
set new light attributes
GLenum getIndex (void) const
returns OpenGL light index
bool isActive (void) const
returns light active flag
const GLfloat* getAmbient (void) const
returns light ambient coefficients
const GLfloat* getDiffuse (void) const
returns light diffuse coefficients
const GLfloat* getSpecular (void) const
returns light specular coefficients
const GLfloat* getPosition (void) const
returns light position
const GLfloat* getDirection (void) const
returns spotlight direction
GLfloat getExponent (void) const
returns spotlight expoenent
GLfloat getCutoff (void) const
returns spotlight cutoff (in degrees)
const GLfloat* getAttenuation (void) const
returns light attenuation factors (constant, linear and quadratic)
void setAmbient (const GLfloat *ambient)
set light ambient coefficients
void setDiffuse (const GLfloat *diffuse)
set light diffuse coefficients
void setSpecular (const GLfloat *specular)
set light specular coefficients
void setPosition (const GLfloat *position)
set light position coefficients
void setDirection (const GLfloat *direction)
set spotlight direction coefficients
void setExponent (const GLfloat exponent)
set spotlight exponent
void setCutoff (const GLfloat cutoff)
set spotlight cutoff
void setAttenuation (const GLfloat *attenuation)
set light attenuation coefficients
void glSet (void)
recomputes if needed and executes material display list
void enable (void)
enable (use) light
void disable (void)
disable light plane
void displayFantom (bool disp)
choose whether to display a graphical representation fo this spot light
void putInCamera (void)
set spot light in scene
CameraOGL* getCamera () const
returns the camera that is lit

Public

constructors
Light (CameraOGL *cam)
default (white) light
Light (CameraOGL *cam, const GLfloat *ambient, const GLfloat *diffuse, const GLfloat *specular, const GLfloat *position, const GLfloat *direction = 0, GLfloat exponent = 0.0, GLfloat cutoff = 180.0, const GLfloat *attenuation = 0)
creates a new light
destructor
virtual ~Light ()
destroys display list

Protected Fields

LightFantom* fantom
light graphic primitive
CameraOGL* camera
camera owning this light
GLenum index
OpenGL light id
bool active
is light active
GLfloat ambient [4]
light ambient coefficients
GLfloat diffuse [4]
light diffuse coefficients
GLfloat specular [4]
light specular coefficients
GLfloat position [4]
light source position
GLfloat direction [3]
spot direction
GLfloat exponent
spotlight exponent
GLfloat cutoff
spotlight cutoff (in degrees)
GLfloat attenuation [3]
spotlight constant, linear and quardatic attenuation factors

Documentation

OpenGL light
LightFantom* fantom
light graphic primitive

CameraOGL* camera
camera owning this light

GLenum index
OpenGL light id

bool active
is light active

GLfloat ambient[4]
light ambient coefficients

GLfloat diffuse[4]
light diffuse coefficients

GLfloat specular[4]
light specular coefficients

GLfloat position[4]
light source position

GLfloat direction[3]
spot direction

GLfloat exponent
spotlight exponent

GLfloat cutoff
spotlight cutoff (in degrees)

GLfloat attenuation[3]
spotlight constant, linear and quardatic attenuation factors

constructors

Light(CameraOGL *cam)
default (white) light
Parameters:
cam - camera owning this light

Light(CameraOGL *cam, const GLfloat *ambient, const GLfloat *diffuse, const GLfloat *specular, const GLfloat *position, const GLfloat *direction = 0, GLfloat exponent = 0.0, GLfloat cutoff = 180.0, const GLfloat *attenuation = 0)
creates a new light
Parameters:
cam - camera owning this light
ambient - ambient light 4 coefficients
diffuse - diffuse light 4 coefficients
specular - specular light 4 coefficients
position - light position 4 coefficients
direction - spotlight direction 3 coefficients
exponent - spotlight exponent
cutoff - spotlight cutoff (in degrees)
attenuation - spotlight 3 attenuation factors

destructor

virtual ~Light()
destroys display list

void setLight(const GLfloat *ambient, const GLfloat *diffuse, const GLfloat *specular, const GLfloat *position, const GLfloat *direction = 0, GLfloat exponent = 0.0, GLfloat cutoff = 180.0, const GLfloat *attenuation = 0)
set new light attributes
Parameters:
ambient - ambient light 4 coefficients
diffuse - diffuse light 4 coefficients
specular - specular light 4 coefficients
position - light position 4 coefficients
direction - spotlight direction 3 coefficients
exponent - spotlight exponent
cutoff - spotlight cutoff (in degrees)
attenuation - spotlight 3 attenuation factors

GLenum getIndex(void) const
returns OpenGL light index

bool isActive(void) const
returns light active flag

const GLfloat* getAmbient(void) const
returns light ambient coefficients

const GLfloat* getDiffuse(void) const
returns light diffuse coefficients

const GLfloat* getSpecular(void) const
returns light specular coefficients

const GLfloat* getPosition(void) const
returns light position

const GLfloat* getDirection(void) const
returns spotlight direction

GLfloat getExponent(void) const
returns spotlight expoenent

GLfloat getCutoff(void) const
returns spotlight cutoff (in degrees)

const GLfloat* getAttenuation(void) const
returns light attenuation factors (constant, linear and quadratic)

void setAmbient(const GLfloat *ambient)
set light ambient coefficients
Parameters:
ambient - 4 coefficients array

void setDiffuse(const GLfloat *diffuse)
set light diffuse coefficients
Parameters:
diffuse - 4 coefficients array

void setSpecular(const GLfloat *specular)
set light specular coefficients
Parameters:
specular - 4 coefficients array

void setPosition(const GLfloat *position)
set light position coefficients
Parameters:
position - 4 coefficients array (light is at infinity if position[3] == 0.0)

void setDirection(const GLfloat *direction)
set spotlight direction coefficients
Parameters:
direction - 3 coefficients array

void setExponent(const GLfloat exponent)
set spotlight exponent
Parameters:
exponent - exponent value

void setCutoff(const GLfloat cutoff)
set spotlight cutoff
Parameters:
cutoff - cutoff value (in degrees)

void setAttenuation(const GLfloat *attenuation)
set light attenuation coefficients
Parameters:
attenuation - 3 coefficients (attenuation[0] = constant, attenuation[1] = linear and attenuation[2] = quadratic)

void glSet(void)
recomputes if needed and executes material display list

void enable(void)
enable (use) light

void disable(void)
disable light plane

void displayFantom(bool disp)
choose whether to display a graphical representation fo this spot light
Parameters:
disp - display fantom if disp == true

void putInCamera(void)
set spot light in scene

CameraOGL* getCamera() const
returns the camera that is lit


Direct child classes:
TclLight

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de