BVB Source Codes

CRYENGINE Show PlaneBreak.h Source code

Return Download CRYENGINE: download PlaneBreak.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description:  network breakability: 2d plane breaks
  8.    -------------------------------------------------------------------------
  9.    History:
  10.    - 13/08/2007   10:34 : Created by Craig Tiller
  11. *************************************************************************/
  12. #ifndef __PLANEBREAK_H__
  13. #define __PLANEBREAK_H__
  14.  
  15. #pragma once
  16.  
  17. #if !NET_USE_SIMPLE_BREAKAGE
  18.  
  19.         #include "ProceduralBreak.h"
  20.         #include "ActionGame.h"
  21.         #include "IProceduralBreakType.h"
  22.  
  23. struct SPlaneBreakParams
  24. {
  25.         SPlaneBreakParams() : breakId(-1) {}
  26.         SPlaneBreakParams(int bid, const SBreakEvent& bev) : breakId(bid), breakEvent(bev) {}
  27.         int         breakId;
  28.         SBreakEvent breakEvent;
  29.  
  30.         void        SerializeWith(TSerialize ser);
  31. };
  32.  
  33. struct SPlaneBreak : public SProceduralBreak
  34. {
  35.         DynArray<SBreakEvent> breakEvents;
  36.  
  37.         virtual void GetAffectedRegion(AABB& pos);
  38.         virtual void AddSendables(INetSendableSink* pSink, int32 brkId);
  39. };
  40.  
  41. class CPlaneBreak : public IProceduralBreakType
  42. {
  43. public:
  44.         CPlaneBreak(const SBreakEvent& be);
  45.  
  46.         bool                         AttemptAbsorb(const IProceduralBreakTypePtr& pBT);
  47.         void                         AbsorbStep();
  48.         int                          GetVirtualId(IPhysicalEntity* pEnt);
  49.         CObjectSelector              GetObjectSelector(int idx);
  50.         _smart_ptr<SProceduralBreak> CompleteSend();
  51.         bool                         GotExplosiveObjectState(const SExplosiveObjectState* pState);
  52.         void                         PreparePlayback();
  53.         void                         BeginPlayback(bool hasJointBreaks);
  54.         const char*                  GetName()                                                                                       { return "PlaneBreak"; }
  55.         void                         PatchRecording(DynArray<SProceduralSpawnRec>& spawnRecs, DynArray<SJointBreakRec>& jointBreaks) {}
  56.  
  57.         virtual bool                 AllowComplete(const SProceduralBreakRecordingState& state);
  58.  
  59.         virtual bool                 SendOnlyOnClientJoin() { assert(m_bes.size() > 0); return m_bes[0].bFirstBreak == 0; }
  60.  
  61. private:
  62.         DynArray<SBreakEvent> m_bes;
  63.         IPhysicalEntity*      m_pPhysEnt;
  64.         int                   m_absorbIdx;
  65.  
  66.         void PreparePlaybackForEvent(int event);
  67.  
  68.         void PrepareSlot(int idx);
  69.  
  70.         bool IsOurStatObj(IRenderNode* rn)
  71.         {
  72.                 if (m_bes[0].itype == PHYS_FOREIGN_ID_STATIC)
  73.                         return m_bes[0].hash == CObjectSelector::CalculateHash(rn);
  74.                 else
  75.                         return false;
  76.         }
  77.  
  78.         const EventPhysCollision& GeneratePhysicsEvent(const SBreakEvent& bev);
  79. };
  80.  
  81. #endif // !NET_USE_SIMPLE_BREAKAGE
  82.  
  83. #endif
  84.  
downloadPlaneBreak.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