CIvfLight Class Reference

#include <ivf/IvfLight.h>

Inheritance diagram for CIvfLight:

CIvfShape CIvfObject CIvfBase CIvfRefCountBase CIvfRTTIBase List of all members.

Public Types

enum  TLightType { LT_POINT, LT_DIRECTIONAL, LT_SPOT }

Public Member Functions

void enable ()
void disable ()
bool isEnabled ()
void setNumber (int number)
 IvfClassInfo ("CIvfLight", CIvfShape)
void setAmbientColor (const float r, const float g, const float b, const float a)
void setDiffuseColor (const float r, const float g, const float b, const float a)
void setSpecularColor (const float r, const float g, const float b, const float a)
void setLightPosition (const float x, const float y, const float z, const float w)
void setLightPosition (const float x, const float y, const float z)
void setDirection (const float x, const float y, const float z)
void setConstAtt (const int a)
void setLinAtt (const int a)
void setQuadAtt (const int a)
void getAmbientColor (float &r, float &g, float &b, float &a) const
void getDiffuseColor (float &r, float &g, float &b, float &a) const
void getSpecularColor (float &r, float &g, float &b, float &a) const
void getLightPosition (float &x, float &y, float &z, float &w) const
void getConstAtt (int &a) const
void getLinAtt (int &a) const
void getQuadAtt (int &a) const
void setSpotExponent (float exponent)
float getSpotExponent ()
void setSpotCutoff (float cutoff)
float getSpotCutoff ()
void setSpotDirection (float ex, float ey, float ez)
void getSpotDirection (float &ex, float &ey, float &ez)
void setType (TLightType lightType)
TLightType getType ()

Protected Member Functions

virtual void createGeometry ()

Detailed Description

Light class

Implements a single OpenGL light source. Instances of the CIvfLight class should be retrieved from the CIvfLighting singleton.

Author:
Carl-Johan Lejdfors and Jonas Lindemann
Examples:

extrusion.cpp.

Definition at line 40 of file IvfLight.h.


Member Function Documentation

virtual void CIvfLight::createGeometry  )  [protected, virtual]
 

Forces an object recalculation.

Reimplemented from CIvfShape.

void CIvfLight::disable  ) 
 

Disable light

Reimplemented from CIvfObject.

void CIvfLight::enable  ) 
 

Enable light

Reimplemented from CIvfObject.

void CIvfLight::getAmbientColor float &  r,
float &  g,
float &  b,
float &  a
const
 

Return ambient light components

void CIvfLight::getConstAtt int &  a  )  const
 

return constant attenuation

void CIvfLight::getDiffuseColor float &  r,
float &  g,
float &  b,
float &  a
const
 

return diffuse light components

void CIvfLight::getLightPosition float &  x,
float &  y,
float &  z,
float &  w
const
 

return light position

void CIvfLight::getLinAtt int &  a  )  const
 

return linear attenuation

void CIvfLight::getQuadAtt int &  a  )  const
 

return quadratic attenuation

void CIvfLight::getSpecularColor float &  r,
float &  g,
float &  b,
float &  a
const
 

return specular light components

float CIvfLight::getSpotCutoff  ) 
 

Return spotlight cutoff angle

void CIvfLight::getSpotDirection float &  ex,
float &  ey,
float &  ez
 

Return spotlight direction

float CIvfLight::getSpotExponent  ) 
 

Return spotlight exponent value

TLightType CIvfLight::getType  ) 
 

Return current type of light

bool CIvfLight::isEnabled  ) 
 

Returns true if light enabled

Reimplemented from CIvfObject.

void CIvfLight::setAmbientColor const float  r,
const float  g,
const float  b,
const float  a
 

Set ambient light components

void CIvfLight::setConstAtt const int  a  ) 
 

Set constant attenuation

void CIvfLight::setDiffuseColor const float  r,
const float  g,
const float  b,
const float  a
 

Set diffuse light components

void CIvfLight::setLightPosition const float  x,
const float  y,
const float  z,
const float  w
 

Set light position

Parameters:
x light x coordinate
y light y coordinate
z light z coordinate
w light type (w = 0 directional light, w=1 positional light)

void CIvfLight::setLinAtt const int  a  ) 
 

Set linear attenuation

void CIvfLight::setNumber int  number  ) 
 

Set the number of the light = GL_LIGHT0 + number

void CIvfLight::setQuadAtt const int  a  ) 
 

Set quadratic attenutation

void CIvfLight::setSpecularColor const float  r,
const float  g,
const float  b,
const float  a
 

Set specular light components

void CIvfLight::setSpotCutoff float  cutoff  ) 
 

Set spotlight cutoff angle

void CIvfLight::setSpotDirection float  ex,
float  ey,
float  ez
 

Set direction of spotlight

void CIvfLight::setSpotExponent float  exponent  ) 
 

Set spotlight exponent value

void CIvfLight::setType TLightType  lightType  ) 
 

Set light type

param lightType can be LT_POINT for a point source, LT_DIRECTIONAL for a directional light source and LT_SPOT for a spotlight


The documentation for this class was generated from the following file:
Generated on Fri Sep 1 15:36:52 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO