![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Light source base class.
Once lighting has been enabled, via TSL3DOptionEnum, a TSL3DDrawingSurface can have multiple light sources.
These light sources need to have their properties set up and they need to be enabled in order to have effect.
Public Member Functions | |
bool | enabled () const |
void | enabled (const bool enable) |
bool | isDirectional () const |
void | isDirectional (const bool dir) |
const TSL3DCoord * | position () |
bool | position (const TSL3DCoord *pos) |
const TSL3DCoord * | direction () |
bool | direction (const TSL3DCoord *dir) |
void | ambientLight (double red, double green, double blue, double alpha) |
void | ambientLight (double *red, double *green, double *blue, double *alpha) |
void | diffuseLight (double red, double green, double blue, double alpha) |
void | diffuseLight (double *red, double *green, double *blue, double *alpha) |
void | specularLight (double red, double green, double blue, double alpha) |
void | specularLight (double *red, double *green, double *blue, double *alpha) |
Protected Member Functions | |
TSL3DLightSource () | |
|
protected |
Protected to prevent direct instantiation.
void TSL3DLightSource::ambientLight | ( | double * | red, |
double * | green, | ||
double * | blue, | ||
double * | alpha ) |
Query the ambient light colour.
red | double in which red value is returned |
green | double in which green value is returned |
blue | double in which blue value is returned |
alpha | double in which alpha value is returned |
These values are all between 0 and 1.
void TSL3DLightSource::ambientLight | ( | double | red, |
double | green, | ||
double | blue, | ||
double | alpha ) |
Set the ambient light colour.
red | red component, a value between 0 and 1 |
green | green component, a value between 0 and 1 |
blue | blue component, a value between 0 and 1 |
alpha | alpha component, a value between 0 and 1 |
void TSL3DLightSource::diffuseLight | ( | double * | red, |
double * | green, | ||
double * | blue, | ||
double * | alpha ) |
Query the diffuse light colour.
red | double in which red value is returned |
green | double in which green value is returned |
blue | double in which blue value is returned |
alpha | double in which alpha value is returned |
These values are all between 0 and 1.
void TSL3DLightSource::diffuseLight | ( | double | red, |
double | green, | ||
double | blue, | ||
double | alpha ) |
Set the diffuse light colour.
red | red component, a value between 0 and 1 |
green | green component, a value between 0 and 1 |
blue | blue component, a value between 0 and 1 |
alpha | alpha component, a value between 0 and 1 |
const TSL3DCoord * TSL3DLightSource::direction | ( | ) |
Returns the direction of a directional light source.
Returns NULL if the light source is positional.
bool TSL3DLightSource::direction | ( | const TSL3DCoord * | dir | ) |
Set the direction of a directional light source.
Returns true if the light source is directional. Returns false if the light source is positional.
dir | direction of the light source |
bool TSL3DLightSource::enabled | ( | ) | const |
Returns true if the light source is enabled, false otherwise.
void TSL3DLightSource::enabled | ( | const bool | enable | ) |
Enable or disable a light source.
enable | true to enable the light source, false to disable it |
bool TSL3DLightSource::isDirectional | ( | ) | const |
Returns true if the light source is a directional source, false if the light source is positional.
void TSL3DLightSource::isDirectional | ( | const bool | dir | ) |
Set whether the light source is positional or directional.
dir | set to true if light source is directional, false if light source is positional |
const TSL3DCoord * TSL3DLightSource::position | ( | ) |
Returns the position of a positional light source. Returns NULL if the light source is directional.
bool TSL3DLightSource::position | ( | const TSL3DCoord * | pos | ) |
Set the position of a positional light source.
Returns true if the light source is positional. Returns false if the light source is directional.
pos | the position of the light source |
void TSL3DLightSource::specularLight | ( | double * | red, |
double * | green, | ||
double * | blue, | ||
double * | alpha ) |
Query the specular light colour.
red | double in which red value is returned |
green | double in which green value is returned |
blue | double in which blue value is returned |
alpha | double in which alpha value is returned |
These values are all between 0 and 1.
void TSL3DLightSource::specularLight | ( | double | red, |
double | green, | ||
double | blue, | ||
double | alpha ) |
Set the specular light colour.
red | red component, a value between 0 and 1 |
green | green component, a value between 0 and 1 |
blue | blue component, a value between 0 and 1 |
alpha | alpha component, a value between 0 and 1 |