Emergency 20 Dokumentation  4.2.0
LinkData.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
14 
15 #include <glm/gtc/quaternion.hpp>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class LinkComponent;
24 }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 namespace em5
31 {
32  namespace multiplayer
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Classes ]
38  //[-------------------------------------------------------]
43  class LinkData: public DataCacheComponentExistenceTrackingBase<qsf::LinkComponent>
44  {
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public methods ]
49  //[-------------------------------------------------------]
50  public:
51  LinkData(const qsf::Entity& targetEntity);
52  virtual ~LinkData();
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
57  //[-------------------------------------------------------]
58  public:
59  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
60  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
61  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
62  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
63 
64 
65  //[-------------------------------------------------------]
66  //[ Private data ]
67  //[-------------------------------------------------------]
68  private:
69  uint64 mLinkParentId;
70  bool mLinkParentIdChanged;
71  int8 mLinkType;
72  bool mLinkTypeChanged;
73  glm::vec3 mLocalPosition;
74  bool mLocalPositionChanged;
75  glm::quat mLocalRotation;
76  bool mLocalRotationChanged;
77 
78  struct HistoryEntry
79  {
80  int32 tickCount;
81  uint64 mLinkParentId;
82  bool mLinkParentIdChanged;
83  int8 mLinkType;
84  bool mLinkTypeChanged;
85  glm::vec3 mLocalPosition;
86  bool mLocalPositionChanged;
87  glm::quat mLocalRotation;
88  bool mLocalRotationChanged;
89  };
90 
91  std::vector<HistoryEntry> mHistoryList;
92 
93 
94  };
95 
96 
97 //[-------------------------------------------------------]
98 //[ Namespace ]
99 //[-------------------------------------------------------]
100  } // multiplayer
101 } // em5
Definition: ActionPriority.h:13
signed char int8
Definition: PlatformTypes.h:174
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
uint64_t uint64
Definition: PlatformTypes.h:184
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
Definition: PickupPersonByParamedicAction.h:21
signed int int32
Definition: PlatformTypes.h:180
EMERGENCY 5 multiplayer data cache base class which tracks component existence.
Definition: DataCacheComponentExistenceTrackingBase.h:36