BVB Source Codes

CRYENGINE Show DecalRenderNode.h Source code

Return Download CRYENGINE: download DecalRenderNode.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef _DECAL_RENDERNODE_
  4. #define _DECAL_RENDERNODE_
  5.  
  6. #pragma once
  7.  
  8. #include "DecalManager.h"
  9.  
  10. class CDecalRenderNode : public IDecalRenderNode, public Cry3DEngineBase
  11. {
  12. public:
  13.         // implements IDecalRenderNode
  14.         virtual void                    SetDecalProperties(const SDecalProperties& properties);
  15.         virtual const SDecalProperties* GetDecalProperties() const;
  16.         virtual void                    CleanUpOldDecals();
  17.  
  18.         // implements IRenderNode
  19.         virtual IRenderNode*     Clone() const;
  20.         virtual void             SetMatrix(const Matrix34& mat);
  21.         virtual const Matrix34&  GetMatrix() { return m_Matrix; }
  22.  
  23.         virtual EERType          GetRenderNodeType();
  24.         virtual const char*      GetEntityClassName() const;
  25.         virtual const char*      GetName() const;
  26.         virtual Vec3             GetPos(bool bWorldOnly = true) const;
  27.         virtual void             Render(const SRendParams& rParam, const SRenderingPassInfo& passInfo);
  28.         virtual IPhysicalEntity* GetPhysics() const;
  29.         virtual void             SetPhysics(IPhysicalEntity*);
  30.         virtual void             SetMaterial(IMaterial* pMat);
  31.         virtual IMaterial*       GetMaterial(Vec3* pHitPos = 0) const;
  32.         virtual IMaterial*       GetMaterialOverride() { return m_pMaterial; }
  33.         virtual float            GetMaxViewDist();
  34.         virtual void             Precache();
  35.         virtual void             GetMemoryUsage(ICrySizer* pSizer) const;
  36.  
  37.         virtual const AABB       GetBBox() const             { return m_WSBBox; }
  38.         virtual void             SetBBox(const AABB& WSBBox) { m_WSBBox = WSBBox; }
  39.         virtual void             FillBBox(AABB& aabb);
  40.         virtual void             OffsetPosition(const Vec3& delta);
  41.  
  42.         virtual uint8            GetSortPriority()           { return m_decalProperties.m_sortPrio; }
  43.  
  44.         virtual void             SetLayerId(uint16 nLayerId) { m_nLayerId = nLayerId; Get3DEngine()->C3DEngine::UpdateObjectsLayerAABB(this); }
  45.         virtual uint16           GetLayerId()                { return m_nLayerId; }
  46.         static void              ResetDecalUpdatesCounter()  { CDecalRenderNode::m_nFillBigDecalIndicesCounter = 0; }
  47.  
  48.         // SetMatrix only supports changing position, this will do the full transform
  49.         void SetMatrixFull(const Matrix34& mat);
  50. public:
  51.         CDecalRenderNode();
  52.         void RequestUpdate() { m_updateRequested = true; DeleteDecals(); }
  53.         void DeleteDecals();
  54.  
  55. private:
  56.         ~CDecalRenderNode();
  57.         void CreateDecals();
  58.         void ProcessUpdateRequest();
  59.         void UpdateAABBFromRenderMeshes();
  60.         bool CheckForceDeferred();
  61.  
  62.         void CreatePlanarDecal();
  63.         void CreateDecalOnStaticObjects();
  64.         void CreateDecalOnTerrain();
  65.  
  66. private:
  67.         Vec3                  m_pos;
  68.         AABB                  m_localBounds;
  69.         _smart_ptr<IMaterial> m_pMaterial;
  70.         bool                  m_updateRequested;
  71.         SDecalProperties      m_decalProperties;
  72.         std::vector<CDecal*>  m_decals;
  73.         AABB                  m_WSBBox;
  74.         Matrix34              m_Matrix;
  75.         uint32                m_nLastRenderedFrameId;
  76.         uint16                m_nLayerId;
  77.         IPhysicalEntity*      m_physEnt;
  78.  
  79. public:
  80.         static int m_nFillBigDecalIndicesCounter;
  81. };
  82.  
  83. #endif // #ifndef _DECAL_RENDERNODE_
  84.  
downloadDecalRenderNode.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