BVB Source Codes

CRYENGINE Show DelayedPlaneBreak.cpp Source code

Return Download CRYENGINE: download DelayedPlaneBreak.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 "CryAction.h"
  5. #include "IGameRulesSystem.h"
  6. #include "ActionGame.h"
  7. #include "DelayedPlaneBreak.h"
  8. #include <CryParticleSystem/ParticleParams.h>
  9. #include <CryEntitySystem/IBreakableManager.h>
  10.  
  11. #include <CryThreading/IJobManager_JobDelegator.h>
  12.  
  13. DECLARE_JOB("DelayedPlaneBreak", TDelayedPlaneBreak, CDelayedPlaneBreak::Execute);
  14.  
  15. void CDelayedPlaneBreak::ExecuteAsJob()
  16. {
  17.         TDelayedPlaneBreak job;
  18.         job.SetClassInstance(this);
  19.         job.RegisterJobState(&m_jobState);
  20.         job.SetPriorityLevel(JobManager::eRegularPriority);
  21.         job.SetBlocking();
  22.         job.Run();
  23. }
  24. void CDelayedPlaneBreak::Execute()
  25. {
  26.         m_islandIn.bCreateIsle = (m_islandIn.processFlags & ePlaneBreak_AutoSmash) == 0;
  27.         if (!m_bMeshPrepOnly)
  28.                 gEnv->pEntitySystem->GetBreakableManager()->ExtractPlaneMeshIsland(m_islandIn, m_islandOut);
  29.         else
  30.         {
  31.                 m_islandOut.pStatObj = m_islandIn.pStatObj;
  32.                 m_islandOut.pStatObj->GetIndexedMesh(true);
  33.         }
  34.  
  35.         // cppcheck-suppress thisSubtraction
  36.         CDelayedPlaneBreak* pdpb = this - m_idx;
  37.         if (!(m_islandIn.pStatObj->GetFlags() & STATIC_OBJECT_CLONE) &&
  38.             (m_islandOut.pStatObj->GetFlags() & STATIC_OBJECT_CLONE))
  39.                 for (int i = 0; i < m_count; ++i)
  40.                         if (pdpb[i].m_status != eStatus_NONE &&
  41.                             i != m_idx &&
  42.                             pdpb[i].m_islandOut.pStatObj == m_islandIn.pStatObj &&
  43.                             pdpb[i].m_epc.pEntity[1] == m_epc.pEntity[1] &&
  44.                             pdpb[i].m_epc.partid[1] == m_epc.partid[1])
  45.                         {
  46.                                 IStatObj* oldSrc = pdpb[i].m_islandIn.pStatObj;
  47.                                 pdpb[i].m_islandIn.pStatObj = m_islandOut.pStatObj;
  48.                                 pdpb[i].m_islandOut.pStatObj = m_islandOut.pStatObj;
  49.                                 m_islandOut.pStatObj->AddRef();
  50.                                 oldSrc->Release();
  51.                         }
  52.         m_status = eStatus_DONE;
  53. }
  54.  
downloadDelayedPlaneBreak.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