Avara3D 0.2.0
C++ API reference
a3d::SpotLight Class Reference

Cone-shaped light located and oriented by its containing Node. More...

#include <a3d/visual/light/SpotLight.h>

Inheritance diagram for a3d::SpotLight:
[legend]

Public Types

enum class  FeatheringMode : uint8_t { Linear = 0 , Sharp = 1 , Soft = 2 }
 Selects the intensity curve between the outer and inner cone angles. More...
 

Public Member Functions

 SpotLight ()
 Creates an unnamed white SpotLight. More...
 
 SpotLight (const std::string &name)
 Creates a named white SpotLight. More...
 
 SpotLight (const Color &color)
 Creates an unnamed SpotLight with color. More...
 
 SpotLight (const std::string &name, const Color &color)
 Creates a SpotLight with name and color. More...
 
float innerAngle () const
 Returns the inner cone half-angle in radians. More...
 
void innerAngle (float angle)
 Sets the inner cone half-angle in radians. More...
 
float outerAngle () const
 Returns the outer cone half-angle in radians. More...
 
void outerAngle (float angle)
 Sets the outer cone half-angle in radians. More...
 
FeatheringMode featheringMode () const
 Returns the angular feathering curve. More...
 
void featheringMode (FeatheringMode mode)
 Sets the angular feathering curve. More...
 
const Attenuationattenuation () const
 Returns the distance-attenuation coefficients. More...
 
void attenuation (const Attenuation &attenuation)
 Sets the distance-attenuation coefficients. More...
 
- Public Member Functions inherited from a3d::Light
const std::optional< std::string > & name () const
 Returns the optional light name. More...
 
void name (const std::string &name)
 Sets the light name. More...
 
const Colorcolor () const
 Returns the light color. More...
 
void color (const Color &color)
 Sets the light color. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from a3d::Light
static std::shared_ptr< AmbientLightAmbient ()
 Creates a white AmbientLight. More...
 
static std::shared_ptr< AmbientLightAmbient (const Color &color)
 Creates an AmbientLight with color. More...
 
static std::shared_ptr< DirectionalLightDirectional ()
 Creates a white DirectionalLight. More...
 
static std::shared_ptr< DirectionalLightDirectional (const Color &color)
 Creates a DirectionalLight with color. More...
 
static std::shared_ptr< PointLightPoint ()
 Creates a white PointLight. More...
 
static std::shared_ptr< PointLightPoint (const Color &color)
 Creates a PointLight with color. More...
 
static std::shared_ptr< SpotLightSpot ()
 Creates a white SpotLight. More...
 
static std::shared_ptr< SpotLightSpot (const Color &color)
 Creates a SpotLight with color. More...
 

Detailed Description

Cone-shaped light located and oriented by its containing Node.

The light originates at the Node's world position and points along the Node's world-forward direction. Intensity is reduced by both angular feathering and distance attenuation.

Definition at line 28 of file SpotLight.h.

Member Enumeration Documentation

◆ FeatheringMode

enum class a3d::SpotLight::FeatheringMode : uint8_t
strong

Selects the intensity curve between the outer and inner cone angles.

Enumerator
Linear 

Uses a linear intensity transition.

Sharp 

Uses y = x(2-x).

Soft 

Uses y = x^2.

Definition at line 34 of file SpotLight.h.

Constructor & Destructor Documentation

◆ SpotLight() [1/4]

a3d::SpotLight::SpotLight ( )

Creates an unnamed white SpotLight.

◆ SpotLight() [2/4]

a3d::SpotLight::SpotLight ( const std::string &  name)
explicit

Creates a named white SpotLight.

◆ SpotLight() [3/4]

a3d::SpotLight::SpotLight ( const Color color)
explicit

Creates an unnamed SpotLight with color.

◆ SpotLight() [4/4]

a3d::SpotLight::SpotLight ( const std::string &  name,
const Color color 
)

Creates a SpotLight with name and color.

Member Function Documentation

◆ attenuation() [1/2]

const Attenuation & a3d::SpotLight::attenuation ( ) const

Returns the distance-attenuation coefficients.

◆ attenuation() [2/2]

void a3d::SpotLight::attenuation ( const Attenuation attenuation)

Sets the distance-attenuation coefficients.

◆ featheringMode() [1/2]

FeatheringMode a3d::SpotLight::featheringMode ( ) const

Returns the angular feathering curve.

◆ featheringMode() [2/2]

void a3d::SpotLight::featheringMode ( FeatheringMode  mode)

Sets the angular feathering curve.

◆ innerAngle() [1/2]

float a3d::SpotLight::innerAngle ( ) const

Returns the inner cone half-angle in radians.

◆ innerAngle() [2/2]

void a3d::SpotLight::innerAngle ( float  angle)

Sets the inner cone half-angle in radians.

◆ outerAngle() [1/2]

float a3d::SpotLight::outerAngle ( ) const

Returns the outer cone half-angle in radians.

◆ outerAngle() [2/2]

void a3d::SpotLight::outerAngle ( float  angle)

Sets the outer cone half-angle in radians.


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