Emergency 20 Dokumentation  4.2.0
MeshAnimationData.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 <qsf/math/Transform.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24  namespace multiplayer
25  {
26 
27 
28  //[-------------------------------------------------------]
29  //[ Classes ]
30  //[-------------------------------------------------------]
35  class MeshAnimationData: public DataCacheComponentExistenceTrackingBase<qsf::MeshAnimationComponent>
36  {
37 
38 
39  //[-------------------------------------------------------]
40  //[ Public methods ]
41  //[-------------------------------------------------------]
42  public:
43  explicit MeshAnimationData(const qsf::Entity& targetEntity);
44  virtual ~MeshAnimationData();
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
49  //[-------------------------------------------------------]
50  public:
51  virtual bool includeForPrepare(const int32 currentTickCount, bool entityIsVisible) override;
52  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
53  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
54  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
55  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
56 
57 
58  //[-------------------------------------------------------]
59  //[ Private methods ]
60  //[-------------------------------------------------------]
61  private:
62  bool checkIfDataHasChanged(const qsf::MeshAnimationComponent::LastAnimatonData& changedAnimationData);
63 
64 
65  //[-------------------------------------------------------]
66  //[ Private data ]
67  //[-------------------------------------------------------]
68  private:
69  struct HistoryEntry
70  {
71  int32 tickCount;
73  };
74 
76  bool mDataChanged;
77  bool mAnimationTypeChanged;
78  bool mBlendSyncChanged;
79  bool mBlendTimeChanged;
80  bool mBoneRetargeting1Changed;
81  bool mBoneRetargeting2Changed;
82  bool mLocalAssetId1Changed;
83  bool mLocalAssetId2Changed;
84  bool mBoneMaskChanged;
85 
86  std::vector<HistoryEntry> mHistoryList;
87 
88 
89  };
90 
91 
92 //[-------------------------------------------------------]
93 //[ Namespace ]
94 //[-------------------------------------------------------]
95  } // multiplayer
96 } // em5
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
MeshAnimationData(const qsf::Entity &targetEntity)
virtual void updateData(qsf::game::BitStream &bitStream, bool force) override
Updates the cache and writes any changed data to the given bit stream.
Clock class.
Definition: Clock.h:33
virtual void setData(const qsf::game::BitStream &bitStream, const int32 receivedHostTickCount) override
Reads the data from the bit stream.
Definition: MeshAnimationComponent.h:110
virtual bool prepareForUpdate(const qsf::Entity &targetEntity, const qsf::Clock &clock) override
Prepares for an update.
EMERGENCY 5 mesh animation data cache for a single entity for multiplayer.
Definition: MeshAnimationData.h:35
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
virtual bool includeForPrepare(const int32 currentTickCount, bool entityIsVisible) override
Returns if the data cache item should be generally included into the current update cycle...
virtual void interpolate(qsf::Entity &targetEntity, const qsf::Clock &clock, const int32 receivedHostTickCount) override
Does any interpolation steps needed to apply the cached data to the entity.
signed int int32
Definition: PlatformTypes.h:180
EMERGENCY 5 multiplayer data cache base class which tracks component existence.
Definition: DataCacheComponentExistenceTrackingBase.h:36