Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
PredictedMovementComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/entity/components/MovePredictionType.h"
7#include "mc/entity/components/PredictedMovementValues.h"
8#include "mc/platform/brstd/bitset.h"
9
10// auto generated forward declare list
11// clang-format off
13class Vec2;
14class Vec3;
16// clang-format on
17
19public:
20 // PredictedMovementComponent inner types declare
21 // clang-format off
23 struct HistoryItem;
25 struct PredictionDbgData;
27 class HistoryCache;
28 struct MotionHistoryItem;
29 struct MoveHistoryItem;
30 // clang-format on
31
32 // PredictedMovementComponent inner types define
33 struct HistoryTimestampData {
34 public:
35 // member variables
36 // NOLINTBEGIN
40 // NOLINTEND
41
42 public:
43 // prevent constructor by default
44 HistoryTimestampData& operator=(HistoryTimestampData const&);
45 HistoryTimestampData(HistoryTimestampData const&);
46 HistoryTimestampData();
47
48 public:
49 // static variables
50 // NOLINTBEGIN
51 MCNAPI static uint& mSequenceIdGenerator();
52 // NOLINTEND
53 };
54
55 struct HistoryItem {
56 public:
57 // HistoryItem inner types define
58 enum class ItemType : int {
59 Motion = 0,
60 Move = 1,
61 Max = 2,
62 };
63
64 public:
65 // member variables
66 // NOLINTBEGIN
70 // NOLINTEND
71
72 public:
73 // prevent constructor by default
74 HistoryItem& operator=(HistoryItem const&);
75 HistoryItem(HistoryItem const&);
76 HistoryItem();
77
78 public:
79 // virtual functions
80 // NOLINTBEGIN
81 virtual ~HistoryItem() = default;
82
83 virtual bool isValidStartItem() const = 0;
84
85 virtual bool isAddedActorItem() const = 0;
86
87 virtual bool isMotionHintItem() const = 0;
88
89 virtual ::std::string toString() const;
90
91 virtual ::Vec3 const& getPos() const = 0;
92
93 virtual ::Vec2 const& getRot() const = 0;
94
95 virtual float getYHeadRot() const = 0;
96
97 virtual bool isOnGround() const = 0;
98 // NOLINTEND
99
100 public:
101 // virtual function thunks
102 // NOLINTBEGIN
103 MCNAPI ::std::string $toString() const;
104
105
106 // NOLINTEND
107 };
108
109 struct PredictionDbgWindowData {
110 public:
111 // member variables
112 // NOLINTBEGIN
124 // NOLINTEND
125
126 public:
127 // prevent constructor by default
128 PredictionDbgWindowData& operator=(PredictionDbgWindowData const&);
129 PredictionDbgWindowData(PredictionDbgWindowData const&);
130 PredictionDbgWindowData();
131 };
132
133 struct PredictionDbgData {
134 public:
135 // member variables
136 // NOLINTBEGIN
143 // NOLINTEND
144
145 public:
146 // prevent constructor by default
147 PredictionDbgData& operator=(PredictionDbgData const&);
148 PredictionDbgData(PredictionDbgData const&);
149 PredictionDbgData();
150 };
151
152 struct RuntimePredictionData {
153 public:
154 // RuntimePredictionData inner types declare
155 // clang-format off
156 struct LerpedInterval;
157 // clang-format on
158
159 // RuntimePredictionData inner types define
160 struct LerpedInterval {
161 public:
162 // member variables
163 // NOLINTBEGIN
168 // NOLINTEND
169
170 public:
171 // prevent constructor by default
172 LerpedInterval& operator=(LerpedInterval const&);
173 LerpedInterval(LerpedInterval const&);
174 LerpedInterval();
175 };
176
177 public:
178 // member variables
179 // NOLINTBEGIN
191 // NOLINTEND
192
193 public:
194 // prevent constructor by default
195 RuntimePredictionData& operator=(RuntimePredictionData const&);
196 RuntimePredictionData(RuntimePredictionData const&);
197 RuntimePredictionData();
198
199 public:
200 // virtual functions
201 // NOLINTBEGIN
202 virtual ~RuntimePredictionData() = default;
203 // NOLINTEND
204
205 public:
206 // member functions
207 // NOLINTBEGIN
208 MCNAPI void reset();
209 // NOLINTEND
210
211 public:
212 // vftables
213 // NOLINTBEGIN
214 MCNAPI static void** $vftable();
215 // NOLINTEND
216 };
217
218 class HistoryCache {
219 public:
220 // member variables
221 // NOLINTBEGIN
226 // NOLINTEND
227
228 public:
229 // prevent constructor by default
230 HistoryCache& operator=(HistoryCache const&);
231 HistoryCache(HistoryCache const&);
232 HistoryCache();
233
234 public:
235 // member functions
236 // NOLINTBEGIN
237 MCNAPI void _clearHistory();
238
239 MCNAPI void addHistory(
240 ::MoveActorAbsoluteData const& moveData,
241 ::std::chrono::steady_clock::time_point const& receiveTimepoint
242 );
243 // NOLINTEND
244 };
245
246 struct MotionHistoryItem : public ::PredictedMovementComponent::HistoryItem {
247 public:
248 // member variables
249 // NOLINTBEGIN
259 // NOLINTEND
260
261 public:
262 // prevent constructor by default
263 MotionHistoryItem& operator=(MotionHistoryItem const&);
264 MotionHistoryItem(MotionHistoryItem const&);
265 MotionHistoryItem();
266
267 public:
268 // virtual functions
269 // NOLINTBEGIN
270 virtual bool isValidStartItem() const /*override*/;
271
272 virtual bool isAddedActorItem() const /*override*/;
273
274 virtual bool isMotionHintItem() const /*override*/;
275
276 virtual ::Vec3 const& getPos() const /*override*/;
277
278 virtual ::Vec2 const& getRot() const /*override*/;
279
280 virtual float getYHeadRot() const /*override*/;
281
282 virtual bool isOnGround() const /*override*/;
283 // NOLINTEND
284 };
285
286 struct MoveHistoryItem : public ::PredictedMovementComponent::HistoryItem {
287 public:
288 // member variables
289 // NOLINTBEGIN
295 // NOLINTEND
296
297 public:
298 // prevent constructor by default
299 MoveHistoryItem& operator=(MoveHistoryItem const&);
300 MoveHistoryItem(MoveHistoryItem const&);
301 MoveHistoryItem();
302
303 public:
304 // virtual functions
305 // NOLINTBEGIN
306 virtual bool isValidStartItem() const /*override*/;
307
308 virtual bool isAddedActorItem() const /*override*/;
309
310 virtual bool isMotionHintItem() const /*override*/;
311
312 virtual ::Vec3 const& getPos() const /*override*/;
313
314 virtual ::Vec2 const& getRot() const /*override*/;
315
316 virtual float getYHeadRot() const /*override*/;
317
318 virtual bool isOnGround() const /*override*/;
319 // NOLINTEND
320
321 public:
322 // virtual function thunks
323 // NOLINTBEGIN
324 MCNAPI bool $isValidStartItem() const;
325
326 MCNAPI bool $isAddedActorItem() const;
327
328 MCNAPI bool $isMotionHintItem() const;
329
330 MCNAPI ::Vec3 const& $getPos() const;
331
332 MCNAPI ::Vec2 const& $getRot() const;
333
334 MCNAPI float $getYHeadRot() const;
335
336 MCNAPI bool $isOnGround() const;
337
338
339 // NOLINTEND
340 };
341
343
345
347
348 using PredictionEventsListenerFunction = ::std::function<void(::MovePredictionType)>;
349
350public:
351 // member variables
352 // NOLINTBEGIN
353 ::ll::TypedStorage<1, 1, ::brstd::bitset<2, uchar>> mDisableConditions;
354 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData>>
355 mRuntimePredictionData;
356 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PredictedMovementComponent::HistoryItem const>> mLastStartItem;
357 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PredictedMovementComponent::HistoryItem const>> mLastEndItem;
358 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PredictedMovementComponent::HistoryCache>> mHistoryCache;
359 ::ll::TypedStorage<1, 1, bool> mForceTeleportAfterResuming;
360 ::ll::TypedStorage<1, 1, bool> mAllowTeleportingWithoutRegion;
361 ::ll::TypedStorage<4, 4, uint> mLastCompletedInterpolationSequenceID;
362 ::ll::TypedStorage<8, 64, ::std::function<void(::MovePredictionType)>> mPredictionEventsListenerFunc;
363 ::ll::TypedStorage<8, 16, ::PredictedMovementValues> mPredictedMovementValues;
364 // NOLINTEND
365
366public:
367 // member functions
368 // NOLINTBEGIN
370
371 MCNAPI void _debugLog(
374 ) const;
375
376 MCNAPI void reset();
377
378 MCNAPI void
379 tickNextPosition(::PredictedMovementSystemParams& params, ::std::chrono::steady_clock::time_point const& timepoint);
380
382 // NOLINTEND
383
384public:
385 // static variables
386 // NOLINTBEGIN
387 MCNAPI static ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData>&
389 // NOLINTEND
390
391public:
392 // constructor thunks
393 // NOLINTBEGIN
394 MCNAPI void* $ctor();
395 // NOLINTEND
396
397public:
398 // destructor thunk
399 // NOLINTBEGIN
400 MCNAPI void $dtor();
401 // NOLINTEND
402};
Definition MoveActorAbsoluteData.h:14
Definition PredictedMovementComponent.h:218
MCAPI void addHistory(::MoveActorAbsoluteData const &moveData, ::std::chrono::steady_clock::time_point const &receiveTimepoint)
MCAPI void _debugLog(::PredictedMovementSystemParams &params, ::PredictedMovementComponent::PredictionDbgData const &debugData) const
static MCAPI ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData > & mGlobalRuntimePredictionData()
MCAPI void tickNextPosition(::PredictedMovementSystemParams &params, ::std::chrono::steady_clock::time_point const &timepoint)
Definition Vec2.h:5
Definition Vec3.h:10
Definition PredictedMovementComponent.h:55
MCAPI::std::string $toString() const
Definition PredictedMovementComponent.h:33
Definition PredictedMovementComponent.h:246
Definition PredictedMovementComponent.h:286
MCAPI::Vec2 const & $getRot() const
MCAPI::Vec3 const & $getPos() const
Definition PredictedMovementComponent.h:133
Definition PredictedMovementComponent.h:109
Definition PredictedMovementComponent.h:152
Definition PredictedMovementSystemParams.h:5
Definition Alias.h:14