|
AGL
0
3D graphics library
|
Light, adds reality to the scene. More...


Public Member Functions | |
| Light (const glm::vec3 &pos=glm::vec3(-2, 3, 2), const glm::vec4 &color=glm::vec4(1)) | |
| Creates a light. More... | |
| Light (const glm::vec3 &pos=glm::vec3(-2, 3, 2), float r=1, float g=1, float b=1, float a=1) | |
| See Light. More... | |
| void | setColor (glm::vec4 color=glm::vec4(1)) |
| Set color of the light. More... | |
| void | setColor (float r=1, float g=1, float b=1, float a=1) |
| Set light color. See setColor and Light(const glm::vec3&, float, float, float, float). More... | |
| glm::vec4 | getPos () |
| Get the position of the light. More... | |
Public Member Functions inherited from BaseEntity | |
| virtual | ~BaseEntity () |
Public Attributes | |
| glm::vec4 | ambient |
| Ambient, illuminates everything. More... | |
| glm::vec4 | diffuse |
| Diffuse, illuminates surfaces facing the light. More... | |
| glm::vec4 | specular |
| Specular, reflects from surface. More... | |
| glm::vec4 | position |
| Position (direction) of the light. More... | |
| glm::vec3 | spotDirection |
| Direction of spotlight. More... | |
| float | spotExponent = 0 |
| Effect of spotlight. More... | |
| float | spotCosCutoff = -1 |
| Cosine of angle of spotlight. (range: [1, 0], -1 means disabled) More... | |
| float | constantAttenuation = 1 |
| Constant attenuation. More... | |
| float | linearAttenuation = 0 |
| Linear attenuation. More... | |
| float | quadraticAttenuation = 0 |
| Quadratic attenuation. More... | |
Public Attributes inherited from BaseEntity | |
| Entity * | parent = nullptr |
| Parent of the entity, whose child this is. All transformations of the parent is also applied to the child. More... | |
Light, adds reality to the scene.
These are different kinds of lights that can be added to the scene. There are mainly three kinds of light,
| Light | ( | const glm::vec3 & | pos = glm::vec3(-2, 3, 2), |
| const glm::vec4 & | color = glm::vec4(1) |
||
| ) |
Creates a light.
| pos | Position of the light. |
| color | Color of the light. |
Creates a point light. To create other kinds of light, use the constructor-like functions.
| Light | ( | const glm::vec3 & | pos = glm::vec3(-2, 3, 2), |
| float | r = 1, |
||
| float | g = 1, |
||
| float | b = 1, |
||
| float | a = 1 |
||
| ) |
See Light.
| pos | Position of the light. |
| r | Red. |
| g | Green. |
| b | Blue. |
| a | Alpha. |
|
inline |
Get the position of the light.
| void setColor | ( | glm::vec4 | color = glm::vec4(1) | ) |
Set color of the light.
| color | Color to set. |
| void setColor | ( | float | r = 1, |
| float | g = 1, |
||
| float | b = 1, |
||
| float | a = 1 |
||
| ) |
Set light color. See setColor and Light(const glm::vec3&, float, float, float, float).
| glm::vec4 ambient |
Ambient, illuminates everything.
| float constantAttenuation = 1 |
Constant attenuation.
| glm::vec4 diffuse |
Diffuse, illuminates surfaces facing the light.
| float linearAttenuation = 0 |
Linear attenuation.
| glm::vec4 position |
Position (direction) of the light.
| float quadraticAttenuation = 0 |
Quadratic attenuation.
| glm::vec4 specular |
Specular, reflects from surface.
| float spotCosCutoff = -1 |
Cosine of angle of spotlight. (range: [1, 0], -1 means disabled)
| glm::vec3 spotDirection |
Direction of spotlight.
| float spotExponent = 0 |
Effect of spotlight.