#include <Light.h>
Inheritance diagram for Teddy::Materials::Light:
Public Methods | |
Light (const std::string &name) | |
Default constructor for light with name only. More... | |
void | setType (const unsigned long type) |
void | setAmbient (const Teddy::Graphics::Color &a) |
void | setDiffuse (const Teddy::Graphics::Color &d) |
void | setSpecular (const Teddy::Graphics::Color &s) |
void | setAttenuation (const float constant, const float linear, const float quadratic) |
void | setSpotCutOff (const float cutoff_angle) |
void | setSpotExponent (const float exponent) |
void | setSpotDirection (Teddy::Maths::Vector spot_direction) |
void | enable () |
Enable individual light. More... | |
void | disable () |
Disable individual light. More... | |
virtual void | applyLight (Teddy::PhysicalComponents::Projection *p) |
Apply light. More... | |
void | orbit (float radius, float speed, int axis) |
Static Public Attributes | |
const unsigned long | TYPE_DIRECTIONAL = 0 |
const unsigned long | TYPE_POSITIONAL = 1 |
Protected Attributes | |
unsigned long | type |
int | id |
Teddy::Graphics::Color | ambient |
Teddy::Graphics::Color | diffuse |
Teddy::Graphics::Color | specular |
unsigned int | flags |
float | constant_attenuation |
float | linear_attenuation |
float | quadratic_attenuation |
float | spot_cutoff_angle |
float | spot_exponent |
Teddy::Maths::TVector< float > | spot_direction |
bool | orbit_active |
float | orbit_radius |
float | orbit_speed |
int | orbit_axis |
Static Protected Attributes | |
unsigned int | light_id [8] = { GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7 } |
Reservation status for OpenGL lights. More... | |
int | light_status [8] = { 0, 0, 0, 0, 0, 0, 0, 0 } |
Lights are used to lit objects in Scene. At the moment this class implements a simple OpenGL light wrapper with minimum featurs.
Light is positional by default unless set to directional by setType
Definition at line 58 of file Light.h.
|
Default constructor for light with name only.
Definition at line 60 of file Light.cpp. References ambient, diffuse, id, light_id, light_status, orbit_active, specular, and type. |
|
Apply light.
Definition at line 165 of file Light.cpp. References ambient, diffuse, Teddy::Models::Model::getAttitude, Teddy::Models::Model::getPosition, Teddy::Maths::Quaternion::getViewAxis, id, light_id, Teddy::Graphics::Color::rgba, specular, spot_direction, type, and Vector. |
|
Disable individual light.
|
|
Enable individual light.
Definition at line 149 of file Light.cpp. Referenced by Teddy::Imports::LWLight::genLight. |
|
Definition at line 121 of file Light.cpp. References orbit_active, orbit_axis, orbit_radius, and orbit_speed. |
|
Referenced by Teddy::Imports::LWLight::genLight. |
|
Definition at line 92 of file Light.cpp. References constant_attenuation, id, light_id, linear_attenuation, and quadratic_attenuation. |
|
Referenced by Teddy::Imports::LWLight::genLight. |
|
Referenced by Teddy::Imports::LWLight::genLight. |
|
Definition at line 104 of file Light.cpp. References id, light_id, and spot_cutoff_angle. |
|
Definition at line 116 of file Light.cpp. References spot_direction, and Vector. |
|
Definition at line 111 of file Light.cpp. References id, light_id, and spot_exponent. |
|
Definition at line 55 of file Light.cpp. References type. Referenced by Teddy::Imports::LWLight::genLight. |
|
Definition at line 83 of file Light.h. Referenced by applyLight, and Light. |
|
Definition at line 88 of file Light.h. Referenced by setAttenuation. |
|
Definition at line 84 of file Light.h. Referenced by applyLight, and Light. |
|
|
|
Definition at line 82 of file Light.h. Referenced by applyLight, disable, enable, Light, setAttenuation, setSpotCutOff, and setSpotExponent. |
|
Reservation status for OpenGL lights.
Definition at line 48 of file Light.cpp. Referenced by applyLight, disable, enable, Light, setAttenuation, setSpotCutOff, and setSpotExponent. |
|
Definition at line 49 of file Light.cpp. Referenced by Light. |
|
Definition at line 89 of file Light.h. Referenced by setAttenuation. |
|
|
|
Definition at line 98 of file Light.h. Referenced by orbit. |
|
Definition at line 96 of file Light.h. Referenced by orbit. |
|
Definition at line 97 of file Light.h. Referenced by orbit. |
|
Definition at line 90 of file Light.h. Referenced by setAttenuation. |
|
Definition at line 85 of file Light.h. Referenced by applyLight, and Light. |
|
Definition at line 91 of file Light.h. Referenced by setSpotCutOff. |
|
Definition at line 93 of file Light.h. Referenced by applyLight, and setSpotDirection. |
|
Definition at line 92 of file Light.h. Referenced by setSpotExponent. |
|
Definition at line 81 of file Light.h. Referenced by applyLight, Light, and setType. |
|
|
|
|