nxdk_pgraph_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
Spotlight Class Reference

#include <light.h>

Inheritance diagram for Spotlight:
Collaboration diagram for Spotlight:

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
 
- Public Member Functions inherited from Light
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

- Protected Member Functions inherited from Light
 Light (uint32_t light_index, uint32_t enable_mask)
 
- Protected Attributes inherited from Light
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}
 

Detailed Description

Sets up a spotlight.

Constructor & Destructor Documentation

◆ Spotlight() [1/2]

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.

Parameters
light_indexHardware light index
positionWorld coordinates of the spotlight
directionWorld coordinate direction of the spotlight
rangeWorld coordinate maximum range of the light
phiPenumbra (outer cone) angle in degrees
thetaUmbra (inner, fully illuminated cone) angle in degrees
attenuation_constantConstant attenuation factor
attenuation_linearLinear attenuation factor
attenuation_quadraticQuadratic attenuation factor
falloff_1Raw nv2a falloff factor, 1st component
falloff_2Raw nv2a falloff factor, 2nd component
falloff_3Raw nv2a falloff factor, 3rd component

◆ Spotlight() [2/2]

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.

Parameters
light_indexHardware light index
positionWorld coordinates of the spotlight
directionWorld coordinate direction of the spotlight
rangeWorld coordinate maximum range of the light
phiPenumbra (outer cone) angle in degrees
thetaUmbra (inner, fully illuminated cone) angle in degrees
attenuation_constantConstant attenuation factor
attenuation_linearLinear attenuation factor
attenuation_quadraticQuadratic attenuation factor
falloffFalloff factor

Attenuation = param1 + (param2 * d) + (param3 * d^2) where d = distance from light to vertex.

Member Function Documentation

◆ Commit()

void Spotlight::Commit ( TestHost host) const
overridevirtual

Reimplemented from Light.


The documentation for this class was generated from the following files: