YAGE
1.0
Yet Another Game Engine
|
A point light. More...
#include <Light.h>
Public Member Functions | |
PointLight (glm::vec3 color, glm::vec3 position, float constantAttenuation=0.0f, float linearAttenuation=1.0f, float quadraticAttenuation=0.0f) | |
virtual void | Draw (GLuint) override final |
Sets up the light uniform location id's from the program. Each subclass must then send their corresponding params to the shader. More... | |
![]() | |
Light () | |
~Light () | |
virtual void | DrawShadow (GLuint) override |
Sends shadow information. Each subclass must implement this functionality! More... | |
virtual void | Update () override |
Updates the light. This currently does nothing! Draw() does update the light. More... | |
virtual void | Destroy () override |
Destroys the light. This currently only turns off the enabled flag! More... | |
virtual void | SetTexture (const std::string &, const TextureType &, const GLuint &) override |
Adds a texture to an object. More... | |
virtual const GLuint | GetTexture (const std::string &) const override |
Gets a texture. More... | |
bool | EnableShadows () |
Enables shadow generation for this light. More... | |
bool | DisableShadows () |
Disables shadow generation for this light. More... | |
void | SetAttenuation (float constant=0.0f, float linear=1.0f, float quadratic=0.0f) |
Sets the attenutation parameters. See this wiki article for more information about attenuation: https://developer.valvesoftware.com/wiki/Constant-Linear-Quadratic_Falloff. More... | |
![]() | |
virtual | ~IGameObject () |
Destructor that deletes the unique shader program and shadow program belonging to the object. More... | |
virtual void | SetProgram (GLuint shaderName) |
Sets the main shader program corresponding to this object. More... | |
virtual void | SetShadowProgram (GLuint shaderName) |
Sets the shadow pass shader program corresponding to this object. More... | |
virtual GLuint | GetProgram () |
Gets the object's main shader program. More... | |
virtual GLuint | GetShadowProgram () |
Gets the object's shadow program. More... | |
Additional Inherited Members | |
![]() | |
glm::vec3 | ambient |
light's contribution to ambient light. More... | |
glm::vec3 | color |
The color/intensity of the light. More... | |
glm::vec3 | position |
location of light if isLocal is true. For directional light, it is the direction More... | |
glm::vec3 | halfVector |
?? direction of headlights for directional light ?? More... | |
glm::vec3 | coneDirection |
spotlight cone direction. More... | |
float | spotCosCutoff |
how wide the spotlight is [0-1]. More... | |
float | spotExponent |
control light fall-off in the spotlight. More... | |
float | constantAttenuation |
constant light fall-out More... | |
float | linearAttenuation |
linear light fall-off More... | |
float | quadraticAttenuation |
quadratic light fall-out More... | |
bool | isEnabled |
true if this object is enabled. More... | |
![]() | |
GLuint | texture |
unsigned int | _id |
bool | castsShadow |
int | type |
struct Light::LightUniformLocations | ids |
![]() | |
GLuint | program = 0 |
GLuint | shadowProgram = 0 |
A point light.
PointLight::PointLight | ( | glm::vec3 | color, |
glm::vec3 | position, | ||
float | constantAttenuation = 0.0f , |
||
float | linearAttenuation = 1.0f , |
||
float | quadraticAttenuation = 0.0f |
||
) |
|
finaloverridevirtual |
Sets up the light uniform location id's from the program. Each subclass must then send their corresponding params to the shader.
program | The shader program. |
Reimplemented from Light.