]> git.lizzy.rs Git - irrlicht.git/blob - include/SLight.h
Fix COSOperator::getSystemMemory
[irrlicht.git] / include / SLight.h
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
4 \r
5 #ifndef __S_LIGHT_H_INCLUDED__\r
6 #define __S_LIGHT_H_INCLUDED__\r
7 \r
8 #include "SColor.h"\r
9 #include "vector3d.h"\r
10 \r
11 namespace irr\r
12 {\r
13 namespace video\r
14 {\r
15 \r
16 //! Enumeration for different types of lights\r
17 enum E_LIGHT_TYPE\r
18 {\r
19         //! point light, it has a position in space and radiates light in all directions\r
20         ELT_POINT,\r
21         //! spot light, it has a position in space, a direction, and a limited cone of influence\r
22         ELT_SPOT,\r
23         //! directional light, coming from a direction from an infinite distance\r
24         ELT_DIRECTIONAL,\r
25 \r
26         //! Only used for counting the elements of this enum\r
27         ELT_COUNT\r
28 };\r
29 \r
30 //! Names for light types\r
31 const c8* const LightTypeNames[] =\r
32 {\r
33         "Point",\r
34         "Spot",\r
35         "Directional",\r
36         0\r
37 };\r
38 \r
39 //! structure for holding data describing a dynamic point light.\r
40 /** Irrlicht supports point lights, spot lights, and directional lights.\r
41 */\r
42 struct SLight\r
43 {\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
49                 {}\r
50 \r
51         //! Ambient color emitted by the light\r
52         SColorf AmbientColor;\r
53 \r
54         //! Diffuse color emitted by the light.\r
55         /** This is the primary color you want to set. */\r
56         SColorf DiffuseColor;\r
57 \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
61 \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
67 \r
68         //! The angle of the spot's outer cone. Ignored for other lights.\r
69         f32 OuterCone;\r
70 \r
71         //! The angle of the spot's inner cone. Ignored for other lights.\r
72         f32 InnerCone;\r
73 \r
74         //! The light strength's decrease between Outer and Inner cone. Only for spot lights\r
75         f32 Falloff;\r
76 \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
80 \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
84 \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
88         */\r
89         f32 Radius;\r
90 \r
91         //! Read-ONLY! Type of the light. Default: ELT_POINT\r
92         E_LIGHT_TYPE Type;\r
93 \r
94         //! Read-ONLY! Does the light cast shadows?\r
95         bool CastShadows:1;\r
96 };\r
97 \r
98 } // end namespace video\r
99 } // end namespace irr\r
100 \r
101 #endif\r