| 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 fbxgloballightsettings.h |
| 13 | #ifndef _FBXSDK_FILEIO_GLOBAL_LIGHT_SETTINGS_H_ |
| 14 | #define _FBXSDK_FILEIO_GLOBAL_LIGHT_SETTINGS_H_ |
| 15 | |
| 16 | #include <fbxsdk/fbxsdk_def.h> |
| 17 | |
| 18 | #include <fbxsdk/core/fbxpropertytypes.h> |
| 19 | |
| 20 | #include <fbxsdk/fbxsdk_nsbegin.h> |
| 21 | |
| 22 | class FbxGlobalLightSettingsProperties; |
| 23 | |
| 24 | /** This class contains functions for accessing global light settings. |
| 25 | * \nosubgrouping |
| 26 | * \remarks This class exists for FBX version 6.x and earlier. The new FBX v7.x file format that is |
| 27 | * now the default no longer uses it. The relevant data (a subset of this class) has been moved to |
| 28 | * the FbxGlobalSettings object and should be used instead. |
| 29 | */ |
| 30 | class FBXSDK_DLL FbxGlobalLightSettings |
| 31 | { |
| 32 | |
| 33 | public: |
| 34 | FBXSDK_FRIEND_NEW(); |
| 35 | /** |
| 36 | * \name Ambient Color |
| 37 | */ |
| 38 | //@{ |
| 39 | |
| 40 | /** Sets the ambient color. |
| 41 | * \param pAmbientColor The ambient color to set. |
| 42 | * \remarks The ambient color only use RGB channels. |
| 43 | */ |
| 44 | void SetAmbientColor(FbxColor pAmbientColor); |
| 45 | |
| 46 | /** Returns the ambient color. |
| 47 | * \return The ambient color. |
| 48 | */ |
| 49 | FbxColor GetAmbientColor() const; |
| 50 | |
| 51 | //@} |
| 52 | |
| 53 | /** |
| 54 | * \name Fog Option |
| 55 | */ |
| 56 | //@{ |
| 57 | |
| 58 | /** Activates or disables the fog. |
| 59 | * \param pEnable Set to \c true to activate the fog option or set to \c false to disable the fog option. |
| 60 | */ |
| 61 | void SetFogEnable(bool pEnable); |
| 62 | |
| 63 | /** Returns the fog option's current state. |
| 64 | * \return \c True if fog is activated, returns \c false if fog is disabled. |
| 65 | */ |
| 66 | bool GetFogEnable() const; |
| 67 | |
| 68 | /** Sets the fog color. |
| 69 | * \param pColor The fog color to be set. |
| 70 | * \remarks The fog color only uses RGB channels. |
| 71 | */ |
| 72 | void SetFogColor(FbxColor pColor); |
| 73 | |
| 74 | /** Returns the fog color. |
| 75 | * \return The fog color. |
| 76 | * \remarks The fog color only uses RGB channels. |
| 77 | */ |
| 78 | FbxColor GetFogColor() const; |
| 79 | |
| 80 | /** \enum EFogMode Fog types. |
| 81 | */ |
| 82 | enum EFogMode |
| 83 | { |
| 84 | eLinear, //! Linear fog mode. |
| 85 | eExponential, //! Exponential fog mode. |
| 86 | eExponentialSquareRoot //! Exponential square root fog mode. |
| 87 | }; |
| 88 | |
| 89 | /** Sets the fog mode. |
| 90 | * \param pMode The fog type to be set. |
| 91 | */ |
| 92 | void SetFogMode(EFogMode pMode); |
| 93 | |
| 94 | /** Returns the fog mode. |
| 95 | * \return The currently set fog mode. |
| 96 | */ |
| 97 | EFogMode GetFogMode() const; |
| 98 | |
| 99 | /** Sets the fog density. |
| 100 | * \param pDensity The fog density to be set. It can be any double value, however it can |
| 101 | * happen that other sections of FBX SDK may clamp values to reasonable values. |
| 102 | * \remarks This function is only used when the fog mode is set to exponential or square root exponential. |
| 103 | */ |
| 104 | void SetFogDensity(double pDensity); |
| 105 | |
| 106 | /** Returns the fog density. |
| 107 | * \return The currently set fog density. |
| 108 | * \remarks This function is only used when the fog mode is set to exponential or square root exponential. |
| 109 | */ |
| 110 | double GetFogDensity() const; |
| 111 | |
| 112 | /** Sets the distance from the view where the fog begins. |
| 113 | * \param pStart Distance where the fog begins. |
| 114 | * \remarks This function is only used when the fog mode is set to linear. The new value is clamped to fit inside the interval [0, FogEnd()]. |
| 115 | */ |
| 116 | void SetFogStart(double pStart); |
| 117 | |
| 118 | /** Returns the distance from the view where the fog begins. |
| 119 | * \return The distance from the view where the fog begins. |
| 120 | * \remarks This function is only used when the fog mode is set to linear. |
| 121 | */ |
| 122 | double GetFogStart() const; |
| 123 | |
| 124 | /** Sets the distance from the view where the fog ends. |
| 125 | * \param pEnd Distance where the fog ends. |
| 126 | * \remarks This function is only used when the fog mode is set to linear. The new value is adjusted to fit within the interval [FogStart(), inf). |
| 127 | */ |
| 128 | void SetFogEnd(double pEnd); |
| 129 | |
| 130 | /** Returns the distance from the view where the fog ends. |
| 131 | * \return The distance from the view where the fog ends. |
| 132 | * \remarks This function is only used when the fog mode is set to linear. |
| 133 | */ |
| 134 | double GetFogEnd() const; |
| 135 | |
| 136 | //@} |
| 137 | |
| 138 | /** |
| 139 | * \name Shadow Planes |
| 140 | * The functions in this section are supported only by FiLMBOX version 2.7 and earlier. |
| 141 | * FiLMBOX 3.0 supports shadow planes within a specific shader, which is not supported by the FBX SDK. |
| 142 | */ |
| 143 | //@{ |
| 144 | |
| 145 | /** Struct used to define the shadow plane. |
| 146 | */ |
| 147 | struct FBXSDK_DLL ShadowPlane |
| 148 | { |
| 149 | //! Default constructor. |
| 150 | ShadowPlane(); |
| 151 | |
| 152 | //! Activate flag. |
| 153 | bool mEnable; |
| 154 | |
| 155 | //! Origin point. |
| 156 | FbxVector4 mOrigin; |
| 157 | |
| 158 | //! Normal vector. |
| 159 | FbxVector4 mNormal; |
| 160 | }; |
| 161 | |
| 162 | /** Activates or disables the display of shadow planes. |
| 163 | * \param pShadowEnable Set to \c true to display shadow planes in the scene. |
| 164 | */ |
| 165 | void SetShadowEnable(bool pShadowEnable); |
| 166 | |
| 167 | /** Returns the current state of the shadow enable flag. |
| 168 | * \return \c True if shadow planes are set to be displayed in the scene. |
| 169 | */ |
| 170 | bool GetShadowEnable() const; |
| 171 | |
| 172 | /** Sets the shadow intensity that is applied to all shadow planes. |
| 173 | * \param pShadowIntensity Intensity applied to all the shadow planes. |
| 174 | * \remarks Ranges from 0 to 300. |
| 175 | */ |
| 176 | void SetShadowIntensity(double pShadowIntensity); |
| 177 | |
| 178 | /** Returns the shadow intensity applied to all shadow planes. |
| 179 | * \return The intensity applied to all shadow planes in the scene. |
| 180 | * \remarks Ranges from 0 to 300. |
| 181 | */ |
| 182 | double GetShadowIntensity() const; |
| 183 | |
| 184 | /** Returns the number of shadow planes. |
| 185 | * \return Number of shadow planes. |
| 186 | */ |
| 187 | int GetShadowPlaneCount() const; |
| 188 | |
| 189 | /** Returns a shadow plane at the specified index. |
| 190 | * \param pIndex Shadow plane index. |
| 191 | * \param pStatus The FbxStatus object to hold error codes. |
| 192 | * \return Pointer the shadow plane, or \c NULL if the index is out of range. |
| 193 | */ |
| 194 | ShadowPlane* GetShadowPlane(int pIndex, FbxStatus* pStatus=NULL); |
| 195 | |
| 196 | /** Adds a shadow plane. |
| 197 | * \param pShadowPlane The shadow plane to be added. |
| 198 | */ |
| 199 | void AddShadowPlane(ShadowPlane pShadowPlane); |
| 200 | |
| 201 | //! Removes all shadow planes. |
| 202 | void RemoveAllShadowPlanes(); |
| 203 | |
| 204 | //@} |
| 205 | |
| 206 | //! Restores default settings. |
| 207 | void RestoreDefaultSettings(); |
| 208 | |
| 209 | /** Assignment operator. |
| 210 | * \param pGlobalLightSettings FbxGlobalLightSettings object assigned to this one. |
| 211 | */ |
| 212 | const FbxGlobalLightSettings& operator=(const FbxGlobalLightSettings& pGlobalLightSettings); |
| 213 | |
| 214 | |
| 215 | /***************************************************************************************************************************** |
| 216 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
| 217 | *****************************************************************************************************************************/ |
| 218 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 219 | private: |
| 220 | FbxGlobalLightSettings(); |
| 221 | ~FbxGlobalLightSettings(); |
| 222 | |
| 223 | FbxGlobalLightSettingsProperties* mPH; |
| 224 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
| 225 | }; |
| 226 | |
| 227 | #include <fbxsdk/fbxsdk_nsend.h> |
| 228 | |
| 229 | #endif /* _FBXSDK_FILEIO_GLOBAL_LIGHT_SETTINGS_H_ */ |
| 230 | |