#include <sgLight.h>
Public Member Functions | |
sgLight (sgLight *p, sgLight *n) | |
sgLight * | createLight () |
void | setDefault () |
void | destroy () |
void | destroyAll () |
Public Attributes | |
sgVector4 | position |
sgFColorA | ambient |
sgFColorA | diffuse |
sgFColorA | specular |
float | attenuation |
sgLight * | prev |
sgLight * | next |
Light class. Responsible for light handling.
Constructor. Creates a light.
p | the previous light in the linked light list | |
n | the next light in the linked light list |
sgLight * sgLight::createLight | ( | ) |
Create light. Creates a new light and makes it next of this.
void sgLight::destroy | ( | ) |
Destroy. Destroys this light.
void sgLight::destroyAll | ( | ) |
Destroy All. Destroys this and all lights connected to it.
void sgLight::setDefault | ( | ) |
Set to default. Sets all light parameters to the default ones (position is not effected).
Ambient. Color used for the ambient lighting.
float sgLight::attenuation |
Attenuation. Factor used for the quadratic attenuation, if this is a point light source. The smaller, the higher is the range.
Diffuse. Color used for the diffuse lighting.
Next. Pointer to the next light within the lights list or NULL if there is none.
Position. The position of the light. Set the w component to 0, to make this a sun with an endless distance, where xyz define the lights direction.
Previous. Pointer to the previous light within the lights list or NULL if there is none.
Specular. Color used for the specular lighting.