1 //****************************************************************************** 2 /// 3 /// @file core/scene/atmosphere.h 4 /// 5 /// Declarations related to atmospheric effets and sky spheres. 6 /// 7 /// @copyright 8 /// @parblock 9 /// 10 /// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8. 11 /// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd. 12 /// 13 /// POV-Ray is free software: you can redistribute it and/or modify 14 /// it under the terms of the GNU Affero General Public License as 15 /// published by the Free Software Foundation, either version 3 of the 16 /// License, or (at your option) any later version. 17 /// 18 /// POV-Ray is distributed in the hope that it will be useful, 19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of 20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 /// GNU Affero General Public License for more details. 22 /// 23 /// You should have received a copy of the GNU Affero General Public License 24 /// along with this program. If not, see <http://www.gnu.org/licenses/>. 25 /// 26 /// ---------------------------------------------------------------------------- 27 /// 28 /// POV-Ray is based on the popular DKB raytracer version 2.12. 29 /// DKBTrace was originally written by David K. Buck. 30 /// DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins. 31 /// 32 /// @endparblock 33 /// 34 //****************************************************************************** 35 36 #ifndef POVRAY_CORE_ATMOSPHERE_H 37 #define POVRAY_CORE_ATMOSPHERE_H 38 39 // Module config header file must be the first file included within POV-Ray unit header files 40 #include "core/configcore.h" 41 42 #include "core/material/pigment.h" 43 44 namespace pov 45 { 46 47 //############################################################################## 48 /// 49 /// @defgroup PovCoreSceneAtmosphere Atmospheric Effects and Sky Spheres 50 /// @ingroup PovCore 51 /// 52 /// @{ 53 54 /***************************************************************************** 55 * Global preprocessor defines 56 ******************************************************************************/ 57 58 /* Define fog types. DMF */ 59 60 #define ORIG_FOG 1 61 #define GROUND_MIST 2 62 #define FOG_TYPES 2 63 64 /***************************************************************************** 65 * Global typedefs 66 ******************************************************************************/ 67 68 typedef struct Fog_Struct FOG; 69 typedef struct Rainbow_Struct RAINBOW; 70 typedef struct Skysphere_Struct SKYSPHERE; 71 72 struct TurbulenceWarp; // full declaration in core/material/warp.h 73 74 struct Fog_Struct 75 { 76 Fog_Struct(); 77 ~Fog_Struct(); 78 int Type; 79 DBL Distance; 80 DBL Alt; 81 DBL Offset; 82 TransColour colour; // may have a filter/transmit component 83 Vector3d Up; 84 TurbulenceWarp *Turb; 85 SNGL Turb_Depth; 86 FOG *Next; 87 }; 88 89 struct Rainbow_Struct 90 { Rainbow_StructRainbow_Struct91 Rainbow_Struct() : Pigment(nullptr), Next(nullptr) {} ~Rainbow_StructRainbow_Struct92 ~Rainbow_Struct() { if (Pigment) delete Pigment; } 93 DBL Distance; 94 DBL Jitter; 95 DBL Angle, Width; 96 DBL Arc_Angle, Falloff_Angle, Falloff_Width; 97 Vector3d Antisolar_Vector; 98 Vector3d Up_Vector, Right_Vector; 99 PIGMENT *Pigment; 100 RAINBOW *Next; 101 }; 102 103 struct Skysphere_Struct 104 { Skysphere_StructSkysphere_Struct105 Skysphere_Struct() : Trans(nullptr) {} 106 ~Skysphere_Struct(); 107 MathColour Emission; ///< Brightness adjustment. 108 vector<PIGMENT *> Pigments; ///< Pigment(s) to use. 109 TRANSFORM * Trans; ///< Skysphere transformation. 110 }; 111 112 /***************************************************************************** 113 * Global functions 114 ******************************************************************************/ 115 116 FOG *Create_Fog (void); 117 FOG *Copy_Fog (const FOG *Fog); 118 void Destroy_Fog (FOG *Fog); 119 120 RAINBOW *Create_Rainbow (void); 121 RAINBOW *Copy_Rainbow (const RAINBOW *Rainbow); 122 void Destroy_Rainbow (RAINBOW *Rainbow); 123 124 SKYSPHERE *Create_Skysphere (void); 125 SKYSPHERE *Copy_Skysphere (const SKYSPHERE *Skysphere); 126 void Destroy_Skysphere (SKYSPHERE *Skysphere); 127 void Scale_Skysphere (SKYSPHERE *Skysphere, const Vector3d& Vector); 128 void Rotate_Skysphere (SKYSPHERE *Skysphere, const Vector3d& Vector); 129 void Translate_Skysphere (SKYSPHERE *Skysphere, const Vector3d& Vector); 130 void Transform_Skysphere (SKYSPHERE *Skysphere, const TRANSFORM *Trans); 131 132 /// @} 133 /// 134 //############################################################################## 135 136 } 137 138 #endif // POVRAY_CORE_ATMOSPHERE_H 139