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
8// auto generated forward declare list
9// clang-format off
11class Vec2;
12class Vec3;
15// clang-format on
16
18public:
19 // PredictedMovementComponent inner types declare
20 // clang-format off
21 class HistoryCache;
22 struct HistoryItem;
24 struct MotionHistoryItem;
25 struct MoveHistoryItem;
26 struct PredictionDbgData;
29 // clang-format on
30
31 // PredictedMovementComponent inner types define
32 struct HistoryItem {
33 public:
34 // HistoryItem inner types define
35 enum class ItemType : int {
36 Motion = 0,
37 Move = 1,
38 Max = 2,
39 };
40
41 public:
42 // member variables
43 // NOLINTBEGIN
47 // NOLINTEND
48
49 public:
50 // prevent constructor by default
51 HistoryItem& operator=(HistoryItem const&);
54
55 public:
56 // virtual functions
57 // NOLINTBEGIN
58 // vIndex: 0
59 virtual ~HistoryItem() = default;
60
61 // vIndex: 1
62 virtual bool isValidStartItem() const = 0;
63
64 // vIndex: 2
65 virtual bool isAddedActorItem() const = 0;
66
67 // vIndex: 3
68 virtual bool isMotionHintItem() const = 0;
69
70 // vIndex: 4
71 virtual ::std::string toString() const;
72
73 // vIndex: 5
74 virtual ::Vec3 const& getPos() const = 0;
75
76 // vIndex: 6
77 virtual ::Vec2 const& getRot() const = 0;
78
79 // vIndex: 7
80 virtual float getYHeadRot() const = 0;
81
82 // vIndex: 8
83 virtual bool isOnGround() const = 0;
84 // NOLINTEND
85
86 public:
87 // destructor thunk
88 // NOLINTBEGIN
89
90 // NOLINTEND
91
92 public:
93 // virtual function thunks
94 // NOLINTBEGIN
95 MCAPI ::std::string $toString() const;
96 // NOLINTEND
97
98 public:
99 // vftables
100 // NOLINTBEGIN
101 MCAPI static void** $vftable();
102 // NOLINTEND
103 };
104
106 public:
107 // member variables
108 // NOLINTBEGIN
114 // NOLINTEND
115
116 public:
117 // prevent constructor by default
118 MoveHistoryItem& operator=(MoveHistoryItem const&);
121
122 public:
123 // virtual functions
124 // NOLINTBEGIN
125 // vIndex: 1
126 virtual bool isValidStartItem() const /*override*/;
127
128 // vIndex: 2
129 virtual bool isAddedActorItem() const /*override*/;
130
131 // vIndex: 3
132 virtual bool isMotionHintItem() const /*override*/;
133
134 // vIndex: 5
135 virtual ::Vec3 const& getPos() const /*override*/;
136
137 // vIndex: 6
138 virtual ::Vec2 const& getRot() const /*override*/;
139
140 // vIndex: 7
141 virtual float getYHeadRot() const /*override*/;
142
143 // vIndex: 8
144 virtual bool isOnGround() const /*override*/;
145
146 // vIndex: 0
147 virtual ~MoveHistoryItem() /*override*/ = default;
148 // NOLINTEND
149
150 public:
151 // destructor thunk
152 // NOLINTBEGIN
153
154 // NOLINTEND
155
156 public:
157 // virtual function thunks
158 // NOLINTBEGIN
159 MCFOLD bool $isValidStartItem() const;
160
161 MCFOLD bool $isAddedActorItem() const;
162
163 MCFOLD bool $isMotionHintItem() const;
164
165 MCFOLD ::Vec3 const& $getPos() const;
166
167 MCAPI ::Vec2 const& $getRot() const;
168
169 MCAPI float $getYHeadRot() const;
170
171 MCFOLD bool $isOnGround() const;
172 // NOLINTEND
173
174 public:
175 // vftables
176 // NOLINTBEGIN
177 MCAPI static void** $vftable();
178 // NOLINTEND
179 };
180
182 public:
183 // member variables
184 // NOLINTBEGIN
194 // NOLINTEND
195
196 public:
197 // prevent constructor by default
198 MotionHistoryItem& operator=(MotionHistoryItem const&);
201
202 public:
203 // virtual functions
204 // NOLINTBEGIN
205 // vIndex: 1
206 virtual bool isValidStartItem() const /*override*/;
207
208 // vIndex: 2
209 virtual bool isAddedActorItem() const /*override*/;
210
211 // vIndex: 3
212 virtual bool isMotionHintItem() const /*override*/;
213
214 // vIndex: 5
215 virtual ::Vec3 const& getPos() const /*override*/;
216
217 // vIndex: 6
218 virtual ::Vec2 const& getRot() const /*override*/;
219
220 // vIndex: 7
221 virtual float getYHeadRot() const /*override*/;
222
223 // vIndex: 8
224 virtual bool isOnGround() const /*override*/;
225
226 // vIndex: 0
227 virtual ~MotionHistoryItem() /*override*/ = default;
228 // NOLINTEND
229
230 public:
231 // destructor thunk
232 // NOLINTBEGIN
233
234 // NOLINTEND
235
236 public:
237 // virtual function thunks
238 // NOLINTBEGIN
239
240 // NOLINTEND
241 };
242
244 public:
245 // member variables
246 // NOLINTBEGIN
250 // NOLINTEND
251
252 public:
253 // prevent constructor by default
257
258 public:
259 // static variables
260 // NOLINTBEGIN
261 MCAPI static uint& mSequenceIdGenerator();
262 // NOLINTEND
263 };
264
266 public:
267 // member variables
268 // NOLINTBEGIN
273 // NOLINTEND
274
275 public:
276 // prevent constructor by default
277 HistoryCache& operator=(HistoryCache const&);
279 HistoryCache();
280
281 public:
282 // member functions
283 // NOLINTBEGIN
284 MCAPI void _addHistoryItem(::std::shared_ptr<::PredictedMovementComponent::HistoryItem const> const& item);
285
286 MCAPI void _clearHistory();
287
288 MCAPI void addHistory(
289 ::MoveActorAbsoluteData const& moveData,
290 ::std::chrono::steady_clock::time_point const& receiveTimepoint
291 );
292
293 MCAPI ::std::string toString();
294 // NOLINTEND
295 };
296
298 public:
299 // RuntimePredictionData inner types declare
300 // clang-format off
301 struct LerpedInterval;
302 // clang-format on
303
304 // RuntimePredictionData inner types define
306 public:
307 // member variables
308 // NOLINTBEGIN
313 // NOLINTEND
314
315 public:
316 // prevent constructor by default
317 LerpedInterval& operator=(LerpedInterval const&);
320 };
321
322 public:
323 // member variables
324 // NOLINTBEGIN
336 // NOLINTEND
337
338 public:
339 // prevent constructor by default
343
344 public:
345 // virtual functions
346 // NOLINTBEGIN
347 // vIndex: 0
348 virtual ~RuntimePredictionData() = default;
349 // NOLINTEND
350
351 public:
352 // member functions
353 // NOLINTBEGIN
354 MCAPI void reset();
355 // NOLINTEND
356
357 public:
358 // destructor thunk
359 // NOLINTBEGIN
360
361 // NOLINTEND
362
363 public:
364 // vftables
365 // NOLINTBEGIN
366 MCAPI static void** $vftable();
367 // NOLINTEND
368 };
369
371 public:
372 // member variables
373 // NOLINTBEGIN
385 // NOLINTEND
386
387 public:
388 // prevent constructor by default
392 };
393
395 public:
396 // member variables
397 // NOLINTBEGIN
404 // NOLINTEND
405
406 public:
407 // prevent constructor by default
408 PredictionDbgData& operator=(PredictionDbgData const&);
411
412 public:
413 // member functions
414 // NOLINTBEGIN
415 MCAPI ::std::string toString() const;
416
417 MCAPI ~PredictionDbgData();
418 // NOLINTEND
419
420 public:
421 // destructor thunk
422 // NOLINTBEGIN
423 MCFOLD void $dtor();
424 // NOLINTEND
425 };
426
427 using PredictionEventsListenerFunction = ::std::function<void(::MovePredictionType)>;
428
429public:
430 // member variables
431 // NOLINTBEGIN
432 ::ll::TypedStorage<4, 4, ::std::bitset<2>> mDisableConditions;
433 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData>>
434 mRuntimePredictionData;
435 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PredictedMovementComponent::HistoryItem const>> mLastStartItem;
436 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PredictedMovementComponent::HistoryItem const>> mLastEndItem;
437 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PredictedMovementComponent::HistoryCache>> mHistoryCache;
438 ::ll::TypedStorage<1, 1, bool> mForceTeleportAfterResuming;
439 ::ll::TypedStorage<1, 1, bool> mAllowTeleportingWithoutRegion;
440 ::ll::TypedStorage<4, 4, uint> mLastCompletedInterpolationSequenceID;
441 ::ll::TypedStorage<8, 64, ::std::function<void(::MovePredictionType)>> mPredictionEventsListenerFunc;
442 ::ll::TypedStorage<8, 16, ::PredictedMovementValues> mPredictedMovementValues;
443 // NOLINTEND
444
445public:
446 // member functions
447 // NOLINTBEGIN
448 MCAPI void _debugLog(
451 ) const;
452
453 MCAPI bool _tryInterpolate(
455 ::std::chrono::steady_clock::time_point const& renderTimepoint
456 );
457
458 MCAPI void reset();
459
460 MCAPI void
461 tickNextPosition(::PredictedMovementSystemParams& params, ::std::chrono::steady_clock::time_point const& timepoint);
462 // NOLINTEND
463
464public:
465 // static variables
466 // NOLINTBEGIN
467 MCAPI static ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData>& mGlobalRuntimePredictionData();
468 // NOLINTEND
469};
Definition MoveActorAbsoluteData.h:13
Definition PredictedMovementComponent.h:265
Definition PredictedMovementComponent.h:17
Definition Vec2.h:5
Definition Vec3.h:10
Definition PredictedMovementComponent.h:32
Definition PredictedMovementComponent.h:243
Definition PredictedMovementComponent.h:181
Definition PredictedMovementComponent.h:105
Definition PredictedMovementComponent.h:394
Definition PredictedMovementComponent.h:370
Definition PredictedMovementComponent.h:297
Definition PredictedMovementSystemParams.h:5
Definition PredictedMovementValues.h:5
Definition Alias.h:14