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
12class AddActorPacket;
16class Vec2;
17class Vec3;
19// clang-format on
20
21class PredictedMovementComponent {
22public:
23 // PredictedMovementComponent inner types declare
24 // clang-format off
26 struct HistoryItem;
28 struct PredictionDbgData;
30 class HistoryCache;
31 struct MotionHistoryItem;
32 struct MoveHistoryItem;
33 // clang-format on
34
35 // PredictedMovementComponent inner types define
36 struct HistoryTimestampData {
37 public:
38 // member variables
39 // NOLINTBEGIN
43 // NOLINTEND
44
45 public:
46 // prevent constructor by default
47 HistoryTimestampData& operator=(HistoryTimestampData const&);
48 HistoryTimestampData(HistoryTimestampData const&);
49 HistoryTimestampData();
50
51 public:
52 // static variables
53 // NOLINTBEGIN
54 MCAPI static uint& mSequenceIdGenerator();
55 // NOLINTEND
56 };
57
58 struct HistoryItem {
59 public:
60 // HistoryItem inner types define
61 enum class ItemType : int {
62 Motion = 0,
63 Move = 1,
64 Max = 2,
65 };
66
67 public:
68 // member variables
69 // NOLINTBEGIN
73 // NOLINTEND
74
75 public:
76 // prevent constructor by default
77 HistoryItem& operator=(HistoryItem const&);
78 HistoryItem(HistoryItem const&);
79 HistoryItem();
80
81 public:
82 // virtual functions
83 // NOLINTBEGIN
84 virtual ~HistoryItem() = default;
85
86 virtual bool isValidStartItem() const = 0;
87
88 virtual bool isAddedActorItem() const = 0;
89
90 virtual bool isMotionHintItem() const = 0;
91
92 virtual ::std::string toString() const;
93
94 virtual ::Vec3 const& getPos() const = 0;
95
96 virtual ::Vec2 const& getRot() const = 0;
97
98 virtual float getYHeadRot() const = 0;
99
100 virtual bool isOnGround() const = 0;
101 // NOLINTEND
102
103 public:
104 // virtual function thunks
105 // NOLINTBEGIN
106 MCAPI ::std::string $toString() const;
107
108
109 // NOLINTEND
110 };
111
112 struct PredictionDbgWindowData {
113 public:
114 // member variables
115 // NOLINTBEGIN
127 // NOLINTEND
128
129 public:
130 // prevent constructor by default
131 PredictionDbgWindowData& operator=(PredictionDbgWindowData const&);
132 PredictionDbgWindowData(PredictionDbgWindowData const&);
133 PredictionDbgWindowData();
134 };
135
136 struct PredictionDbgData {
137 public:
138 // member variables
139 // NOLINTBEGIN
146 // NOLINTEND
147
148 public:
149 // prevent constructor by default
150 PredictionDbgData& operator=(PredictionDbgData const&);
151 PredictionDbgData(PredictionDbgData const&);
152 PredictionDbgData();
153 };
154
155 struct RuntimePredictionData {
156 public:
157 // RuntimePredictionData inner types declare
158 // clang-format off
159 struct LerpedInterval;
160 // clang-format on
161
162 // RuntimePredictionData inner types define
163 struct LerpedInterval {
164 public:
165 // member variables
166 // NOLINTBEGIN
171 // NOLINTEND
172
173 public:
174 // prevent constructor by default
175 LerpedInterval& operator=(LerpedInterval const&);
176 LerpedInterval(LerpedInterval const&);
177 LerpedInterval();
178 };
179
180 public:
181 // member variables
182 // NOLINTBEGIN
194 // NOLINTEND
195
196 public:
197 // prevent constructor by default
198 RuntimePredictionData& operator=(RuntimePredictionData const&);
199 RuntimePredictionData(RuntimePredictionData const&);
200 RuntimePredictionData();
201
202 public:
203 // virtual functions
204 // NOLINTBEGIN
205 virtual ~RuntimePredictionData() = default;
206 // NOLINTEND
207
208 public:
209 // member functions
210 // NOLINTBEGIN
211 MCAPI void reset();
212 // NOLINTEND
213
214 public:
215 // vftables
216 // NOLINTBEGIN
217 MCNAPI static void** $vftable();
218 // NOLINTEND
219 };
220
221 class HistoryCache {
222 public:
223 // member variables
224 // NOLINTBEGIN
229 // NOLINTEND
230
231 public:
232 // prevent constructor by default
233 HistoryCache& operator=(HistoryCache const&);
234 HistoryCache(HistoryCache const&);
235 HistoryCache();
236
237 public:
238 // member functions
239 // NOLINTBEGIN
240#ifdef LL_PLAT_C
241 MCAPI void _addHistoryItem(::std::shared_ptr<::PredictedMovementComponent::HistoryItem const> const& item);
242#endif
243
244 MCAPI void _clearHistory();
245
246#ifdef LL_PLAT_C
247 MCAPI void
248 addHistory(::AddActorPacket const& actorData, ::std::chrono::steady_clock::time_point const& receiveTimepoint);
249
250 MCAPI void addHistory(
251 ::SetActorMotionPacket const& motionData,
252 ::std::chrono::steady_clock::time_point const& receiveTimepoint
253 );
254
255 MCAPI void addHistory(
256 ::MotionPredictionHintsPacket const& motionPredictionHints,
257 ::std::chrono::steady_clock::time_point const& receiveTimepoint
258 );
259#endif
260
261 MCAPI void addHistory(
262 ::MoveActorAbsoluteData const& moveData,
263 ::std::chrono::steady_clock::time_point const& receiveTimepoint
264 );
265 // NOLINTEND
266 };
267
268 struct MotionHistoryItem : public ::PredictedMovementComponent::HistoryItem {
269 public:
270 // member variables
271 // NOLINTBEGIN
281 // NOLINTEND
282
283 public:
284 // prevent constructor by default
285 MotionHistoryItem& operator=(MotionHistoryItem const&);
286 MotionHistoryItem(MotionHistoryItem const&);
287 MotionHistoryItem();
288
289 public:
290 // virtual functions
291 // NOLINTBEGIN
292 virtual bool isValidStartItem() const /*override*/;
293
294 virtual bool isAddedActorItem() const /*override*/;
295
296 virtual bool isMotionHintItem() const /*override*/;
297
298 virtual ::Vec3 const& getPos() const /*override*/;
299
300 virtual ::Vec2 const& getRot() const /*override*/;
301
302 virtual float getYHeadRot() const /*override*/;
303
304 virtual bool isOnGround() const /*override*/;
305 // NOLINTEND
306
307 public:
308 // member functions
309 // NOLINTBEGIN
310#ifdef LL_PLAT_C
311 MCAPI MotionHistoryItem(
312 ::Vec3 const& motion,
313 bool onGround,
314 bool isMotionHintItem,
315 ::std::chrono::steady_clock::time_point const& timepoint,
316 ::std::shared_ptr<::PredictedMovementComponent::MoveHistoryItem const> const& prevMoveItem,
317 ::std::shared_ptr<::PredictedMovementComponent::MotionHistoryItem const> const& prevMotionItem,
318 bool didAdjustTimepoint,
319 ::std::chrono::milliseconds const& timepointDiff
320 );
321#endif
322 // NOLINTEND
323
324 public:
325 // constructor thunks
326 // NOLINTBEGIN
327#ifdef LL_PLAT_C
328 MCAPI void* $ctor(
329 ::Vec3 const& motion,
330 bool onGround,
331 bool isMotionHintItem,
332 ::std::chrono::steady_clock::time_point const& timepoint,
333 ::std::shared_ptr<::PredictedMovementComponent::MoveHistoryItem const> const& prevMoveItem,
334 ::std::shared_ptr<::PredictedMovementComponent::MotionHistoryItem const> const& prevMotionItem,
335 bool didAdjustTimepoint,
336 ::std::chrono::milliseconds const& timepointDiff
337 );
338#endif
339 // NOLINTEND
340
341 public:
342 // virtual function thunks
343 // NOLINTBEGIN
344#ifdef LL_PLAT_C
345 MCFOLD bool $isValidStartItem() const;
346
347 MCAPI bool $isAddedActorItem() const;
348
349 MCAPI bool $isMotionHintItem() const;
350
351 MCAPI ::Vec3 const& $getPos() const;
352
353 MCFOLD ::Vec2 const& $getRot() const;
354
355 MCAPI float $getYHeadRot() const;
356
357 MCFOLD bool $isOnGround() const;
358#endif
359
360
361 // NOLINTEND
362 };
363
364 struct MoveHistoryItem : public ::PredictedMovementComponent::HistoryItem {
365 public:
366 // member variables
367 // NOLINTBEGIN
373 // NOLINTEND
374
375 public:
376 // prevent constructor by default
377 MoveHistoryItem& operator=(MoveHistoryItem const&);
378 MoveHistoryItem(MoveHistoryItem const&);
379 MoveHistoryItem();
380
381 public:
382 // virtual functions
383 // NOLINTBEGIN
384 virtual bool isValidStartItem() const /*override*/;
385
386 virtual bool isAddedActorItem() const /*override*/;
387
388 virtual bool isMotionHintItem() const /*override*/;
389
390 virtual ::Vec3 const& getPos() const /*override*/;
391
392 virtual ::Vec2 const& getRot() const /*override*/;
393
394 virtual float getYHeadRot() const /*override*/;
395
396 virtual bool isOnGround() const /*override*/;
397 // NOLINTEND
398
399 public:
400 // virtual function thunks
401 // NOLINTBEGIN
402 MCFOLD bool $isValidStartItem() const;
403
404 MCFOLD bool $isAddedActorItem() const;
405
406 MCFOLD bool $isMotionHintItem() const;
407
408 MCFOLD ::Vec3 const& $getPos() const;
409
410 MCAPI ::Vec2 const& $getRot() const;
411
412 MCAPI float $getYHeadRot() const;
413
414 MCFOLD bool $isOnGround() const;
415
416
417 // NOLINTEND
418 };
419
421
423
425
426 using PredictionEventsListenerFunction = ::std::function<void(::MovePredictionType)>;
427
428public:
429 // member variables
430 // NOLINTBEGIN
431 ::ll::TypedStorage<1, 1, ::brstd::bitset<2, uchar>> mDisableConditions;
432 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData>>
433 mRuntimePredictionData;
434 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PredictedMovementComponent::HistoryItem const>> mLastStartItem;
435 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PredictedMovementComponent::HistoryItem const>> mLastEndItem;
436 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PredictedMovementComponent::HistoryCache>> mHistoryCache;
437 ::ll::TypedStorage<1, 1, bool> mForceTeleportAfterResuming;
438 ::ll::TypedStorage<1, 1, bool> mAllowTeleportingWithoutRegion;
439 ::ll::TypedStorage<4, 4, uint> mLastCompletedInterpolationSequenceID;
440 ::ll::TypedStorage<8, 64, ::std::function<void(::MovePredictionType)>> mPredictionEventsListenerFunc;
441 ::ll::TypedStorage<8, 16, ::PredictedMovementValues> mPredictedMovementValues;
442 // NOLINTEND
443
444public:
445 // member functions
446 // NOLINTBEGIN
447 MCAPI PredictedMovementComponent();
448
449 MCAPI void _debugLog(
452 ) const;
453
454 MCAPI void reset();
455
456 MCAPI void
457 tickNextPosition(::PredictedMovementSystemParams& params, ::std::chrono::steady_clock::time_point const& timepoint);
458
459 MCAPI ~PredictedMovementComponent();
460 // NOLINTEND
461
462public:
463 // static variables
464 // NOLINTBEGIN
465 MCAPI static ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData>& mGlobalRuntimePredictionData();
466 // NOLINTEND
467
468public:
469 // constructor thunks
470 // NOLINTBEGIN
471 MCAPI void* $ctor();
472 // NOLINTEND
473
474public:
475 // destructor thunk
476 // NOLINTBEGIN
477 MCAPI void $dtor();
478 // NOLINTEND
479};
Definition AddActorPacket.h:20
Definition MotionPredictionHintsPacket.h:19
Definition MoveActorAbsoluteData.h:14
Definition PredictedMovementComponent.h:221
Definition SetActorMotionPacket.h:19
Definition Vec2.h:5
Definition Vec3.h:10
Definition PredictedMovementComponent.h:58
Definition PredictedMovementComponent.h:36
Definition PredictedMovementComponent.h:268
Definition PredictedMovementComponent.h:364
Definition PredictedMovementComponent.h:136
Definition PredictedMovementComponent.h:112
Definition PredictedMovementComponent.h:155
Definition PredictedMovementSystemParams.h:5
Definition Alias.h:14