BVB Source Codes

CRYENGINE Show PhysicsSync.h Source code

Return Download CRYENGINE: download PhysicsSync.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __PHYSICSSYNC_H__
  4. #define __PHYSICSSYNC_H__
  5.  
  6. #pragma once
  7.  
  8. #include <CryCore/Containers/MiniQueue.h>
  9.  
  10. struct IPhysicalWorld;
  11. class CGameChannel;
  12. struct IDebugHistory;
  13. struct IDebugHistoryManager;
  14.  
  15. class CPhysicsSync
  16. {
  17. public:
  18.         CPhysicsSync(CGameChannel* pParent);
  19.         ~CPhysicsSync();
  20.  
  21.         bool OnPacketHeader(CTimeValue);
  22.         bool       OnPacketFooter();
  23.  
  24.         CTimeValue GetTime();
  25.         void SetTime(CTimeValue);
  26.  
  27.         void UpdatedEntity(EntityId id)
  28.         {
  29.                 m_updatedEntities.push_back(id);
  30.         }
  31.  
  32.         bool IgnoreSnapshot() const { return false && m_ignoreSnapshot; }
  33.         bool NeedToCatchup() const  { return m_catchup; }
  34.  
  35. private:
  36.         void OutputDebug(float deltaPhys, float deltaPing, float averagePing, float ping, float stepForward, float deltaTimestamp);
  37.  
  38.         CGameChannel*    m_pParent;
  39.         IPhysicalWorld*  m_pWorld;
  40.  
  41.         static const int MAX_PING_SAMPLES = 128;
  42.         struct SPastPing
  43.         {
  44.                 CTimeValue when;
  45.                 float      value;
  46.         };
  47.         typedef MiniQueue<SPastPing, MAX_PING_SAMPLES> PingQueue;
  48.         PingQueue m_pastPings;
  49.  
  50.         class CDebugTimeline;
  51.         std::unique_ptr<CDebugTimeline> m_pDBTL;
  52.  
  53.         CTimeValue                      m_physPrevRemoteTime;
  54.         CTimeValue                      m_pingEstimate;
  55.         CTimeValue                      m_physEstimatedLocalLaggedTime;
  56.         CTimeValue                      m_epochWhen;
  57.         int                             m_physEpochTimestamp;
  58.  
  59.         bool                            m_ignoreSnapshot;
  60.         bool                            m_catchup;
  61.         IDebugHistoryManager*           m_pDebugHistory;
  62.         std::vector<IDebugHistory*>     m_vpHistories;
  63.  
  64.         std::vector<EntityId>           m_updatedEntities;
  65.         std::vector<IPhysicalEntity*>   m_clearEntities;
  66. };
  67.  
  68. #endif
  69.  
downloadPhysicsSync.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