BVB Source Codes

CRYENGINE Show JointBreak.h Source code

Return Download CRYENGINE: download JointBreak.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: simple joint breaks
  8.    -------------------------------------------------------------------------
  9.    History:
  10.    - 22/01/2007   10:34 : Created by Craig Tiller
  11. *************************************************************************/
  12. #ifndef __JOINTBREAK_H__
  13. #define __JOINTBREAK_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.         #include "ExplosiveObjectState.h"
  23.         #include "DebugBreakage.h"
  24.  
  25. struct SJointBreak : public SProceduralBreak
  26. {
  27.         std::vector<SExplosiveObjectState> states;
  28.         AABB                               region;
  29.  
  30.         void GetAffectedRegion(AABB& rgn)
  31.         {
  32.                 rgn = region;
  33.         }
  34.         void AddSendables(INetSendableSink* pSink, int32 brkId);
  35. };
  36.  
  37. struct SJointBreakParams
  38. {
  39.         SJointBreakParams() : breakId(-1) {}
  40.         SJointBreakParams(int bid) : breakId(bid) {}
  41.         int  breakId;
  42.  
  43.         void SerializeWith(TSerialize ser)
  44.         {
  45.                 LOGBREAK("SJointBreakParams, %s", ser.IsReading() ? "Reading:" : "Writing");
  46.                 ser.Value("breakId", breakId, 'brId');
  47.         }
  48. };
  49.  
  50. class CJointBreak : public IProceduralBreakType
  51. {
  52. public:
  53.         CJointBreak();
  54.         CJointBreak(IPhysicalEntity* pEnt);
  55.  
  56.         bool                         AttemptAbsorb(const IProceduralBreakTypePtr& pBT);
  57.         void                         AbsorbStep() {}
  58.         int                          GetVirtualId(IPhysicalEntity* pEnt);
  59.         CObjectSelector              GetObjectSelector(int idx);
  60.         _smart_ptr<SProceduralBreak> CompleteSend();
  61.         bool                         GotExplosiveObjectState(const SExplosiveObjectState* pState);
  62.         void                         PreparePlayback();
  63.         void                         BeginPlayback(bool hasJointBreaks);
  64.         const char*                  GetName() { return "JointBreak"; }
  65.         void                         PatchRecording(DynArray<SProceduralSpawnRec>& spawnRecs, DynArray<SJointBreakRec>& jointBreaks);
  66.  
  67.         bool                         AllowComplete(const SProceduralBreakRecordingState& state);
  68.  
  69. private:
  70.         AABB                   m_rgn;
  71.         typedef std::vector<SExplosiveObjectState> TExplosiveObjectStates;
  72.         TExplosiveObjectStates m_states;
  73. };
  74.  
  75. #endif // !NET_USE_SIMPLE_BREAKAGE
  76.  
  77. #endif
  78.  
downloadJointBreak.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