BVB Source Codes

CRYENGINE Show FeatureColor.h Source code

Return Download CRYENGINE: download FeatureColor.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/ParticleFeature.h"
  6.  
  7. namespace pfx2
  8. {
  9.  
  10. class CFeatureFieldColor;
  11.  
  12. struct IColorModifier : public _i_reference_target_t
  13. {
  14. public:
  15.         bool         IsEnabled() const                                                                            { return m_enabled; }
  16.         virtual void AddToParam(CParticleComponent* pComponent, CFeatureFieldColor* pParam)                       {}
  17.         virtual void Serialize(Serialization::IArchive& ar);
  18.         virtual void Modify(const SUpdateContext& context, const SUpdateRange& range, IOColorStream stream) const {}
  19.         virtual void Sample(Vec3* samples, int samplePoints) const                                                {}
  20. private:
  21.         SEnable m_enabled;
  22. };
  23.  
  24. class CFeatureFieldColor : public CParticleFeature
  25. {
  26. private:
  27.         typedef _smart_ptr<IColorModifier> PColorModifier;
  28.  
  29. public:
  30.         CRY_PFX2_DECLARE_FEATURE
  31.  
  32.         CFeatureFieldColor();
  33.  
  34.         virtual void AddToComponent(CParticleComponent* pComponent, SComponentParams* pParams) override;
  35.         virtual void Serialize(Serialization::IArchive& ar) override;
  36.         virtual void InitParticles(const SUpdateContext& context) override;
  37.         virtual void Update(const SUpdateContext& context) override;
  38.         virtual void AddToInitParticles(IColorModifier* pMod);
  39.         virtual void AddToUpdate(IColorModifier* pMod);
  40.  
  41. private:
  42.         void Sample(Vec3* samples, const int numSamples);
  43.  
  44.         std::vector<PColorModifier>  m_modifiers;
  45.         std::vector<IColorModifier*> m_modInit;
  46.         std::vector<IColorModifier*> m_modUpdate;
  47.         ColorB                       m_color;
  48. };
  49.  
  50. }
  51.  
downloadFeatureColor.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