1 | /**************************************************************************************** |
2 | |
3 | Copyright (C) 2015 Autodesk, Inc. |
4 | All rights reserved. |
5 | |
6 | Use of this software is subject to the terms of the Autodesk license agreement |
7 | provided at the time of installation or download, or which otherwise accompanies |
8 | this software in either electronic or hard copy form. |
9 | |
10 | ****************************************************************************************/ |
11 | |
12 | //! \file fbxlight.h |
13 | #ifndef _FBXSDK_SCENE_GEOMETRY_LIGHT_H_ |
14 | #define _FBXSDK_SCENE_GEOMETRY_LIGHT_H_ |
15 | |
16 | #include <fbxsdk/fbxsdk_def.h> |
17 | |
18 | #include <fbxsdk/scene/geometry/fbxnodeattribute.h> |
19 | |
20 | #include <fbxsdk/fbxsdk_nsbegin.h> |
21 | |
22 | class FbxTexture; |
23 | |
24 | /** \brief This node attribute contains methods for accessing the properties of a light. |
25 | * \nosubgrouping |
26 | */ |
27 | class FBXSDK_DLL FbxLight : public FbxNodeAttribute |
28 | { |
29 | FBXSDK_OBJECT_DECLARE(FbxLight, FbxNodeAttribute); |
30 | |
31 | public: |
32 | /** |
33 | * \name Light Properties |
34 | */ |
35 | //@{ |
36 | /** \enum EType Light types. |
37 | * - \e ePoint |
38 | * - \e eDirectional |
39 | * - \e eSpot |
40 | * - \e eArea |
41 | * - \e eVolume |
42 | */ |
43 | enum EType |
44 | { |
45 | ePoint, |
46 | eDirectional, |
47 | eSpot, |
48 | eArea, |
49 | eVolume |
50 | }; |
51 | |
52 | /** \enum EDecayType Decay types. Used for setting the attenuation of the light. |
53 | * - \e eNone No decay. The light's intensity will not diminish with distance. |
54 | * - \e eLinear Linear decay. The light's intensity will diminish linearly with the distance from the light. |
55 | * - \e eQuadratic Quadratic decay. The light's intensity will diminish with the squared distance from the light. |
56 | * This is the most physically accurate decay rate. |
57 | * - \e eCubic Cubic decay. The light's intensity will diminish with the cubed distance from the light. |
58 | */ |
59 | enum EDecayType |
60 | { |
61 | eNone, |
62 | eLinear, |
63 | eQuadratic, |
64 | eCubic |
65 | }; |
66 | |
67 | /** \enum EAreaLightShape Supported area light types. |
68 | * - \e eRectangle Rectangle (or often called a plane) area light type. |
69 | * - \e eSphere Area light that illuminate all directions. |
70 | */ |
71 | enum EAreaLightShape |
72 | { |
73 | eRectangle, |
74 | eSphere |
75 | }; |
76 | |
77 | /** Set the shadow texture for the light. |
78 | * \param pTexture The texture cast by the light shadow. |
79 | */ |
80 | void SetShadowTexture(FbxTexture* pTexture); |
81 | |
82 | /** Get the light state. |
83 | * \return Pointer to the texture cast by the light shadow, or \c NULL if the shadow texture has not been set. |
84 | */ |
85 | FbxTexture* GetShadowTexture() const; |
86 | //@} |
87 | |
88 | /** |
89 | * \name Properties |
90 | */ |
91 | //@{ |
92 | /** This property handles the light type. |
93 | * |
94 | * Default value is ePoint |
95 | */ |
96 | FbxPropertyT<EType> LightType; |
97 | |
98 | /** This property handles the cast light on object flag. |
99 | * |
100 | * Default value is true |
101 | */ |
102 | FbxPropertyT<FbxBool> CastLight; |
103 | |
104 | /** This property handles the draw volumetric light flag. |
105 | * |
106 | * Default value is true |
107 | */ |
108 | FbxPropertyT<FbxBool> DrawVolumetricLight; |
109 | |
110 | /** This property handles the draw ground projection flag. |
111 | * |
112 | * Default value is true |
113 | */ |
114 | FbxPropertyT<FbxBool> DrawGroundProjection; |
115 | |
116 | /** This property handles the draw facing volumetric projection flag. |
117 | * |
118 | * Default value is false |
119 | */ |
120 | FbxPropertyT<FbxBool> DrawFrontFacingVolumetricLight; |
121 | |
122 | /** This property handles the light color. |
123 | * |
124 | * Default value is (1.0, 1.0, 1.0) |
125 | */ |
126 | FbxPropertyT<FbxDouble3> Color; |
127 | |
128 | /** This property handles the light intensity. |
129 | * |
130 | * Default value is 100.0 |
131 | */ |
132 | FbxPropertyT<FbxDouble> Intensity; |
133 | |
134 | /** This property handles the light inner cone angle (in degrees). Also know as the HotSpot |
135 | * |
136 | * Default value is 45.0 |
137 | */ |
138 | FbxPropertyT<FbxDouble> InnerAngle; |
139 | |
140 | /** This property handles the light outer cone angle (in degrees). Also known as the Falloff |
141 | * |
142 | * Default value is 45.0 |
143 | */ |
144 | FbxPropertyT<FbxDouble> OuterAngle; |
145 | |
146 | /** This property handles the light fog intensity |
147 | * |
148 | * Default value is 50.0 |
149 | */ |
150 | FbxPropertyT<FbxDouble> Fog; |
151 | |
152 | /** This property handles the decay type |
153 | * |
154 | * Default value is eNone |
155 | */ |
156 | FbxPropertyT<EDecayType> DecayType; |
157 | |
158 | /** This property handles the decay start distance |
159 | * |
160 | * Default value is 0.0 |
161 | */ |
162 | FbxPropertyT<FbxDouble> DecayStart; |
163 | |
164 | /** This property handles the gobo file name |
165 | * |
166 | * Default value is "" |
167 | */ |
168 | FbxPropertyT<FbxString> FileName; |
169 | |
170 | /** This property handles the enable near attenuation flag |
171 | * |
172 | * Default value is false |
173 | */ |
174 | FbxPropertyT<FbxBool> EnableNearAttenuation; |
175 | |
176 | /** This property handles the near attenuation start distance |
177 | * |
178 | * Default value is 0.0 |
179 | */ |
180 | FbxPropertyT<FbxDouble> NearAttenuationStart; |
181 | |
182 | /** This property handles the near end attenuation |
183 | * |
184 | * Default value is 0.0 |
185 | */ |
186 | FbxPropertyT<FbxDouble> NearAttenuationEnd; |
187 | |
188 | /** This property handles the enable far attenuation flag |
189 | * |
190 | * Default value is false |
191 | */ |
192 | FbxPropertyT<FbxBool> EnableFarAttenuation; |
193 | |
194 | /** This property handles the far attenuation start distance |
195 | * |
196 | * Default value is 0.0 |
197 | */ |
198 | FbxPropertyT<FbxDouble> FarAttenuationStart; |
199 | |
200 | /** This property handles the attenuation end distance |
201 | * |
202 | * Default value is 0.0 |
203 | */ |
204 | FbxPropertyT<FbxDouble> FarAttenuationEnd; |
205 | |
206 | /** This property handles the cast shadow flag |
207 | * |
208 | * Default value is false |
209 | */ |
210 | FbxPropertyT<FbxBool> CastShadows; |
211 | |
212 | /** This property handles the shadow color |
213 | * |
214 | * Default value is (0.0, 0.0, 0.0) |
215 | */ |
216 | FbxPropertyT<FbxDouble3> ShadowColor; |
217 | |
218 | /** This property handles type when LightType is eArea |
219 | * |
220 | * Default value is eRectangle |
221 | */ |
222 | FbxPropertyT<EAreaLightShape> AreaLightShape; |
223 | |
224 | /** This property handles the left barn door angle |
225 | * |
226 | * Default value is 20.0 |
227 | */ |
228 | FbxPropertyT<FbxFloat> LeftBarnDoor; |
229 | |
230 | /** This property handles the right barn door angle |
231 | * |
232 | * Default value is 20.0 |
233 | */ |
234 | FbxPropertyT<FbxFloat> RightBarnDoor; |
235 | |
236 | /** This property handles the top barn door angle |
237 | * |
238 | * Default value is 20.0 |
239 | */ |
240 | FbxPropertyT<FbxFloat> TopBarnDoor; |
241 | |
242 | /** This property handles the bottom barn door angle |
243 | * |
244 | * Default value is 20.0 |
245 | */ |
246 | FbxPropertyT<FbxFloat> BottomBarnDoor; |
247 | |
248 | /** This property handles active status of barn doors |
249 | * |
250 | * Default value is false |
251 | */ |
252 | FbxPropertyT<FbxBool> EnableBarnDoor; |
253 | //@} |
254 | |
255 | /***************************************************************************************************************************** |
256 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
257 | *****************************************************************************************************************************/ |
258 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
259 | virtual FbxNodeAttribute::EType GetAttributeType() const; |
260 | |
261 | protected: |
262 | virtual void ConstructProperties(bool pForceSet); |
263 | virtual FbxStringList GetTypeFlags() const; |
264 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
265 | }; |
266 | |
267 | inline EFbxType FbxTypeOf(const FbxLight::EType&){ return eFbxEnum; } |
268 | inline EFbxType FbxTypeOf(const FbxLight::EDecayType&){ return eFbxEnum; } |
269 | inline EFbxType FbxTypeOf(const FbxLight::EAreaLightShape&){ return eFbxEnum; } |
270 | |
271 | #include <fbxsdk/fbxsdk_nsend.h> |
272 | |
273 | #endif /* _FBXSDK_SCENE_GEOMETRY_LIGHT_H_ */ |
274 | |