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