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