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
97public:
98 // prevent constructor by default
99 AnimationComponent();
100
101public:
102 // virtual functions
103 // NOLINTBEGIN
104#ifdef LL_PLAT_S
105 virtual ~AnimationComponent() = default;
106#else // LL_PLAT_C
107 virtual ~AnimationComponent();
108#endif
109
110 virtual ::ClientAnimationComponent* tryGetClient();
111
112 virtual void visitApplyContext(
113 ::brstd::function_ref<void(::ApplyAnimationContext const&) const, void(::ApplyAnimationContext const&)> visitor
114 ) const;
115
116#ifdef LL_PLAT_S
117 virtual void initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)>);
118#else // LL_PLAT_C
119 virtual void
120 initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction);
121#endif
122
123 virtual void ensureClientAnimationComponentIsInitialized();
124
125 virtual void setDirty();
126
127 virtual void updateQueryableGeometryBoneOrientations();
128
129#ifdef LL_PLAT_S
130 virtual ::Matrix const* getQueryableBoneOrientation(uint64) const;
131#else // LL_PLAT_C
132 virtual ::Matrix const* getQueryableBoneOrientation(uint64 boneNameHash) const;
133#endif
134
135 virtual ::gsl::span<::SkeletalHierarchyIndex const> getSkeletalHierarchiesToProcess() const;
136
137#ifdef LL_PLAT_S
138 virtual float _getActorRenderDeltaTime(::ActorRenderData const&) const;
139#else // LL_PLAT_C
140 virtual float _getActorRenderDeltaTime(::ActorRenderData const& data) const;
141#endif
142
143 // NOLINTEND
144
145public:
146 // member functions
147 // NOLINTBEGIN
148 MCAPI explicit AnimationComponent(::AnimationComponentArguments&& args);
149
150#ifdef LL_PLAT_C
151 MCAPI void _addAnimationToStatePlayer(
152 ::HashedString const& friendlyName,
153 ::std::shared_ptr<::ActorAnimationControllerStatePlayer> player
154 );
155#endif
156
157 MCAPI ::RenderParams& _prepRenderParamsForActor(::Actor& actor);
158
159 MCAPI ::std::shared_ptr<::ActorAnimationPlayer> createAnimationPlayer(
160 ::HashedString const& friendlyName,
161 ::ExpressionNode const& blendExpression,
162 ::std::set<::HashedString, ::Util::HashStringHashGreater>& animationControllerNameStack
163 );
164
165#ifdef LL_PLAT_C
166 MCAPI ::std::shared_ptr<::ActorAnimationControllerStatePlayer> editGlobalAnimationData(
167 ::HashedString const& friendlyName,
168 float blendOutTime,
169 ::std::string const& stopExpression,
170 ::MolangVersion stopExpressionVersion,
171 ::std::string const& nextStateName,
172 ::std::string const& runtimeController
173 );
174
175 MCAPI ::std::shared_ptr<::ActorAnimationPlayer> findAnimation(::HashedString const& rawAnimationName);
176
177 MCAPI ::std::shared_ptr<::ActorAnimationControllerPlayer>
178 getAnimationControllerPlayer(::HashedString const& destControllerName, bool createIfMissing);
179
180 MCAPI ::ModelPartLocator* getLocator(::HashedString const& locatorNameHash);
181
182 MCAPI float getRegisteredAnimationLength(::std::string const& friendlyName) const;
183
184 MCAPI void initInstanceSpecificAnimationData(::MolangVariableMap* variableMap);
185#endif
186
187 MCAPI void initializeServerAnimationComponent(
188 ::Actor& actor,
189 ::std::shared_ptr<::CommonResourceDefinitionMap> animationResourceDefinition,
190 ::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction
191 );
192
193#ifdef LL_PLAT_C
194 MCAPI bool isAnimationRegistered(::HashedString const& friendlyName) const;
195
196 MCAPI ::std::shared_ptr<::ActorAnimationControllerStatePlayer> playAnimation(
197 ::HashedString const& friendlyName,
198 ::HashedString const& owningStateName,
199 ::std::string const& runtimeController
200 );
201#endif
202
203 MCAPI void serverUpdate(::Actor& actor);
204
205#ifdef LL_PLAT_C
206 MCAPI void setInitializedScriptsRun(bool);
207
208 MCAPI void setupDeltaTimeAndLifeTimeParams(bool incrementLifetime);
209
210 MCAPI bool tryRegisterAnimation(::HashedString const& friendlyName, ::ActorSkeletalAnimationPtr animation);
211#endif
212 // NOLINTEND
213
214public:
215 // static functions
216 // NOLINTBEGIN
217#ifdef LL_PLAT_C
218 MCAPI static ::ApplyAnimationCache createBase(::Actor const* actor);
219#endif
220 // NOLINTEND
221
222public:
223 // static variables
224 // NOLINTBEGIN
225 MCAPI static ::std::atomic<int64>& mClientFrameIndex();
226
227 MCAPI static ::std::atomic<int64>& mReloadTimeStampClient();
228
229 MCAPI static ::std::atomic<int64>& mServerFrameIndex();
230 // NOLINTEND
231
232public:
233 // constructor thunks
234 // NOLINTBEGIN
235 MCAPI void* $ctor(::AnimationComponentArguments&& args);
236 // NOLINTEND
237
238public:
239 // destructor thunk
240 // NOLINTBEGIN
241#ifdef LL_PLAT_C
242 MCAPI void $dtor();
243#endif
244 // NOLINTEND
245
246public:
247 // virtual function thunks
248 // NOLINTBEGIN
249 MCFOLD ::ClientAnimationComponent* $tryGetClient();
250
251 MCAPI void $visitApplyContext(
252 ::brstd::function_ref<void(::ApplyAnimationContext const&) const, void(::ApplyAnimationContext const&)> visitor
253 ) const;
254
255#ifdef LL_PLAT_S
256 MCFOLD void $initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)>);
257#else // LL_PLAT_C
258 MCFOLD void
259 $initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction);
260#endif
261
262 MCFOLD void $ensureClientAnimationComponentIsInitialized();
263
264 MCAPI void $setDirty();
265
266 MCFOLD void $updateQueryableGeometryBoneOrientations();
267
268#ifdef LL_PLAT_S
269 MCFOLD ::Matrix const* $getQueryableBoneOrientation(uint64) const;
270#else // LL_PLAT_C
271 MCFOLD ::Matrix const* $getQueryableBoneOrientation(uint64 boneNameHash) const;
272#endif
273
274 MCFOLD ::gsl::span<::SkeletalHierarchyIndex const> $getSkeletalHierarchiesToProcess() const;
275
276#ifdef LL_PLAT_S
277 MCFOLD float $_getActorRenderDeltaTime(::ActorRenderData const&) const;
278#else // LL_PLAT_C
279 MCFOLD float $_getActorRenderDeltaTime(::ActorRenderData const& data) const;
280#endif
281
282
283 // NOLINTEND
284
285public:
286 // vftables
287 // NOLINTBEGIN
288 MCNAPI static void** $vftable();
289 // NOLINTEND
290};
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