Colobot
Public Member Functions | Public Attributes | List of all members
Gfx::Light Struct Reference

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

#include <light.h>

Public Member Functions

void LoadDefault ()
 Loads default values. More...
 

Public Attributes

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

Detailed Description

Properties of light in 3D scene.

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

Member Function Documentation

void Gfx::Light::LoadDefault ( )
inline

Loads default values.

Member Data Documentation

LightType Gfx::Light::type = LIGHT_POINT

Type of light source.

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

Color of ambient light.

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

Color of diffuse light.

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

Color of specular light.

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

Position in world space (for point & spot lights)

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

Direction in world space (for directional & spot lights)

float Gfx::Light::attenuation0 = 1.0f

Constant attenuation factor.

float Gfx::Light::attenuation1 = 0.0f

Linear attenuation factor.

float Gfx::Light::attenuation2 = 0.0f

Quadratic attenuation factor.

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

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

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: