BVB Source Codes

CRYENGINE Show TimeSource.h Source code

Return Download CRYENGINE: download TimeSource.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #pragma once
  4.  
  5. #include "ParticleSystem/ParticleCommon.h"
  6. #include "ParticleSystem/ParticleAttributes.h"
  7. #include "ParticleSystem/ParticleEmitter.h"
  8. #include "ParamMod.h"
  9. #include "FeatureColor.h"
  10.  
  11. namespace pfx2
  12. {
  13.  
  14. SERIALIZATION_ENUM_DECLARE(ETimeSource, ,
  15.                            Age,
  16.                            SpawnFraction,
  17.                            Speed,
  18.                            Field,
  19.                            Attribute,
  20.                            LevelTime,
  21.                            ViewAngle,
  22.                            Random,
  23.  
  24.                            // old version
  25.                            _ParentTime,
  26.                            _ParentOrder,
  27.                            _ParentSpeed,
  28.                            _ParentField,
  29.  
  30.                            _SelfTime = Age,
  31.                            _SelfSpeed = Speed
  32.                            )
  33.  
  34. SERIALIZATION_ENUM_DECLARE(ETimeSourceOwner, ,
  35.                            _None,
  36.                            Self,
  37.                            Parent
  38.                            )
  39.  
  40. typedef DynamicEnum<struct STimeSourceField> ETimeSourceField;
  41. bool Serialize(Serialization::IArchive& ar, ETimeSourceField& value, cstr name, cstr label);
  42.  
  43.  
  44. class CTimeSource
  45. {
  46. public:
  47.         CTimeSource();
  48.  
  49.         template<typename TParam, typename TMod>
  50.         void              AddToParam(CParticleComponent* pComponent, TParam* pParam, TMod* pModifier);
  51.         template<typename TBase, typename TStream>
  52.         void              Dispatch(const SUpdateContext& context, const SUpdateRange& range, TStream stream, EModDomain domain) const;
  53.  
  54.         EModDomain        GetDomain() const;
  55.         EParticleDataType GetDataType() const;
  56.         string            GetSourceDescription() const;
  57.         float             Adjust(float sample) const { return sample * m_timeScale + m_timeBias; }
  58.         void              SerializeInplace(Serialization::IArchive& ar);
  59.  
  60. protected:
  61.         float m_timeScale;
  62.         float m_timeBias;
  63.  
  64. private:
  65.         IParamModContext& GetContext(Serialization::IArchive& ar) const;
  66.  
  67.         string           m_attributeName;
  68.         ETimeSource      m_timeSource;
  69.         ETimeSourceField m_fieldSource;
  70.         ETimeSourceOwner m_sourceOwner;
  71.         bool             m_spawnOnly;
  72. };
  73.  
  74. }
  75.  
  76. #include "TimeSourceImpl.h"
  77.  
downloadTimeSource.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