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;
33namespace Util { struct HashStringHashGreater; }
34class ActorRenderData;
36// clang-format on
37
38class AnimationComponent {
39public:
40 // AnimationComponent inner types declare
41 // clang-format off
43 // clang-format on
44
45 // AnimationComponent inner types define
47 public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<8, 8, void const*> mChildObjectKey;
51 ::ll::TypedStorage<8, 56, ::MolangVariableMap> mMolangVariableMap;
52 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AnimationComponent>> mChildAnimationComponent;
53 // NOLINTEND
54
55 public:
56 // member functions
57 // NOLINTBEGIN
58#ifdef LL_PLAT_C
59 MCAPI ::std::shared_ptr<::AnimationComponent>&
60 getAnimationComponent(::Actor& owner, ::SubClientId subClientId, ::AttachableSlotIndex attachableIndex);
61#endif
62 // NOLINTEND
63 };
64
65public:
66 // member variables
67 // NOLINTBEGIN
68 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ActorAnimationControllerStatePlayer>>
69 mCurrentAnimationControllerStatePlayer;
70 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ActorAnimationPlayer>>> mComponentAnimationPlayers;
71 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ActorAnimationControllerInfo>>>
72 mOwnedAnimationControllers;
73 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::ModelPartLocator>> mModelPartLocators;
74#ifdef LL_PLAT_S
75 ::ll::TypedStorage<8, 504, ::RenderParams> mRenderParams;
76#else // LL_PLAT_C
77 ::ll::TypedStorage<8, 520, ::RenderParams> mRenderParams;
78#endif
79 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ActorAnimationPlayer>> mPlaySingleAnimation;
80 ::ll::TypedStorage<8, 8, void*> mModelRenderControllerCacheWasBuiltFrom;
81 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::CommonResourceDefinitionMap>> mCommonResourceDefinitionMap;
82 ::ll::TypedStorage<8, 8, ::std::unordered_map<::HashedString, ::HashedString> const*> mParticleEffectMap;
83 ::ll::TypedStorage<8, 64, ::std::function<void(::ActorAnimationPlayer&)>> mAnimationComponentInitFunction;
84 ::ll::TypedStorage<8, 24, ::std::vector<::AnimationComponent::ChildAnimationComponentInfo>>
85 mChildAnimationComponents;
86 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SkeletalHierarchyIndex, ::std::vector<::BoneOrientation>>>
87 mBoneOrientations;
88 ::ll::TypedStorage<1, 1, bool> mAnimationComponentInitialized;
89 ::ll::TypedStorage<4, 4, ::AnimationComponentGroupType> mAnimationComponentGroupType;
90 ::ll::TypedStorage<8, 8, ::AnimationComponentID> mOwnerUUID;
91 ::ll::TypedStorage<8, 8, int64> mLastUpdateFrame;
92 ::ll::TypedStorage<8, 8, uint64> mLastReloadInitTimeStampClient;
93 ::ll::TypedStorage<1, 1, bool> mApplyAnimations;
94 ::ll::TypedStorage<1, 1, bool> mNeedToUpdateQueryableBoneOrientations;
95 // NOLINTEND
96
97#ifdef LL_PLAT_S
98#else // LL_PLAT_C
99public:
100 // prevent constructor by default
101 AnimationComponent();
102
103#endif
104public:
105 // virtual functions
106 // NOLINTBEGIN
107 virtual ~AnimationComponent();
108
109 virtual ::ClientAnimationComponent* tryGetClient();
110
111 virtual void visitApplyContext(
112 ::brstd::function_ref<void(::ApplyAnimationContext const&) const, void(::ApplyAnimationContext const&)> visitor
113 ) const;
114
115#ifdef LL_PLAT_S
116 virtual void initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)>);
117#else // LL_PLAT_C
118 virtual void
119 initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction);
120#endif
121
122 virtual void ensureClientAnimationComponentIsInitialized();
123
124 virtual void setDirty();
125
126 virtual void updateQueryableGeometryBoneOrientations();
127
128#ifdef LL_PLAT_S
129 virtual ::Matrix const* getQueryableBoneOrientation(uint64) const;
130#else // LL_PLAT_C
131 virtual ::Matrix const* getQueryableBoneOrientation(uint64 boneNameHash) const;
132#endif
133
134 virtual ::gsl::span<::SkeletalHierarchyIndex const> getSkeletalHierarchiesToProcess() const;
135
136#ifdef LL_PLAT_S
137 virtual float _getActorRenderDeltaTime(::ActorRenderData const&) const;
138#else // LL_PLAT_C
139 virtual float _getActorRenderDeltaTime(::ActorRenderData const& data) const;
140#endif
141
142 // NOLINTEND
143
144public:
145 // member functions
146 // NOLINTBEGIN
147#ifdef LL_PLAT_C
148 MCAPI explicit AnimationComponent(::AnimationComponentArguments&& args);
149
150 MCAPI void _addAnimationToStatePlayer(
151 ::HashedString const& friendlyName,
152 ::std::shared_ptr<::ActorAnimationControllerStatePlayer> player
153 );
154#endif
155
156 MCAPI ::RenderParams& _prepRenderParamsForActor(::Actor& actor);
157
158 MCAPI ::std::shared_ptr<::ActorAnimationPlayer> createAnimationPlayer(
159 ::HashedString const& friendlyName,
160 ::ExpressionNode const& blendExpression,
161 ::std::set<::HashedString, ::Util::HashStringHashGreater>& animationControllerNameStack
162 );
163
164#ifdef LL_PLAT_C
165 MCAPI ::std::shared_ptr<::ActorAnimationControllerStatePlayer> editGlobalAnimationData(
166 ::HashedString const& friendlyName,
167 float blendOutTime,
168 ::std::string const& stopExpression,
169 ::MolangVersion stopExpressionVersion,
170 ::std::string const& nextStateName,
171 ::std::string const& runtimeController
172 );
173
174 MCAPI ::std::shared_ptr<::ActorAnimationPlayer> findAnimation(::HashedString const& rawAnimationName);
175
176 MCAPI ::std::shared_ptr<::ActorAnimationControllerPlayer>
177 getAnimationControllerPlayer(::HashedString const& destControllerName, bool createIfMissing);
178
179 MCAPI ::ModelPartLocator* getLocator(::HashedString const& locatorNameHash);
180
181 MCAPI float getRegisteredAnimationLength(::std::string const& friendlyName) const;
182
183 MCAPI void initInstanceSpecificAnimationData(::MolangVariableMap* variableMap);
184#endif
185
186 MCAPI void initializeServerAnimationComponent(
187 ::Actor& actor,
188 ::std::shared_ptr<::CommonResourceDefinitionMap> animationResourceDefinition,
189 ::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction
190 );
191
192#ifdef LL_PLAT_C
193 MCAPI bool isAnimationRegistered(::HashedString const& friendlyName) const;
194
195 MCAPI ::std::shared_ptr<::ActorAnimationControllerStatePlayer> playAnimation(
196 ::HashedString const& friendlyName,
197 ::HashedString const& owningStateName,
198 ::std::string const& runtimeController
199 );
200#endif
201
202 MCAPI void serverUpdate(::Actor& actor);
203
204#ifdef LL_PLAT_C
205 MCAPI void setInitializedScriptsRun(bool);
206
207 MCAPI void setupDeltaTimeAndLifeTimeParams(bool incrementLifetime);
208
209 MCAPI bool tryRegisterAnimation(::HashedString const& friendlyName, ::ActorSkeletalAnimationPtr animation);
210#endif
211 // NOLINTEND
212
213public:
214 // static functions
215 // NOLINTBEGIN
216#ifdef LL_PLAT_C
217 MCAPI static ::ApplyAnimationCache createBase(::Actor const* actor);
218#endif
219 // NOLINTEND
220
221public:
222 // static variables
223 // NOLINTBEGIN
224 MCAPI static ::std::atomic<int64>& mClientFrameIndex();
225
226 MCAPI static ::std::atomic<int64>& mReloadTimeStampClient();
227
228 MCAPI static ::std::atomic<int64>& mServerFrameIndex();
229 // NOLINTEND
230
231public:
232 // constructor thunks
233 // NOLINTBEGIN
234#ifdef LL_PLAT_C
235 MCAPI void* $ctor(::AnimationComponentArguments&& args);
236#endif
237 // NOLINTEND
238
239public:
240 // destructor thunk
241 // NOLINTBEGIN
242 MCAPI void $dtor();
243 // NOLINTEND
244
245public:
246 // virtual function thunks
247 // NOLINTBEGIN
248 MCFOLD ::ClientAnimationComponent* $tryGetClient();
249
250 MCAPI void $visitApplyContext(
251 ::brstd::function_ref<void(::ApplyAnimationContext const&) const, void(::ApplyAnimationContext const&)> visitor
252 ) const;
253
254#ifdef LL_PLAT_S
255 MCFOLD void $initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)>);
256#else // LL_PLAT_C
257 MCFOLD void
258 $initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction);
259#endif
260
261 MCFOLD void $ensureClientAnimationComponentIsInitialized();
262
263 MCAPI void $setDirty();
264
265 MCFOLD void $updateQueryableGeometryBoneOrientations();
266
267#ifdef LL_PLAT_S
268 MCFOLD ::Matrix const* $getQueryableBoneOrientation(uint64) const;
269#else // LL_PLAT_C
270 MCFOLD ::Matrix const* $getQueryableBoneOrientation(uint64 boneNameHash) const;
271#endif
272
273 MCFOLD ::gsl::span<::SkeletalHierarchyIndex const> $getSkeletalHierarchiesToProcess() const;
274
275#ifdef LL_PLAT_S
276 MCFOLD float $_getActorRenderDeltaTime(::ActorRenderData const&) const;
277#else // LL_PLAT_C
278 MCFOLD float $_getActorRenderDeltaTime(::ActorRenderData const& data) const;
279#endif
280
281
282 // NOLINTEND
283
284public:
285 // vftables
286 // NOLINTBEGIN
287 MCNAPI static void** $vftable();
288 // NOLINTEND
289};
Definition ActorAnimationControllerInfo.h:13
Definition ActorAnimationControllerPlayer.h:24
Definition ActorAnimationControllerStatePlayer.h:25
Definition ActorAnimationPlayer.h:20
Definition ActorRenderData.h:5
Definition ActorSkeletalAnimationPtr.h:15
Definition Actor.h:113
static MCAPI void ** $vftable()
Definition ApplyAnimationContext.h:16
Definition BoneOrientation.h:16
Definition ClientAnimationComponent.h:5
Definition CommonResourceDefinitionMap.h:16
Definition ExpressionNode.h:35
Definition HashedString.h:5
Definition Matrix.h:10
Definition ModelPartLocator.h:11
Definition MolangVariableMap.h:17
Definition function_ref.h:60
Definition AnimationComponentArguments.h:13
Definition AnimationComponent.h:46
Definition ApplyAnimationCache.h:5
Definition HashStringHashGreater.h:7