#include <light.h>
Public Member Functions | |
PointLight (uint32_t light_index, const XboxMath::vector_t &position, float range, float attenuation_constant, float attenuation_linear, float attenuation_quadratic) | |
void | Commit (TestHost &host) const override |
![]() | |
virtual void | Commit (TestHost &host, const XboxMath::vector_t &look_direction) const |
uint32_t | light_enable_mask () const |
void | SetAmbient (const float *ambient) |
void | SetAmbient (float r, float g, float b) |
void | SetDiffuse (const float *diffuse) |
void | SetDiffuse (float r, float g, float b) |
void | SetSpecular (const float *specular) |
void | SetSpecular (float r, float g, float b) |
void | SetBackAmbient (const float *ambient) |
void | SetBackAmbient (float r, float g, float b) |
void | SetBackDiffuse (const float *diffuse) |
void | SetBackDiffuse (float r, float g, float b) |
void | SetBackSpecular (const float *specular) |
void | SetBackSpecular (float r, float g, float b) |
Additional Inherited Members | |
![]() | |
Light (uint32_t light_index, uint32_t enable_mask) | |
![]() | |
uint32_t | light_index_ |
uint32_t | light_enable_mask_ |
float | ambient_ [3] {0.f, 0.f, 0.f} |
float | diffuse_ [3] {1.f, 1.f, 1.f} |
float | specular_ [3] {0.f, 0.f, 0.f} |
float | back_ambient_ [3] {0.f, 0.f, 0.f} |
float | back_diffuse_ [3] {1.f, 1.f, 1.f} |
float | back_specular_ [3] {0.f, 0.f, 0.f} |
Sets up a point light source.
PointLight::PointLight | ( | uint32_t | light_index, |
const XboxMath::vector_t & | position, | ||
float | range, | ||
float | attenuation_constant, | ||
float | attenuation_linear, | ||
float | attenuation_quadratic | ||
) |
Constructs a new PointLight instance.
light_index | Hardware light index |
position | World coordinates of the spotlight |
range | World coordinate maximum range of the light |
attenuation_constant | Constant attenuation factor |
attenuation_linear | Linear attenuation factor |
attenuation_quadratic | Quadratic attenuation factor |
Attenuation = param1 + (param2 * d) + (param3 * d^2) where d = distance from light to vertex.