levelInfo.h

Engine/source/T3D/levelInfo.h

More...

Classes:

Detailed Description

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#ifndef _LEVELINFO_H_
 25#define _LEVELINFO_H_
 26
 27#ifndef _NETOBJECT_H_
 28   #include "sim/netObject.h"
 29#endif
 30#ifndef _COLOR_H_
 31   #include "core/color.h"
 32#endif
 33#ifndef _FOGSTRUCTS_H_
 34   #include "scene/fogStructs.h"
 35#endif
 36#ifndef _SFXCOMMON_H_
 37   #include "sfx/sfxCommon.h"
 38#endif
 39
 40#ifndef _GFXTEXTUREHANDLE_H_
 41#include "gfx/gfxTextureHandle.h"
 42#endif
 43
 44class SFXAmbience;
 45class SFXSoundscape;
 46
 47
 48class LevelInfo : public NetObject
 49{
 50      typedef NetObject Parent;
 51      
 52   private:
 53
 54      F32 mWorldSize;
 55
 56      FogData mFogData;
 57      
 58      F32 mNearClip;
 59
 60      F32 mVisibleDistance;
 61
 62      F32 mVisibleGhostDistance;
 63
 64      F32 mDecalBias;
 65
 66      ColorI mCanvasClearColor;
 67
 68      /// @name Lighting Properties
 69      /// @{
 70
 71      bool mAdvancedLightmapSupport;
 72
 73      /// Seconds it takes to go from one global ambient color
 74      /// to a different one.
 75      F32 mAmbientLightBlendPhase;
 76
 77      /// Interpolation for going from one global ambient color
 78      /// to a different one.
 79      EaseF mAmbientLightBlendCurve;
 80
 81      /// @}
 82      
 83      /// @name Sound Properties
 84      /// @{
 85      
 86      /// Global ambient sound space properties.
 87      SFXAmbience* mSoundAmbience;
 88      
 89      /// Distance attenuation model to use.
 90      SFXDistanceModel mSoundDistanceModel;
 91      
 92      ///
 93      SFXSoundscape* mSoundscape;
 94         
 95      /// @}
 96      
 97      /// Responsible for passing on
 98      /// the LevelInfo settings to the
 99      /// client SceneGraph, from which
100      /// other systems can get at them.
101      void _updateSceneGraph();
102
103      void _onLMActivate(const char *lm, bool enable);
104   protected:
105      // Name (path) of the accumulation texture.
106      String mAccuTextureName;
107
108   public:
109
110      LevelInfo();
111      virtual ~LevelInfo();
112
113      DECLARE_CONOBJECT(LevelInfo);
114
115      /// @name SceneObject Inheritance
116      /// @{
117      
118      virtual SFXAmbience* getSoundAmbience() const { return mSoundAmbience; }
119
120      /// @}
121      
122      /// @name SimObject Inheritance
123      /// @{
124
125      virtual bool onAdd();
126      virtual void onRemove();
127      virtual void inspectPostApply();
128
129      static void initPersistFields();
130
131      /// @}
132
133      /// @name NetObject Inheritance
134      /// @{
135      
136      enum NetMaskBits 
137      {
138         UpdateMask = BIT(0)
139      };
140
141      GFXTexHandle mAccuTexture;
142
143      virtual U32 packUpdate( NetConnection *conn, U32 mask, BitStream *stream );
144      virtual void unpackUpdate( NetConnection *conn, BitStream *stream );
145      static bool _setLevelAccuTexture(void *object, const char *index, const char *data);
146      void setLevelAccuTexture(const String& name);
147      /// @}
148};
149
150#endif // _LEVELINFO_H_
151