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
15 //! Enumeration for different types of lights
\r
18 //! point light, it has a position in space and radiates light in all directions
\r
20 //! spot light, it has a position in space, a direction, and a limited cone of influence
\r
22 //! directional light, coming from a direction from an infinite distance
\r
25 //! Only used for counting the elements of this enum
\r
29 //! Names for light types
\r
30 const c8* const LightTypeNames[] =
\r
38 //! structure for holding data describing a dynamic point light.
\r
39 /** Irrlicht supports point lights, spot lights, and directional lights.
\r
43 SLight() : AmbientColor(0.f,0.f,0.f), DiffuseColor(1.f,1.f,1.f),
\r
44 SpecularColor(1.f,1.f,1.f), Attenuation(1.f,0.f,0.f),
\r
45 OuterCone(45.f), InnerCone(0.f), Falloff(2.f),
\r
46 Position(0.f,0.f,0.f), Direction(0.f,0.f,1.f),
\r
47 Radius(100.f), Type(ELT_POINT), CastShadows(true)
\r
50 //! Ambient color emitted by the light
\r
51 SColorf AmbientColor;
\r
53 //! Diffuse color emitted by the light.
\r
54 /** This is the primary color you want to set. */
\r
55 SColorf DiffuseColor;
\r
57 //! Specular color emitted by the light.
\r
58 /** For details how to use specular highlights, see SMaterial::Shininess */
\r
59 SColorf SpecularColor;
\r
61 //! Attenuation factors (constant, linear, quadratic)
\r
62 /** Changes the light strength fading over distance.
\r
63 Can also be altered by setting the radius, Attenuation will change to
\r
64 (0,1.f/radius,0). Can be overridden after radius was set. */
\r
65 core::vector3df Attenuation;
\r
67 //! The angle of the spot's outer cone. Ignored for other lights.
\r
70 //! The angle of the spot's inner cone. Ignored for other lights.
\r
73 //! The light strength's decrease between Outer and Inner cone. Only for spot lights
\r
76 //! Read-ONLY! Position of the light.
\r
77 /** If Type is ELT_DIRECTIONAL, it is ignored. Changed via light scene node's position. */
\r
78 core::vector3df Position;
\r
80 //! Read-ONLY! Direction of the light.
\r
81 /** If Type is ELT_POINT, it is ignored. Changed via light scene node's rotation. */
\r
82 core::vector3df Direction;
\r
84 //! Read-ONLY! Radius of light. Everything within this radius will be lighted.
\r
85 /** On OpenGL light doesn't stop at radius. To get same light as in OpenGL in other drivers
\r
86 do set the radius to a large value like sqrt(FLT_MAX) and then set the Attenuation afterwards.
\r
90 //! Read-ONLY! Type of the light. Default: ELT_POINT
\r
93 //! Read-ONLY! Does the light cast shadows?
\r
97 } // end namespace video
\r
98 } // end namespace irr
\r