15 virtual void Commit(
TestHost& host)
const;
22 virtual void Commit(
TestHost& host,
const XboxMath::vector_t& look_direction)
const;
24 [[nodiscard]] uint32_t light_enable_mask()
const {
return light_enable_mask_; }
26 void SetAmbient(
const float* ambient) { memcpy(ambient_, ambient,
sizeof(ambient_)); }
28 void SetAmbient(
float r,
float g,
float b) {
34 void SetDiffuse(
const float* diffuse) { memcpy(diffuse_, diffuse,
sizeof(diffuse_)); }
36 void SetDiffuse(
float r,
float g,
float b) {
42 void SetSpecular(
const float* specular) { memcpy(specular_, specular,
sizeof(specular_)); }
44 void SetSpecular(
float r,
float g,
float b) {
50 void SetBackAmbient(
const float* ambient) { memcpy(back_ambient_, ambient,
sizeof(back_ambient_)); }
52 void SetBackAmbient(
float r,
float g,
float b) {
58 void SetBackDiffuse(
const float* diffuse) { memcpy(back_diffuse_, diffuse,
sizeof(back_diffuse_)); }
60 void SetBackDiffuse(
float r,
float g,
float b) {
66 void SetBackSpecular(
const float* specular) { memcpy(back_specular_, specular,
sizeof(back_specular_)); }
68 void SetBackSpecular(
float r,
float g,
float b) {
69 back_specular_[0] = r;
70 back_specular_[1] = g;
71 back_specular_[2] = b;
78 Light(uint32_t light_index, uint32_t enable_mask);
80 virtual ~Light() =
default;
83 uint32_t light_index_;
84 uint32_t light_enable_mask_;
86 float ambient_[3]{0.f, 0.f, 0.f};
87 float diffuse_[3]{1.f, 1.f, 1.f};
88 float specular_[3]{0.f, 0.f, 0.f};
89 float back_ambient_[3]{0.f, 0.f, 0.f};
90 float back_diffuse_[3]{1.f, 1.f, 1.f};
91 float back_specular_[3]{0.f, 0.f, 0.f};
99 enum class FalloffFactor {
125 Spotlight(uint32_t light_index,
const XboxMath::vector_t& position,
const XboxMath::vector_t& direction,
float range,
126 float phi,
float theta,
float attenuation_constant,
float attenuation_linear,
float attenuation_quadratic,
127 float falloff_1,
float falloff_2,
float falloff_3);
144 Spotlight(uint32_t light_index,
const XboxMath::vector_t& position,
const XboxMath::vector_t& direction,
float range,
145 float phi,
float theta,
float attenuation_constant,
float attenuation_linear,
float attenuation_quadratic,
146 FalloffFactor falloff);
148 void Commit(
TestHost& host)
const override;
151 XboxMath::vector_t position_;
153 XboxMath::vector_t direction_;
164 float attenuation_[3];