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
22 class HistoryCache;
23 struct HistoryItem;
25 struct MotionHistoryItem;
26 struct MoveHistoryItem;
27 struct PredictionDbgData;
30 // clang-format on
31
32 // PredictedMovementComponent inner types define
33 struct HistoryItem {
34 public:
35 // HistoryItem inner types define
36 enum class ItemType : int {
37 Motion = 0,
38 Move = 1,
39 Max = 2,
40 };
41
42 public:
43 // member variables
44 // NOLINTBEGIN
48 // NOLINTEND
49
50 public:
51 // prevent constructor by default
52 HistoryItem& operator=(HistoryItem const&);
55
56 public:
57 // virtual functions
58 // NOLINTBEGIN
59 // vIndex: 0
60 virtual ~HistoryItem() = default;
61
62 // vIndex: 1
63 virtual bool isValidStartItem() const = 0;
64
65 // vIndex: 2
66 virtual bool isAddedActorItem() const = 0;
67
68 // vIndex: 3
69 virtual bool isMotionHintItem() const = 0;
70
71 // vIndex: 4
72 virtual ::std::string toString() const;
73
74 // vIndex: 5
75 virtual ::Vec3 const& getPos() const = 0;
76
77 // vIndex: 6
78 virtual ::Vec2 const& getRot() const = 0;
79
80 // vIndex: 7
81 virtual float getYHeadRot() const = 0;
82
83 // vIndex: 8
84 virtual bool isOnGround() const = 0;
85 // NOLINTEND
86
87 public:
88 // virtual function thunks
89 // NOLINTBEGIN
90 MCNAPI ::std::string $toString() const;
91 // NOLINTEND
92
93 public:
94 // vftables
95 // NOLINTBEGIN
96 MCNAPI static void** $vftable();
97 // NOLINTEND
98 };
99
101 public:
102 // member variables
103 // NOLINTBEGIN
109 // NOLINTEND
110
111 public:
112 // prevent constructor by default
113 MoveHistoryItem& operator=(MoveHistoryItem const&);
116
117 public:
118 // virtual functions
119 // NOLINTBEGIN
120 // vIndex: 1
121 virtual bool isValidStartItem() const /*override*/;
122
123 // vIndex: 2
124 virtual bool isAddedActorItem() const /*override*/;
125
126 // vIndex: 3
127 virtual bool isMotionHintItem() const /*override*/;
128
129 // vIndex: 5
130 virtual ::Vec3 const& getPos() const /*override*/;
131
132 // vIndex: 6
133 virtual ::Vec2 const& getRot() const /*override*/;
134
135 // vIndex: 7
136 virtual float getYHeadRot() const /*override*/;
137
138 // vIndex: 8
139 virtual bool isOnGround() const /*override*/;
140
141 // vIndex: 0
142 virtual ~MoveHistoryItem() /*override*/ = default;
143 // NOLINTEND
144
145 public:
146 // virtual function thunks
147 // NOLINTBEGIN
148 MCNAPI bool $isValidStartItem() const;
149
150 MCNAPI bool $isAddedActorItem() const;
151
152 MCNAPI bool $isMotionHintItem() const;
153
154 MCNAPI ::Vec3 const& $getPos() const;
155
156 MCNAPI ::Vec2 const& $getRot() const;
157
158 MCNAPI float $getYHeadRot() const;
159
160 MCNAPI bool $isOnGround() const;
161 // NOLINTEND
162
163 public:
164 // vftables
165 // NOLINTBEGIN
166 MCNAPI static void** $vftable();
167 // NOLINTEND
168 };
169
171 public:
172 // member variables
173 // NOLINTBEGIN
183 // NOLINTEND
184
185 public:
186 // prevent constructor by default
187 MotionHistoryItem& operator=(MotionHistoryItem const&);
190
191 public:
192 // virtual functions
193 // NOLINTBEGIN
194 // vIndex: 1
195 virtual bool isValidStartItem() const /*override*/;
196
197 // vIndex: 2
198 virtual bool isAddedActorItem() const /*override*/;
199
200 // vIndex: 3
201 virtual bool isMotionHintItem() const /*override*/;
202
203 // vIndex: 5
204 virtual ::Vec3 const& getPos() const /*override*/;
205
206 // vIndex: 6
207 virtual ::Vec2 const& getRot() const /*override*/;
208
209 // vIndex: 7
210 virtual float getYHeadRot() const /*override*/;
211
212 // vIndex: 8
213 virtual bool isOnGround() const /*override*/;
214
215 // vIndex: 0
216 virtual ~MotionHistoryItem() /*override*/ = default;
217 // NOLINTEND
218
219 public:
220 // virtual function thunks
221 // NOLINTBEGIN
222
223 // NOLINTEND
224 };
225
227 public:
228 // member variables
229 // NOLINTBEGIN
233 // NOLINTEND
234
235 public:
236 // prevent constructor by default
240
241 public:
242 // static variables
243 // NOLINTBEGIN
244 MCNAPI static uint& mSequenceIdGenerator();
245 // NOLINTEND
246 };
247
249 public:
250 // member variables
251 // NOLINTBEGIN
256 // NOLINTEND
257
258 public:
259 // prevent constructor by default
260 HistoryCache& operator=(HistoryCache const&);
262 HistoryCache();
263
264 public:
265 // member functions
266 // NOLINTBEGIN
267 MCNAPI void _addHistoryItem(::std::shared_ptr<::PredictedMovementComponent::HistoryItem const> const& item);
268
269 MCNAPI void _clearHistory();
270
271 MCNAPI void addHistory(
272 ::MoveActorAbsoluteData const& moveData,
273 ::std::chrono::steady_clock::time_point const& receiveTimepoint
274 );
275
276 MCNAPI ::std::string toString();
277 // NOLINTEND
278 };
279
281 public:
282 // RuntimePredictionData inner types declare
283 // clang-format off
284 struct LerpedInterval;
285 // clang-format on
286
287 // RuntimePredictionData inner types define
289 public:
290 // member variables
291 // NOLINTBEGIN
296 // NOLINTEND
297
298 public:
299 // prevent constructor by default
300 LerpedInterval& operator=(LerpedInterval const&);
303 };
304
305 public:
306 // member variables
307 // NOLINTBEGIN
319 // NOLINTEND
320
321 public:
322 // prevent constructor by default
326
327 public:
328 // virtual functions
329 // NOLINTBEGIN
330 // vIndex: 0
331 virtual ~RuntimePredictionData() = default;
332 // NOLINTEND
333
334 public:
335 // member functions
336 // NOLINTBEGIN
337 MCNAPI void reset();
338 // NOLINTEND
339
340 public:
341 // vftables
342 // NOLINTBEGIN
343 MCNAPI static void** $vftable();
344 // NOLINTEND
345 };
346
348 public:
349 // member variables
350 // NOLINTBEGIN
362 // NOLINTEND
363
364 public:
365 // prevent constructor by default
369 };
370
372 public:
373 // member variables
374 // NOLINTBEGIN
381 // NOLINTEND
382
383 public:
384 // prevent constructor by default
385 PredictionDbgData& operator=(PredictionDbgData const&);
388
389 public:
390 // member functions
391 // NOLINTBEGIN
392 MCNAPI ::std::string toString() const;
393
395 // NOLINTEND
396
397 public:
398 // destructor thunk
399 // NOLINTBEGIN
400 MCNAPI void $dtor();
401 // NOLINTEND
402 };
403
404 using PredictionEventsListenerFunction = ::std::function<void(::MovePredictionType)>;
405
406public:
407 // member variables
408 // NOLINTBEGIN
409 ::ll::TypedStorage<1, 1, ::brstd::bitset<2, uchar>> mDisableConditions;
410 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData>>
411 mRuntimePredictionData;
412 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PredictedMovementComponent::HistoryItem const>> mLastStartItem;
413 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::PredictedMovementComponent::HistoryItem const>> mLastEndItem;
414 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PredictedMovementComponent::HistoryCache>> mHistoryCache;
415 ::ll::TypedStorage<1, 1, bool> mForceTeleportAfterResuming;
416 ::ll::TypedStorage<1, 1, bool> mAllowTeleportingWithoutRegion;
417 ::ll::TypedStorage<4, 4, uint> mLastCompletedInterpolationSequenceID;
418 ::ll::TypedStorage<8, 64, ::std::function<void(::MovePredictionType)>> mPredictionEventsListenerFunc;
419 ::ll::TypedStorage<8, 16, ::PredictedMovementValues> mPredictedMovementValues;
420 // NOLINTEND
421
422public:
423 // member functions
424 // NOLINTBEGIN
425 MCNAPI void _debugLog(
428 ) const;
429
430 MCNAPI bool _tryInterpolate(
432 ::std::chrono::steady_clock::time_point const& renderTimepoint
433 );
434
435 MCNAPI void reset();
436
437 MCNAPI void
438 tickNextPosition(::PredictedMovementSystemParams& params, ::std::chrono::steady_clock::time_point const& timepoint);
439 // NOLINTEND
440
441public:
442 // static variables
443 // NOLINTBEGIN
444 MCNAPI static ::std::unique_ptr<::PredictedMovementComponent::RuntimePredictionData>&
446 // NOLINTEND
447};
Definition MoveActorAbsoluteData.h:15
Definition PredictedMovementComponent.h:248
MCAPI void addHistory(::MoveActorAbsoluteData const &moveData, ::std::chrono::steady_clock::time_point const &receiveTimepoint)
MCAPI void _addHistoryItem(::std::shared_ptr<::PredictedMovementComponent::HistoryItem const > const &item)
Definition PredictedMovementComponent.h:18
MCAPI void _debugLog(::PredictedMovementSystemParams &params, ::PredictedMovementComponent::PredictionDbgData const &debugData) const
MCAPI bool _tryInterpolate(::PredictedMovementSystemParams &params, ::std::chrono::steady_clock::time_point const &renderTimepoint)
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:33
MCAPI::std::string $toString() const
Definition PredictedMovementComponent.h:226
Definition PredictedMovementComponent.h:170
Definition PredictedMovementComponent.h:100
MCAPI::Vec2 const & $getRot() const
MCAPI::Vec3 const & $getPos() const
Definition PredictedMovementComponent.h:371
Definition PredictedMovementComponent.h:347
Definition PredictedMovementComponent.h:280
Definition PredictedMovementSystemParams.h:5
Definition Alias.h:14