BVB Source Codes

CRYENGINE Show MFXParticleEffect.h Source code

Return Download CRYENGINE: download MFXParticleEffect.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __MFXPARTICLEEFFECT_H__
  4. #define __MFXPARTICLEEFFECT_H__
  5.  
  6. #pragma once
  7.  
  8. #include "MFXEffectBase.h"
  9.  
  10. struct SMFXParticleEntry
  11. {
  12.         string name;
  13.         string userdata;
  14.         float  scale;    // base scale
  15.         float  maxdist;  // max distance for spawning this effect
  16.         float  minscale; // min scale (distance == 0)
  17.         float  maxscale; // max scale (distance == maxscaledist)
  18.         float  maxscaledist;
  19.         bool   attachToTarget;
  20.  
  21.         SMFXParticleEntry()
  22.                 : scale(1.0f)
  23.                 , maxdist(0.0f)
  24.                 , minscale(0.0f)
  25.                 , maxscale(0.0f)
  26.                 , maxscaledist(0.0f)
  27.                 , attachToTarget(false)
  28.         {
  29.         }
  30.  
  31.         void GetMemoryUsage(ICrySizer* pSizer) const
  32.         {
  33.                 pSizer->AddObject(name);
  34.                 pSizer->AddObject(userdata);
  35.         }
  36. };
  37.  
  38. typedef std::vector<SMFXParticleEntry> SMFXParticleEntries;
  39.  
  40. struct SMFXParticleParams
  41. {
  42.         enum EDirectionType
  43.         {
  44.                 eDT_Normal = 0,
  45.                 eDT_Ricochet,
  46.                 eDT_ProjectileDir,
  47.         };
  48.  
  49.         SMFXParticleParams()
  50.                 : directionType(eDT_Normal)
  51.         {}
  52.  
  53.         SMFXParticleEntries m_entries;
  54.         EDirectionType      directionType;
  55. };
  56.  
  57. class CMFXParticleEffect :
  58.         public CMFXEffectBase
  59. {
  60.         typedef CryFixedStringT<32> TAttachmentName;
  61.  
  62. public:
  63.  
  64.         CMFXParticleEffect();
  65.         virtual ~CMFXParticleEffect();
  66.  
  67.         //IMFXEffect
  68.         virtual void Execute(const SMFXRunTimeEffectParams& params) override;
  69.         virtual void LoadParamsFromXml(const XmlNodeRef& paramsNode) override;
  70.         virtual void GetResources(SMFXResourceList& resourceList) const override;
  71.         virtual void PreLoadAssets() override;
  72.         virtual void GetMemoryUsage(ICrySizer* pSizer) const override;
  73.         //~IMFXEffect
  74.  
  75. protected:
  76.  
  77.         bool AttachToTarget(const SMFXParticleEntry& particleParams, const SMFXRunTimeEffectParams& params, IParticleEffect* pParticleEffect, const Vec3& dir, float scale);
  78.         bool AttachToCharacter(IEntity& targetEntity, const SMFXParticleEntry& particleParams, const SMFXRunTimeEffectParams& params, const Vec3& dir, float scale);
  79.         bool AttachToEntity(IEntity& targetEntity, const SMFXParticleEntry& particleParams, const SMFXRunTimeEffectParams& params, IParticleEffect* pParticleEffect, const Vec3& dir, float scale);
  80.  
  81.         void GetNextCharacterAttachmentName(TAttachmentName& attachmentName);
  82.  
  83.         SMFXParticleParams m_particleParams;
  84. };
  85.  
  86. #endif //__MFXPARTICLEEFFECT_H__
  87.  
downloadMFXParticleEffect.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