BVB Source Codes

CRYENGINE Show BloodSplats.cpp Source code

Return Download CRYENGINE: download BloodSplats.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #include "StdAfx.h"
  4. #include "BloodSplats.h"
  5.  
  6. void CBloodSplats::Init(int type, float maxTime)
  7. {
  8.         m_type = type;
  9.         m_maxTime = maxTime;
  10. }
  11.  
  12. bool CBloodSplats::Update(float delta)
  13. {
  14.         m_currentTime -= delta;
  15.  
  16.         if (m_currentTime < 0.0f)
  17.                 return true;
  18.  
  19.         float scale = (2.0f * m_currentTime) / m_maxTime;
  20.         if (scale > 1.0f) scale = 1.0f;
  21.  
  22.         gEnv->p3DEngine->SetPostEffectParam("BloodSplats_Amount", scale * scale);
  23.  
  24.         return false;
  25. }
  26.  
  27. bool CBloodSplats::OnActivate()
  28. {
  29.         gEnv->p3DEngine->SetPostEffectParam("BloodSplats_Type", (float)m_type);
  30.         gEnv->p3DEngine->SetPostEffectParam("BloodSplats_Active", 1.0f);
  31.         gEnv->p3DEngine->SetPostEffectParam("BloodSplats_Amount", 1.0f);
  32.         gEnv->p3DEngine->SetPostEffectParam("BloodSplats_Spawn", 1.0f);
  33.         m_currentTime = m_maxTime;
  34.         return true;
  35. }
  36.  
  37. bool CBloodSplats::OnDeactivate()
  38. {
  39.         gEnv->p3DEngine->SetPostEffectParam("BloodSplats_Active", 0.0f);
  40.         return true;
  41. }
  42.  
  43. void CBloodSplats::GetMemoryUsage(ICrySizer* s) const
  44. {
  45.         s->Add(*this);
  46. }
  47.  
downloadBloodSplats.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