LeviLamina
Loading...
Searching...
No Matches
AnimationComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/SubClientId.h"
7#include "mc/deps/core/string/HashedString.h"
8#include "mc/molang/MolangVersion.h"
9#include "mc/platform/brstd/function_ref.h"
10#include "mc/util/MolangVariableMap.h"
11#include "mc/world/actor/RenderParams.h"
12#include "mc/world/actor/SkeletalHierarchyIndex.h"
13#include "mc/world/actor/animation/AnimationComponentGroupType.h"
14#include "mc/world/actor/animation/AnimationComponentID.h"
15#include "mc/world/actor/animation/AttachableSlotIndex.h"
16
17// auto generated forward declare list
18// clang-format off
19class Actor;
26class BoneOrientation;
28class ExpressionNode;
29class Matrix;
33class ActorRenderData;
35// clang-format on
36
37class AnimationComponent {
38public:
39 // AnimationComponent inner types declare
40 // clang-format off
42 // clang-format on
43
44 // AnimationComponent inner types define
46 public:
47 // member variables
48 // NOLINTBEGIN
49 ::ll::TypedStorage<8, 8, void const*> mChildObjectKey;
50 ::ll::TypedStorage<8, 56, ::MolangVariableMap> mMolangVariableMap;
51 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AnimationComponent>> mChildAnimationComponent;
52 // NOLINTEND
53
54 public:
55 // member functions
56 // NOLINTBEGIN
57#ifdef LL_PLAT_C
58 MCAPI ::std::shared_ptr<::AnimationComponent>&
59 getAnimationComponent(::Actor& owner, ::SubClientId subClientId, ::AttachableSlotIndex attachableIndex);
60#endif
61 // NOLINTEND
62 };
63
64public:
65 // member variables
66 // NOLINTBEGIN
67 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ActorAnimationControllerStatePlayer>>
68 mCurrentAnimationControllerStatePlayer;
69 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ActorAnimationPlayer>>> mComponentAnimationPlayers;
70 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ActorAnimationControllerInfo>>>
71 mOwnedAnimationControllers;
72 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::ModelPartLocator>> mModelPartLocators;
73#ifdef LL_PLAT_S
74 ::ll::TypedStorage<8, 496, ::RenderParams> mRenderParams;
75#else // LL_PLAT_C
76 ::ll::TypedStorage<8, 512, ::RenderParams> mRenderParams;
77#endif
78 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ActorAnimationPlayer>> mPlaySingleAnimation;
79 ::ll::TypedStorage<8, 8, void*> mModelRenderControllerCacheWasBuiltFrom;
80 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::CommonResourceDefinitionMap>> mCommonResourceDefinitionMap;
81 ::ll::TypedStorage<8, 8, ::std::unordered_map<::HashedString, ::HashedString> const*> mParticleEffectMap;
82 ::ll::TypedStorage<8, 64, ::std::function<void(::ActorAnimationPlayer&)>> mAnimationComponentInitFunction;
83 ::ll::TypedStorage<8, 24, ::std::vector<::AnimationComponent::ChildAnimationComponentInfo>>
84 mChildAnimationComponents;
85 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SkeletalHierarchyIndex, ::std::vector<::BoneOrientation>>>
86 mBoneOrientations;
87 ::ll::TypedStorage<1, 1, bool> mAnimationComponentInitialized;
88 ::ll::TypedStorage<4, 4, ::AnimationComponentGroupType> mAnimationComponentGroupType;
89 ::ll::TypedStorage<8, 8, ::AnimationComponentID> mOwnerUUID;
90 ::ll::TypedStorage<8, 8, int64> mLastUpdateFrame;
91 ::ll::TypedStorage<8, 8, uint64> mLastReloadInitTimeStampClient;
92 ::ll::TypedStorage<1, 1, bool> mApplyAnimations;
93 ::ll::TypedStorage<1, 1, bool> mNeedToUpdateQueryableBoneOrientations;
94 // NOLINTEND
95
96public:
97 // prevent constructor by default
98 AnimationComponent();
99
100public:
101 // virtual functions
102 // NOLINTBEGIN
103 virtual ~AnimationComponent();
104
105 virtual ::ClientAnimationComponent* tryGetClient();
106
107 virtual void visitApplyContext(
108 ::brstd::function_ref<void(::ApplyAnimationContext const&) const, void(::ApplyAnimationContext const&)> visitor
109 ) const;
110
111#ifdef LL_PLAT_S
112 virtual void initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)>);
113#else // LL_PLAT_C
114 virtual void
115 initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction);
116#endif
117
118 virtual void ensureClientAnimationComponentIsInitialized();
119
120 virtual void setDirty();
121
122 virtual void updateQueryableGeometryBoneOrientations();
123
124 virtual ::Matrix const* getQueryableBoneOrientation(uint64 boneNameHash) const;
125
126 virtual ::gsl::span<::SkeletalHierarchyIndex const> getSkeletalHierarchiesToProcess() const;
127
128 virtual float _getActorRenderDeltaTime(::ActorRenderData const& data) const;
129 // NOLINTEND
130
131public:
132 // member functions
133 // NOLINTBEGIN
134 MCAPI explicit AnimationComponent(::AnimationComponentArguments&& args);
135
136#ifdef LL_PLAT_C
137 MCAPI void _addAnimationToStatePlayer(
138 ::HashedString const& friendlyName,
139 ::std::shared_ptr<::ActorAnimationControllerStatePlayer> player
140 );
141#endif
142
143 MCAPI ::RenderParams& _prepRenderParamsForActor(::Actor& actor);
144
145#ifdef LL_PLAT_C
146 MCAPI void applyAnimations(bool setDefaultPose);
147#endif
148
149 MCAPI ::std::shared_ptr<::ActorAnimationPlayer> createAnimationPlayer(
150 ::HashedString const& friendlyName,
151 ::ExpressionNode const& blendExpression,
152 ::std::set<::HashedString, ::std::hash<::HashedString>>& animationControllerNameStack
153 );
154
155#ifdef LL_PLAT_C
156 MCAPI ::std::shared_ptr<::ActorAnimationControllerStatePlayer> editGlobalAnimationData(
157 ::HashedString const& friendlyName,
158 float blendOutTime,
159 ::std::string const& stopExpression,
160 ::MolangVersion stopExpressionVersion,
161 ::std::string const& nextStateName,
162 ::std::string const& runtimeController
163 );
164
165 MCAPI ::std::shared_ptr<::ActorAnimationPlayer> findAnimation(::HashedString const& rawAnimationName);
166
167 MCAPI void forceNextUpdateToApplyAnimations();
168#endif
169
170 MCFOLD ::std::unordered_map<::SkeletalHierarchyIndex, ::std::vector<::BoneOrientation>>& getAllBoneOrientations();
171
172#ifdef LL_PLAT_C
173 MCAPI ::AnimationComponentGroupType getAnimationComponentType() const;
174
175 MCAPI ::std::shared_ptr<::ActorAnimationControllerPlayer>
176 getAnimationControllerPlayer(::HashedString const& destControllerName, bool createIfMissing);
177#endif
178
179 MCAPI ::std::vector<::BoneOrientation>*
180 getBoneOrientations(::SkeletalHierarchyIndex skeletalHierarchyIndex, bool missingIsOkay);
181
182#ifdef LL_PLAT_C
183 MCFOLD ::std::vector<::AnimationComponent::ChildAnimationComponentInfo>& getChildAnimationComponents();
184
185 MCAPI ::std::weak_ptr<::CommonResourceDefinitionMap> getCommonResourceDefinitionMap();
186#endif
187
188 MCFOLD ::std::shared_ptr<::ActorAnimationControllerStatePlayer> const
189 getCurrentAnimationControllerStatePlayer() const;
190
191#ifdef LL_PLAT_C
192 MCAPI ::ModelPartLocator* getLocator(::HashedString const& locatorNameHash);
193#endif
194
195 MCAPI ::ModelPartLocator* getLocator(uint64 const& locatorNameHash);
196
197#ifdef LL_PLAT_C
198 MCFOLD ::std::unordered_map<::HashedString, ::ModelPartLocator>& getLocators();
199
200 MCAPI float getRegisteredAnimationLength(::std::string const& friendlyName) const;
201#endif
202
203 MCFOLD ::RenderParams& getRenderParams();
204
205#ifdef LL_PLAT_C
206 MCAPI bool haveInitializedScriptsRun() const;
207#endif
208
209 MCAPI void initInstanceSpecificAnimationData(::MolangVariableMap* variableMap);
210
211 MCAPI void initializeServerAnimationComponent(
212 ::Actor& actor,
213 ::std::shared_ptr<::CommonResourceDefinitionMap> animationResourceDefinition,
214 ::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction
215 );
216
217#ifdef LL_PLAT_C
218 MCAPI bool isAnimationRegistered(::HashedString const& friendlyName) const;
219#endif
220
221 MCAPI bool isInitialized() const;
222
223#ifdef LL_PLAT_C
224 MCAPI ::std::shared_ptr<::ActorAnimationControllerStatePlayer> playAnimation(
225 ::HashedString const& friendlyName,
226 ::HashedString const& owningStateName,
227 ::std::string const& runtimeController
228 );
229#endif
230
231 MCAPI void serverUpdate(::Actor& actor);
232
233#ifdef LL_PLAT_C
234 MCAPI void setInitializedScriptsRun(bool);
235#endif
236
237 MCAPI void setLastReloadInitTimeStampClient(uint64 lastReloadInitTimeStamp);
238
239#ifdef LL_PLAT_C
240 MCAPI void setShouldApplyAnimations(bool shouldAnimate);
241
242 MCAPI void setupDeltaTimeAndLifeTimeParams(bool incrementLifetime);
243#endif
244
245 MCAPI bool shouldReloadBasedOnLastReloadInitTimeStamp() const;
246
247#ifdef LL_PLAT_C
248 MCAPI bool tryRegisterAnimation(::HashedString const& friendlyName, ::ActorSkeletalAnimationPtr animation);
249#endif
250
251 MCAPI bool usesLastReloadInitTimeStampClient() const;
252 // NOLINTEND
253
254public:
255 // static functions
256 // NOLINTBEGIN
257#ifdef LL_PLAT_C
258 MCAPI static ::ApplyAnimationCache createBase(::Actor const* actor);
259#endif
260
261 MCAPI static uint64 getReloadTimeStampClient();
262
263#ifdef LL_PLAT_C
264 MCAPI static void incrementCurrentClientFrameIndex();
265#endif
266
267 MCAPI static void incrementCurrentServerFrameIndex();
268
269#ifdef LL_PLAT_C
270 MCAPI static uint64 incrementReloadTimeStampClient();
271#endif
272 // NOLINTEND
273
274public:
275 // static variables
276 // NOLINTBEGIN
277 MCAPI static char const* const& DEFAULT_RUNTIME_CONTROLLER();
278
279 MCAPI static ::std::atomic<int64>& mClientFrameIndex();
280
281 MCAPI static ::std::atomic<int64>& mReloadTimeStampClient();
282
283 MCAPI static ::std::atomic<int64>& mServerFrameIndex();
284 // NOLINTEND
285
286public:
287 // constructor thunks
288 // NOLINTBEGIN
289 MCAPI void* $ctor(::AnimationComponentArguments&& args);
290 // NOLINTEND
291
292public:
293 // destructor thunk
294 // NOLINTBEGIN
295 MCAPI void $dtor();
296 // NOLINTEND
297
298public:
299 // virtual function thunks
300 // NOLINTBEGIN
301 MCFOLD ::ClientAnimationComponent* $tryGetClient();
302
303 MCAPI void $visitApplyContext(
304 ::brstd::function_ref<void(::ApplyAnimationContext const&) const, void(::ApplyAnimationContext const&)> visitor
305 ) const;
306
307 MCFOLD void $initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)>);
308
309 MCFOLD void $ensureClientAnimationComponentIsInitialized();
310
311 MCAPI void $setDirty();
312
313 MCFOLD void $updateQueryableGeometryBoneOrientations();
314
315 MCFOLD ::Matrix const* $getQueryableBoneOrientation(uint64 boneNameHash) const;
316
317 MCFOLD ::gsl::span<::SkeletalHierarchyIndex const> $getSkeletalHierarchiesToProcess() const;
318
319 MCFOLD float $_getActorRenderDeltaTime(::ActorRenderData const& data) const;
320
321
322 // NOLINTEND
323
324public:
325 // vftables
326 // NOLINTBEGIN
327 MCNAPI static void** $vftable();
328 // NOLINTEND
329};
Definition ActorAnimationControllerInfo.h:13
Definition ActorAnimationControllerPlayer.h:23
Definition ActorAnimationControllerStatePlayer.h:24
Definition ActorAnimationPlayer.h:20
Definition ActorRenderData.h:5
Definition ActorSkeletalAnimationPtr.h:16
Definition Actor.h:125
static MCAPI void ** $vftable()
Definition ApplyAnimationContext.h:16
Definition BoneOrientation.h:16
Definition ClientAnimationComponent.h:5
Definition CommonResourceDefinitionMap.h:16
Definition ExpressionNode.h:36
Definition HashedString.h:5
Definition Matrix.h:10
Definition ModelPartLocator.h:11
Definition MolangVariableMap.h:18
Definition function_ref.h:60
Definition AnimationComponentArguments.h:13
Definition AnimationComponent.h:45
Definition ApplyAnimationCache.h:5