BVB Source Codes

CRYENGINE Show BreakableGlassSystem.h Source code

Return Download CRYENGINE: download BreakableGlassSystem.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef _BREAKABLE_GLASS_SYSTEM_
  4. #define _BREAKABLE_GLASS_SYSTEM_
  5. #pragma once
  6.  
  7. #include <CryEntitySystem/IBreakableGlassSystem.h>
  8.  
  9. // Forward decls
  10. struct IBreakableGlassRenderNode;
  11. struct SBreakableGlassCVars;
  12. struct SBreakableGlassPhysData;
  13.  
  14. //==================================================================================================
  15. // Name: CBreakableGlassSystem
  16. // Desc: Management system for breakable glass nodes
  17. // Authors: Chris Bunner
  18. //==================================================================================================
  19. class CBreakableGlassSystem : public IBreakableGlassSystem
  20. {
  21. public:
  22.         CBreakableGlassSystem();
  23.         virtual ~CBreakableGlassSystem();
  24.  
  25.         static int   HandleImpact(const EventPhys* pPhysEvent);
  26.         static void  OnEnabledCVarChange(ICVar* pCVar);
  27.  
  28.         virtual void Update(const float frameTime);
  29.         virtual bool BreakGlassObject(const EventPhysCollision& physEvent, const bool forceGlassBreak = false);
  30.         virtual void ResetAll();
  31.         virtual void GetMemoryUsage(ICrySizer* pSizer) const;
  32.  
  33. private:
  34.         bool                       ExtractPhysDataFromEvent(const EventPhysCollision& physEvent, SBreakableGlassPhysData& data, SBreakableGlassInitParams& initParams);
  35.  
  36.         bool                       ValidatePhysMesh(mesh_data* pPhysMesh, const int thinAxis);
  37.         bool                       ExtractPhysMesh(mesh_data* pPhysMesh, const int thinAxis, const primitives::box& bbox, TGlassDefFragmentArray& fragOutline);
  38.         void                       MergeFragmentTriangles(mesh_data* pPhysMesh, const int tri, const Vec3& thinRow, TGlassFragmentIndexArray& touchedTris, TGlassFragmentIndexArray& frag);
  39.         void                       ExtractUVCoords(IStatObj* const pStatObj, const primitives::box& bbox, const int thinAxis, SBreakableGlassPhysData& data);
  40.         Vec2                       InterpolateUVCoords(const Vec4& uvPt0, const Vec4& uvPt1, const Vec4& uvPt2, const Vec2& pt);
  41.  
  42.         bool                       ValidateExtractedOutline(SBreakableGlassPhysData& data, SBreakableGlassInitParams& initParams);
  43.         void                       CalculateGlassBounds(const phys_geometry* const pPhysGeom, Vec3& size, Matrix34& matrix);
  44.         void                       CalculateGlassAnchors(SBreakableGlassPhysData& data, SBreakableGlassInitParams& initParams);
  45.         void                       PassImpactToNode(IBreakableGlassRenderNode* pRenderNode, const EventPhysCollision* pPhysEvent);
  46.  
  47.         void                       ModifyEventToForceBreak(EventPhysCollision* pPhysEvent);
  48.         void                       AssertUnusedIfDisabled();
  49.  
  50.         IBreakableGlassRenderNode* InitGlassNode(const SBreakableGlassPhysData& physData, SBreakableGlassInitParams& initParams, const Matrix34& transMat);
  51.         void                       ReleaseGlassNodes();
  52.  
  53.         PodArray<IBreakableGlassRenderNode*> m_glassPlanes;
  54.  
  55.         SBreakableGlassCVars*                m_pGlassCVars;
  56.         bool m_enabled;
  57. };//------------------------------------------------------------------------------------------------
  58.  
  59. #endif // _BREAKABLE_GLASS_SYSTEM_
  60.  
downloadBreakableGlassSystem.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