BVB Source Codes

CRYENGINE Show CloudBlockerRenderNode.cpp Source code

Return Download CRYENGINE: download CloudBlockerRenderNode.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.  
  5. #include "CloudBlockerRenderNode.h"
  6.  
  7. CCloudBlockerRenderNode::CCloudBlockerRenderNode()
  8.         : m_WSBBox(1.0f)
  9.         , m_position(0.0f, 0.0f, 0.0f)
  10.         , m_decayStart(0.0f)
  11.         , m_decayEnd(0.0f)
  12.         , m_decayInfluence(0.0)
  13.         , m_bScreenspace(false)
  14. {
  15.         GetInstCount(GetRenderNodeType())++;
  16.  
  17.         // cloud blocker must be always visible.
  18.         SetRndFlags(ERF_HUD | ERF_RENDER_ALWAYS, true);
  19. }
  20.  
  21. CCloudBlockerRenderNode::~CCloudBlockerRenderNode()
  22. {
  23.         GetInstCount(GetRenderNodeType())--;
  24.  
  25.         Get3DEngine()->FreeRenderNodeState(this);
  26. }
  27.  
  28. void CCloudBlockerRenderNode::SetMatrix(const Matrix34& mat)
  29. {
  30.         m_position = mat.GetTranslation();
  31.         m_WSBBox.SetTransformedAABB(mat, AABB(1.0f));
  32.  
  33.         Get3DEngine()->RegisterEntity(this);
  34. }
  35.  
  36. void CCloudBlockerRenderNode::OffsetPosition(const Vec3& delta)
  37. {
  38.         if (m_pTempData) m_pTempData->OffsetPosition(delta);
  39.         m_position += delta;
  40.         m_WSBBox.Move(delta);
  41. }
  42.  
  43. void CCloudBlockerRenderNode::Render(const struct SRendParams& EntDrawParams, const SRenderingPassInfo& passInfo)
  44. {
  45.         // recursive pass isn't supported currently.
  46.         if (!passInfo.RenderClouds() || passInfo.IsRecursivePass())
  47.         {
  48.                 return;
  49.         }
  50.  
  51.         IRenderView* pRenderView = passInfo.GetIRenderView();
  52.         int32 flag = m_bScreenspace ? 1 : 0;
  53.         pRenderView->AddCloudBlocker(m_position, Vec3(m_decayStart, m_decayEnd, m_decayInfluence), flag);
  54. }
  55.  
  56. void CCloudBlockerRenderNode::GetMemoryUsage(ICrySizer* pSizer) const
  57. {
  58.         SIZER_COMPONENT_NAME(pSizer, "CloudBlocker");
  59.         pSizer->AddObject(this, sizeof(*this));
  60. }
  61.  
  62. void CCloudBlockerRenderNode::SetProperties(const SCloudBlockerProperties& properties)
  63. {
  64.         m_decayStart = properties.decayStart;
  65.         m_decayEnd = properties.decayEnd;
  66.         m_decayInfluence = properties.decayInfluence;
  67.         m_bScreenspace = properties.bScreenspace;
  68. }
  69.  
  70. void CCloudBlockerRenderNode::FillBBox(AABB& aabb)
  71. {
  72.         aabb = CCloudBlockerRenderNode::GetBBox();
  73. }
  74.  
downloadCloudBlockerRenderNode.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