BVB Source Codes

CRYENGINE Show ParticleUpdate.cpp Source code

Return Download CRYENGINE: download ParticleUpdate.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // -------------------------------------------------------------------------
  4. //  Created:     27/10/2014 by Filipe amim
  5. //  Description:
  6. // -------------------------------------------------------------------------
  7. //
  8. ////////////////////////////////////////////////////////////////////////////
  9.  
  10. #include "StdAfx.h"
  11. #include "ParticleSystem.h"
  12. #include "ParticleUpdate.h"
  13. #include "ParticleComponentRuntime.h"
  14. #include "ParticleEmitter.h"
  15. #include "ParticleEmitter.h"
  16.  
  17. CRY_PFX2_DBG
  18.  
  19. namespace
  20. {
  21.  
  22. pfx2::SChaosKey MakeSpawnSeed(pfx2::CParticleComponentRuntime* pRuntime)
  23. {
  24.         uint32 emitterSeed = pRuntime->GetEmitter()->GetInitialSeed();
  25.         uint32 containerSeed = pRuntime->GetContainer().GetNextSpawnId();
  26.         return pfx2::SChaosKey(
  27.                 pfx2::SChaosKey(emitterSeed),
  28.                 pfx2::SChaosKey(containerSeed));
  29. }
  30.  
  31. pfx2::SChaosKey MakeUpdateSeed(pfx2::CParticleComponentRuntime* pRuntime, uint firstParticleId)
  32. {
  33.         uint32 emitterSeed = pRuntime->GetEmitter()->GetCurrentSeed();
  34.         uint32 containerSeed = pRuntime->GetContainer().GetNextSpawnId();
  35.         return pfx2::SChaosKey(
  36.                 pfx2::SChaosKey(emitterSeed),
  37.                 pfx2::SChaosKey(containerSeed),
  38.                 pfx2::SChaosKey(firstParticleId));
  39. }
  40.  
  41. }
  42.  
  43. namespace pfx2
  44. {
  45.  
  46. SUpdateContext::SUpdateContext(CParticleComponentRuntime* pRuntime)
  47.         : SUpdateContext(pRuntime, pRuntime->GetContainer().GetFullRange())
  48. {
  49. }
  50.  
  51. SUpdateContext::SUpdateContext(CParticleComponentRuntime* pRuntime, const SUpdateRange& updateRange)
  52.         : m_pSystem(GetPSystem())
  53.         , m_runtime(*pRuntime)
  54.         , m_container(pRuntime->GetContainer())
  55.         , m_parentContainer(pRuntime->GetParentContainer())
  56.         , m_params(pRuntime->GetComponentParams())
  57.         , m_updateRange(updateRange)
  58.         , m_deltaTime(gEnv->pTimer->GetFrameTime() * pRuntime->GetEmitter()->GetTimeScale())
  59.         , m_time(pRuntime->GetEmitter()->GetTime())
  60.         , m_spawnRng(MakeSpawnSeed(pRuntime))
  61.         , m_spawnRngv(MakeSpawnSeed(pRuntime))
  62.         , m_updateRng(MakeUpdateSeed(pRuntime, updateRange.m_firstParticleId))
  63.         , m_updateRngv(MakeUpdateSeed(pRuntime, updateRange.m_firstParticleId))
  64. {
  65.         const uint32 threadId = JobManager::GetWorkerThreadId();
  66.         m_pMemHeap = &m_pSystem->GetMemHeap(threadId);
  67. }
  68.  
  69. }
  70.  
downloadParticleUpdate.cpp 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