1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __S_LIGHT_H_INCLUDED__
\r
6 #define __S_LIGHT_H_INCLUDED__
\r
9 #include "vector3d.h"
\r
16 //! Enumeration for different types of lights
\r
19 //! point light, it has a position in space and radiates light in all directions
\r
21 //! spot light, it has a position in space, a direction, and a limited cone of influence
\r
23 //! directional light, coming from a direction from an infinite distance
\r
26 //! Only used for counting the elements of this enum
\r
30 //! Names for light types
\r
31 const c8* const LightTypeNames[] =
\r
39 //! structure for holding data describing a dynamic point light.
\r
40 /** Irrlicht supports point lights, spot lights, and directional lights.
\r
44 SLight() : AmbientColor(0.f,0.f,0.f), DiffuseColor(1.f,1.f,1.f),
\r
45 SpecularColor(1.f,1.f,1.f), Attenuation(1.f,0.f,0.f),
\r
46 OuterCone(45.f), InnerCone(0.f), Falloff(2.f),
\r
47 Position(0.f,0.f,0.f), Direction(0.f,0.f,1.f),
\r
48 Radius(100.f), Type(ELT_POINT), CastShadows(true)
\r
51 //! Ambient color emitted by the light
\r
52 SColorf AmbientColor;
\r
54 //! Diffuse color emitted by the light.
\r
55 /** This is the primary color you want to set. */
\r
56 SColorf DiffuseColor;
\r
58 //! Specular color emitted by the light.
\r
59 /** For details how to use specular highlights, see SMaterial::Shininess */
\r
60 SColorf SpecularColor;
\r
62 //! Attenuation factors (constant, linear, quadratic)
\r
63 /** Changes the light strength fading over distance.
\r
64 Can also be altered by setting the radius, Attenuation will change to
\r
65 (0,1.f/radius,0). Can be overridden after radius was set. */
\r
66 core::vector3df Attenuation;
\r
68 //! The angle of the spot's outer cone. Ignored for other lights.
\r
71 //! The angle of the spot's inner cone. Ignored for other lights.
\r
74 //! The light strength's decrease between Outer and Inner cone. Only for spot lights
\r
77 //! Read-ONLY! Position of the light.
\r
78 /** If Type is ELT_DIRECTIONAL, it is ignored. Changed via light scene node's position. */
\r
79 core::vector3df Position;
\r
81 //! Read-ONLY! Direction of the light.
\r
82 /** If Type is ELT_POINT, it is ignored. Changed via light scene node's rotation. */
\r
83 core::vector3df Direction;
\r
85 //! Read-ONLY! Radius of light. Everything within this radius will be lighted.
\r
86 /** On OpenGL light doesn't stop at radius. To get same light as in OpenGL in other drivers
\r
87 do set the radius to a large value like sqrt(FLT_MAX) and then set the Attenuation afterwards.
\r
91 //! Read-ONLY! Type of the light. Default: ELT_POINT
\r
94 //! Read-ONLY! Does the light cast shadows?
\r
98 } // end namespace video
\r
99 } // end namespace irr
\r