fbxlight.h 7.5 KB

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