PageRenderTime 132ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llsky.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 118 lines | 64 code | 27 blank | 27 comment | 0 complexity | a7507dc8487d82499fbee6352c443a34 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llsky.h
  3. * @brief It's, uh, the sky!
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLSKY_H
  27. #define LL_LLSKY_H
  28. #include "llmath.h"
  29. //#include "vmath.h"
  30. #include "v3math.h"
  31. #include "v4math.h"
  32. #include "v4color.h"
  33. #include "v4coloru.h"
  34. #include "llvosky.h"
  35. #include "llvoground.h"
  36. class LLViewerCamera;
  37. class LLVOWLSky;
  38. class LLVOWLClouds;
  39. class LLSky
  40. {
  41. public:
  42. LLSky();
  43. ~LLSky();
  44. void init(const LLVector3 &sun_direction);
  45. void cleanup();
  46. void setOverrideSun(BOOL override);
  47. BOOL getOverrideSun() { return mOverrideSimSunPosition; }
  48. void setSunDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity);
  49. void setSunTargetDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity);
  50. LLColor4 getFogColor() const;
  51. void setCloudDensityAtAgent(F32 cloud_density);
  52. void setWind(const LLVector3& wind);
  53. void updateFog(const F32 distance);
  54. void updateCull();
  55. void updateSky();
  56. void propagateHeavenlyBodies(F32 dt); // dt = seconds
  57. S32 mLightingGeneration;
  58. BOOL mUpdatedThisFrame;
  59. void setFogRatio(const F32 fog_ratio); // Fog distance as fraction of cull distance.
  60. F32 getFogRatio() const;
  61. LLColor4U getFadeColor() const;
  62. LLVector3 getSunDirection() const;
  63. LLVector3 getMoonDirection() const;
  64. LLColor4 getSunDiffuseColor() const;
  65. LLColor4 getMoonDiffuseColor() const;
  66. LLColor4 getSunAmbientColor() const;
  67. LLColor4 getMoonAmbientColor() const;
  68. LLColor4 getTotalAmbientColor() const;
  69. BOOL sunUp() const;
  70. F32 getSunPhase() const;
  71. void setSunPhase(const F32 phase);
  72. void destroyGL();
  73. void restoreGL();
  74. void resetVertexBuffers();
  75. public:
  76. LLPointer<LLVOSky> mVOSkyp; // Pointer to the LLVOSky object (only one, ever!)
  77. LLPointer<LLVOGround> mVOGroundp;
  78. LLPointer<LLVOWLSky> mVOWLSkyp;
  79. LLVector3 mSunTargDir;
  80. // Legacy stuff
  81. LLVector3 mSunDefaultPosition;
  82. static const F32 NIGHTTIME_ELEVATION; // degrees
  83. static const F32 NIGHTTIME_ELEVATION_COS;
  84. protected:
  85. BOOL mOverrideSimSunPosition;
  86. F32 mSunPhase;
  87. LLColor4 mFogColor; // Color to use for fog and haze
  88. LLVector3 mLastSunDirection;
  89. };
  90. extern LLSky gSky;
  91. #endif