Loading...
Searching...
No Matches
Gfx::Light Struct Reference

Properties of light in 3D scene. More...

`#include <src/graphics/core/light.h>`

## Public Member Functions

void | LoadDefault ()
| Loads default values.

## Public Attributes

LightType | type = LIGHT_POINT
| Type of light source.
Color | ambient = Color(0.4f, 0.4f, 0.4f)
| Color of ambient light.
Color | diffuse = Color(0.8f, 0.8f, 0.8f)
| Color of diffuse light.
Color | specular = Color(1.0f, 1.0f, 1.0f)
| Color of specular light.
Math::Vector | position = Math::Vector(0.0f, 0.0f, 0.0f)
| Position in world space (for point & spot lights).
Math::Vector | direction = Math::Vector(0.0f, 0.0f, 1.0f)
| Direction in world space (for directional & spot lights).
float | attenuation0 = 1.0f
| Constant attenuation factor.
float | attenuation1 = 0.0f
| Linear attenuation factor.
float | attenuation2 = 0.0f
| Quadratic attenuation factor.
float | spotAngle = Math::PI/2.0f
| Angle of spotlight cone (0-PI/2 radians).
float | spotIntensity = 0.0f
| Intensity of spotlight (0 = uniform; 128 = most intense).

## Detailed Description

Properties of light in 3D scene.

This structure was created as analog to DirectX's D3DLIGHT.

## Member Function Documentation

## LoadDefault()

void Gfx::Light::LoadDefault | ( |  | ) |

inline

Loads default values.

## Member Data Documentation

## type

LightType Gfx::Light::type = LIGHT_POINT

Type of light source.

## ambient

Color Gfx::Light::ambient = Color(0.4f, 0.4f, 0.4f)

Color of ambient light.

## diffuse

Color Gfx::Light::diffuse = Color(0.8f, 0.8f, 0.8f)

Color of diffuse light.

## specular

Color Gfx::Light::specular = Color(1.0f, 1.0f, 1.0f)

Color of specular light.

## position

Math::Vector Gfx::Light::position = Math::Vector(0.0f, 0.0f, 0.0f)

Position in world space (for point & spot lights).

## direction

Math::Vector Gfx::Light::direction = Math::Vector(0.0f, 0.0f, 1.0f)

Direction in world space (for directional & spot lights).

## attenuation0

float Gfx::Light::attenuation0 = 1.0f

Constant attenuation factor.

## attenuation1

float Gfx::Light::attenuation1 = 0.0f

Linear attenuation factor.

## attenuation2

float Gfx::Light::attenuation2 = 0.0f

Quadratic attenuation factor.

## spotAngle

float Gfx::Light::spotAngle = Math::PI/2.0f

Angle of spotlight cone (0-PI/2 radians).

## spotIntensity

float Gfx::Light::spotIntensity = 0.0f

Intensity of spotlight (0 = uniform; 128 = most intense).

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

- src/graphics/core/light.h