OpenGLPrakt --> cObject --> cVisibleObject --> cInteractiveObject --> cLight --> cSpotLight

class cSpotLight
    extends cLight as public

A class for an OpenGL directional light. The inherited mRotation quaternion is used (in contrast to cLight) - it modifies the light's direction.

Source:
../src/cSpotLight.hh:35

Constructors Index

cSpotLight
[public] default constructor
cSpotLight
[public] constructor with initialization of position and name
cSpotLight
[public] constructor with initialization of position, state and name
cSpotLight
[public] constructor with initialization of position, color, state and name
~cSpotLight
[public] destructor


Variables Index

mCutOff
[protected] current cutoff
mDirection
[protected] actual direction
mExponent
[protected] current exponent
mOldCutOff
[protected] saved cutoff
mOldExponent
[protected] saved exponent


Methods Index

ActivateLight
[protected] this one performs the actual set up of the light
DeactivateLight
[protected] restore old cutoff/exponent (called by cLight::Deactivate())
DrawThisObject
[protected] A light is a visible object therefore it needs a drawing function
GetDefaultName
[protected] identify an instance of this class if it's got no name
ReceiveEvent
[public] event receiver - we listen for switchon/switchoff events
SetCutOff
[public] set new cutoff
SetDirection
[public] set new direction to point to
SetExponent
[public] set new light distribution exponent
SubscribeToActiveEvents
[protected] we want to get events for altering cutoff/exponent
UnsubscribeFromActiveEvents
[protected] unsubscribe from events if we get deselected


Constructors

cSpotLight

public cSpotLight ( cEventDispatcher * disp ,
                    const char * name = NULL ) ;

default constructor

cSpotLight

public cSpotLight ( cEventDispatcher * disp ,
                    const cVertex & pos ,
                    const cVertex & dir ,
                    const char * name = NULL ) ;

constructor with initialization of position and name

Parameters:
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)

cSpotLight

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

Parameters:
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)

cSpotLight

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

Parameters:
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)

cSpotLight

public virtual ~ cSpotLight ( ) ;

destructor


Variables

mDirection

protected cVertex mDirection

actual direction

mCutOff

protected GLfloat mCutOff

current cutoff

mExponent

protected GLfloat mExponent

current exponent

mOldCutOff

protected GLfloat mOldCutOff

saved cutoff

mOldExponent

protected GLfloat mOldExponent

saved exponent


Methods

SetDirection

public virtual void SetDirection ( const cVertex & dir ) ;

set new direction to point to

Parameters:
dir new direction

SetCutOff

public virtual void SetCutOff ( const GLfloat cutoff ) ;

set new cutoff

Parameters:
angle 0..90 (180 means point light)

SetExponent

public virtual void SetExponent ( const GLfloat exponent ) ;

set new light distribution exponent

Parameters:
exponent 0..128 (0 = uniform light distribution)

ReceiveEvent

public virtual int ReceiveEvent ( const cEvent & event ) ;

event receiver - we listen for switchon/switchoff events

Return:
0 - event accepted, -1 - event not accepted

ActivateLight

protected virtual void ActivateLight ( ) ;

this one performs the actual set up of the light

(called by Activate()); separeted to simplify cSpotLight

DrawThisObject

protected virtual void DrawThisObject ( ) ;

A light is a visible object therefore it needs a drawing function

Not used here - a SpotLight cannot be drawn!

DeactivateLight

protected virtual void DeactivateLight ( ) ;

restore old cutoff/exponent (called by cLight::Deactivate())

SubscribeToActiveEvents

protected virtual void SubscribeToActiveEvents ( ) ;

we want to get events for altering cutoff/exponent

UnsubscribeFromActiveEvents

protected virtual void UnsubscribeFromActiveEvents ( ) ;

unsubscribe from events if we get deselected

GetDefaultName

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.