BVB Source Codes

CRYENGINE Show TimeOfDay.h Source code

Return Download CRYENGINE: download TimeOfDay.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // -------------------------------------------------------------------------
  4. //  File name:   TimeOfDay.h
  5. //  Version:     v1.00
  6. //  Created:     25/10/2005 by Timur.
  7. //  Compilers:   Visual Studio.NET 2003
  8. //  Description:
  9. // -------------------------------------------------------------------------
  10. //  History:
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13.  
  14. #ifndef __TimeOfDay_h__
  15. #define __TimeOfDay_h__
  16.  
  17. #include <Cry3DEngine/ITimeOfDay.h>
  18. #include <CryAudio/IAudioInterfacesCommonData.h>
  19.  
  20. class CEnvironmentPreset;
  21. //////////////////////////////////////////////////////////////////////////
  22. // ITimeOfDay interface implementation.
  23. //////////////////////////////////////////////////////////////////////////
  24. class CTimeOfDay : public ITimeOfDay
  25. {
  26. public:
  27.         CTimeOfDay();
  28.         ~CTimeOfDay();
  29.  
  30.         //////////////////////////////////////////////////////////////////////////
  31.         // ITimeOfDay
  32.         //////////////////////////////////////////////////////////////////////////
  33.  
  34.         virtual int   GetPresetCount() const { return m_presets.size(); }
  35.         virtual bool  GetPresetsInfos(SPresetInfo* resultArray, unsigned int arraySize) const;
  36.         virtual bool  SetCurrentPreset(const char* szPresetName);
  37.         virtual bool  AddNewPreset(const char* szPresetName);
  38.         virtual bool  RemovePreset(const char* szPresetName);
  39.         virtual bool  SavePreset(const char* szPresetName) const;
  40.         virtual bool  LoadPreset(const char* szFilePath);
  41.         virtual void  ResetPreset(const char* szPresetName);
  42.  
  43.         virtual bool  ImportPreset(const char* szPresetName, const char* szFilePath);
  44.         virtual bool  ExportPreset(const char* szPresetName, const char* szFilePath) const;
  45.  
  46.         virtual int   GetVariableCount() { return ITimeOfDay::PARAM_TOTAL; };
  47.         virtual bool  GetVariableInfo(int nIndex, SVariableInfo& varInfo);
  48.         virtual void  SetVariableValue(int nIndex, float fValue[3]);
  49.  
  50.         virtual bool  InterpolateVarInRange(int nIndex, float fMin, float fMax, unsigned int nCount, Vec3* resultArray) const;
  51.         virtual uint  GetSplineKeysCount(int nIndex, int nSpline) const;
  52.         virtual bool  GetSplineKeysForVar(int nIndex, int nSpline, SBezierKey* keysArray, unsigned int keysArraySize) const;
  53.         virtual bool  SetSplineKeysForVar(int nIndex, int nSpline, const SBezierKey* keysArray, unsigned int keysArraySize);
  54.         virtual bool  UpdateSplineKeyForVar(int nIndex, int nSpline, float fTime, float newValue);
  55.         virtual float GetAnimTimeSecondsIn24h();
  56.  
  57.         virtual void  ResetVariables();
  58.  
  59.         // Time of day is specified in hours.
  60.         virtual void  SetTime(float fHour, bool bForceUpdate = false);
  61.         virtual void  SetSunPos(float longitude, float latitude);
  62.         virtual float GetSunLatitude()       { return m_sunRotationLatitude; }
  63.         virtual float GetSunLongitude()      { return m_sunRotationLongitude; }
  64.         virtual float GetTime()              { return m_fTime; };
  65.  
  66.         virtual void  SetPaused(bool paused) { m_bPaused = paused; }
  67.  
  68.         virtual void  SetAdvancedInfo(const SAdvancedInfo& advInfo);
  69.         virtual void  GetAdvancedInfo(SAdvancedInfo& advInfo);
  70.  
  71.         float         GetHDRMultiplier() const { return m_fHDRMultiplier; }
  72.  
  73.         virtual void  Update(bool bInterpolate = true, bool bForceUpdate = false);
  74.  
  75.         virtual void  Serialize(XmlNodeRef& node, bool bLoading);
  76.         virtual void  Serialize(TSerialize ser);
  77.  
  78.         virtual void  SetTimer(ITimer* pTimer);
  79.  
  80.         virtual void  NetSerialize(TSerialize ser, float lag, uint32 flags);
  81.  
  82.         virtual void  Tick();
  83.  
  84.         virtual void  SetEnvironmentSettings(const SEnvironmentInfo& envInfo);
  85.  
  86.         virtual void  SaveInternalState(struct IDataWriteStream& writer);
  87.         virtual void  LoadInternalState(struct IDataReadStream& reader);
  88.  
  89.         //////////////////////////////////////////////////////////////////////////
  90.  
  91.         void BeginEditMode() { m_bEditMode = true; };
  92.         void EndEditMode()   { m_bEditMode = false; };
  93.  
  94. private:
  95.         CTimeOfDay(const CTimeOfDay&);
  96.         CTimeOfDay(const CTimeOfDay&&);
  97.         CTimeOfDay&    operator=(const CTimeOfDay&);
  98.         CTimeOfDay&    operator=(const CTimeOfDay&&);
  99.  
  100.         SVariableInfo& GetVar(ETimeOfDayParamID id);
  101.         void           UpdateEnvLighting(bool forceUpdate);
  102.  
  103. private:
  104.         typedef std::map<string, CEnvironmentPreset> TPresetsSet;
  105.         TPresetsSet         m_presets;
  106.         CEnvironmentPreset* m_pCurrentPreset;
  107.  
  108.         SVariableInfo       m_vars[ITimeOfDay::PARAM_TOTAL];
  109.  
  110.         float               m_fTime;
  111.         float               m_sunRotationLatitude;
  112.         float               m_sunRotationLongitude;
  113.  
  114.         bool                m_bEditMode;
  115.         bool                m_bPaused;
  116.         bool                m_bSunLinkedToTOD;
  117.  
  118.         SAdvancedInfo       m_advancedInfo;
  119.         ITimer*             m_pTimer;
  120.         float               m_fHDRMultiplier;
  121.         ICVar*              m_pTimeOfDaySpeedCVar;
  122.         AudioControlId      m_timeOfDayRtpcId;
  123. };
  124.  
  125. #endif //__TimeOfDay_h__
  126.  
downloadTimeOfDay.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top