#include <light.h>
Public Types | |
enum class | FalloffFactor { ZERO , ONE_HALF , ONE , TWO , TEN } |
Public Member Functions | |
Spotlight (uint32_t light_index, const XboxMath::vector_t &position, const XboxMath::vector_t &direction, float range, float phi, float theta, float attenuation_constant, float attenuation_linear, float attenuation_quadratic, float falloff_1, float falloff_2, float falloff_3) | |
Spotlight (uint32_t light_index, const XboxMath::vector_t &position, const XboxMath::vector_t &direction, float range, float phi, float theta, float attenuation_constant, float attenuation_linear, float attenuation_quadratic, FalloffFactor falloff) | |
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 spotlight.
Spotlight::Spotlight | ( | uint32_t | light_index, |
const XboxMath::vector_t & | position, | ||
const XboxMath::vector_t & | direction, | ||
float | range, | ||
float | phi, | ||
float | theta, | ||
float | attenuation_constant, | ||
float | attenuation_linear, | ||
float | attenuation_quadratic, | ||
float | falloff_1, | ||
float | falloff_2, | ||
float | falloff_3 | ||
) |
Constructs a new Spotlight instance.
light_index | Hardware light index |
position | World coordinates of the spotlight |
direction | World coordinate direction of the spotlight |
range | World coordinate maximum range of the light |
phi | Penumbra (outer cone) angle in degrees |
theta | Umbra (inner, fully illuminated cone) angle in degrees |
attenuation_constant | Constant attenuation factor |
attenuation_linear | Linear attenuation factor |
attenuation_quadratic | Quadratic attenuation factor |
falloff_1 | Raw nv2a falloff factor, 1st component |
falloff_2 | Raw nv2a falloff factor, 2nd component |
falloff_3 | Raw nv2a falloff factor, 3rd component |
Spotlight::Spotlight | ( | uint32_t | light_index, |
const XboxMath::vector_t & | position, | ||
const XboxMath::vector_t & | direction, | ||
float | range, | ||
float | phi, | ||
float | theta, | ||
float | attenuation_constant, | ||
float | attenuation_linear, | ||
float | attenuation_quadratic, | ||
FalloffFactor | falloff | ||
) |
Constructs a new Spotlight instance.
light_index | Hardware light index |
position | World coordinates of the spotlight |
direction | World coordinate direction of the spotlight |
range | World coordinate maximum range of the light |
phi | Penumbra (outer cone) angle in degrees |
theta | Umbra (inner, fully illuminated cone) angle in degrees |
attenuation_constant | Constant attenuation factor |
attenuation_linear | Linear attenuation factor |
attenuation_quadratic | Quadratic attenuation factor |
falloff | Falloff factor |
Attenuation = param1 + (param2 * d) + (param3 * d^2) where d = distance from light to vertex.