diff options
Diffstat (limited to 'linden/indra/newview/llsky.h')
-rw-r--r-- | linden/indra/newview/llsky.h | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/linden/indra/newview/llsky.h b/linden/indra/newview/llsky.h new file mode 100644 index 0000000..7e39311 --- /dev/null +++ b/linden/indra/newview/llsky.h | |||
@@ -0,0 +1,120 @@ | |||
1 | /** | ||
2 | * @file llsky.h | ||
3 | * @brief It's, uh, the sky! | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLSKY_H | ||
29 | #define LL_LLSKY_H | ||
30 | |||
31 | #include "llmath.h" | ||
32 | //#include "vmath.h" | ||
33 | #include "v3math.h" | ||
34 | #include "v4math.h" | ||
35 | #include "v4color.h" | ||
36 | #include "v4coloru.h" | ||
37 | #include "llvosky.h" | ||
38 | #include "llvostars.h" | ||
39 | #include "llvoground.h" | ||
40 | |||
41 | const F32 NIGHTTIME_ELEVATION = -8.0f; // degrees | ||
42 | const F32 NIGHTTIME_ELEVATION_COS = (F32)sin(NIGHTTIME_ELEVATION*DEG_TO_RAD); | ||
43 | |||
44 | class LLViewerCamera; | ||
45 | |||
46 | |||
47 | class LLSky | ||
48 | { | ||
49 | public: | ||
50 | LLSky(); | ||
51 | ~LLSky(); | ||
52 | |||
53 | void init(const LLVector3 &sun_direction); | ||
54 | void free(); | ||
55 | |||
56 | void cleanup(); | ||
57 | |||
58 | void setOverrideSun(BOOL override); | ||
59 | BOOL getOverrideSun() { return mOverrideSimSunPosition; } | ||
60 | void setSunDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity); | ||
61 | void setSunTargetDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity); | ||
62 | |||
63 | |||
64 | LLColor4 getFogColor() const; | ||
65 | |||
66 | |||
67 | void setCloudDensityAtAgent(F32 cloud_density); | ||
68 | void setWind(const LLVector3& wind); | ||
69 | |||
70 | void updateFog(const F32 distance); | ||
71 | void updateCull(); | ||
72 | void updateSky(); | ||
73 | |||
74 | void propagateHeavenlyBodies(F32 dt); // dt = seconds | ||
75 | |||
76 | S32 mLightingGeneration; | ||
77 | BOOL mUpdatedThisFrame; | ||
78 | |||
79 | void setFogRatio(const F32 fog_ratio); // Fog distance as fraction of cull distance. | ||
80 | F32 getFogRatio() const; | ||
81 | LLColor4U getFadeColor() const; | ||
82 | |||
83 | LLVector3 getSunDirection() const; | ||
84 | LLVector3 getMoonDirection() const; | ||
85 | LLColor4 getSunDiffuseColor() const; | ||
86 | LLColor4 getMoonDiffuseColor() const; | ||
87 | LLColor4 getTotalAmbientColor() const; | ||
88 | BOOL sunUp() const; | ||
89 | LLColor4 calcInScatter(LLColor4& transp, const LLVector3 &point, F32 exag) const; | ||
90 | |||
91 | F32 getSunPhase() const; | ||
92 | void setSunPhase(const F32 phase); | ||
93 | |||
94 | void destroyGL(); | ||
95 | void restoreGL(); | ||
96 | |||
97 | public: | ||
98 | LLPointer<LLVOSky> mVOSkyp; // Pointer to the LLVOSky object (only one, ever!) | ||
99 | LLPointer<LLVOStars> mVOStarsp; // Pointer to the LLVOStars object (only one, ever!) | ||
100 | LLPointer<LLVOGround> mVOGroundp; | ||
101 | |||
102 | LLVector3 mSunTargDir; | ||
103 | |||
104 | // Legacy stuff | ||
105 | LLVector3 mSunDefaultPosition; | ||
106 | |||
107 | protected: | ||
108 | BOOL mOverrideSimSunPosition; | ||
109 | |||
110 | F32 mSunPhase; | ||
111 | LLColor4 mFogColor; // Color to use for fog and haze | ||
112 | |||
113 | F32 mHaze; // a multiplier to scale the lighting | ||
114 | F32 mDomeRadius; // sky dome size | ||
115 | |||
116 | LLVector3 mLastSunDirection; | ||
117 | }; | ||
118 | |||
119 | extern LLSky gSky; | ||
120 | #endif | ||