OpenGLPrakt --> cObject --> cVisibleObject --> cInteractiveObject --> cLight --> cSpotLight
A class for an OpenGL directional light. The inherited mRotation quaternion is used (in contrast to cLight) - it modifies the light's direction.
cSpotLight
cSpotLight
cSpotLight
cSpotLight
~cSpotLight
mCutOff
mDirection
mExponent
mOldCutOff
mOldExponent
ActivateLight
DeactivateLight
DrawThisObject
GetDefaultName
ReceiveEvent
SetCutOff
SetDirection
SetExponent
SubscribeToActiveEvents
UnsubscribeFromActiveEvents
public cSpotLight ( cEventDispatcher * disp ,
const char * name = NULL ) ;
default constructor
public cSpotLight ( cEventDispatcher * disp ,
const cVertex & pos ,
const cVertex & dir ,
const char * name = NULL ) ;
constructor with initialization of position and name
| pos | initial position of light source |
| dir | initial direction of light source |
| state | initial state of light source (default: on) |
| name | name of light source (optional) |
public cSpotLight ( cEventDispatcher * disp ,
const cVertex & pos ,
const cVertex & dir ,
const teLightState state = LIGHT_ON ,
const char * name = NULL ) ;
constructor with initialization of position, state and name
| pos | initial position of light source |
| dir | initial direction of light source |
| state | initial state of light source (default: on) |
| name | name of light source (optional) |
public cSpotLight ( cEventDispatcher * disp ,
const cVertex & pos ,
const cVertex & dir ,
const cADSEColor & col ,
const teLightState state = LIGHT_ON ,
const char * name = NULL ) ;
constructor with initialization of position, color, state and name
| dir | initial direction of light source |
| pos | initial position of light source |
| col | color of the light source (cADSEColor object) (emissive color component is not used) |
| state | initial state of light source (default: on) |
| name | name of light source (optional) |
public virtual ~ cSpotLight ( ) ;
destructor
protected cVertex mDirection
actual direction
protected GLfloat mCutOff
current cutoff
protected GLfloat mExponent
current exponent
protected GLfloat mOldCutOff
saved cutoff
protected GLfloat mOldExponent
saved exponent
public virtual void SetDirection ( const cVertex & dir ) ;
set new direction to point to
| dir | new direction |
public virtual void SetCutOff ( const GLfloat cutoff ) ;
set new cutoff
| angle | 0..90 (180 means point light) |
public virtual void SetExponent ( const GLfloat exponent ) ;
set new light distribution exponent
| exponent | 0..128 (0 = uniform light distribution) |
public virtual int ReceiveEvent ( const cEvent & event ) ;
event receiver - we listen for switchon/switchoff events
protected virtual void ActivateLight ( ) ;
this one performs the actual set up of the light
(called by Activate()); separeted to simplify cSpotLight
protected virtual void DrawThisObject ( ) ;
A light is a visible object therefore it needs a drawing function
Not used here - a SpotLight cannot be drawn!
protected virtual void DeactivateLight ( ) ;
restore old cutoff/exponent (called by cLight::Deactivate())
protected virtual void SubscribeToActiveEvents ( ) ;
we want to get events for altering cutoff/exponent
protected virtual void UnsubscribeFromActiveEvents ( ) ;
unsubscribe from events if we get deselected
protected virtual const char * GetDefaultName ( ) const ;
identify an instance of this class if it's got no name
This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.
Click here to return to the top of the page.