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/util/MolangVariableMap.h"
10#include "mc/world/actor/RenderParams.h"
11#include "mc/world/actor/SkeletalHierarchyIndex.h"
12#include "mc/world/actor/animation/AnimationComponentGroupType.h"
13#include "mc/world/actor/animation/AnimationComponentID.h"
14#include "mc/world/actor/animation/AttachableSlotIndex.h"
15
16// auto generated forward declare list
17// clang-format off
18class Actor;
24class BoneOrientation;
27class ExpressionNode;
28class Matrix;
31class DataDrivenModel;
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 MCAPI_C ::std::shared_ptr<::AnimationComponent>&
57 getAnimationComponent(::Actor& owner, ::SubClientId subClientId, ::AttachableSlotIndex attachableIndex);
58 // NOLINTEND
59 };
60
61public:
62 // member variables
63 // NOLINTBEGIN
64 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ActorAnimationControllerStatePlayer>>
65 mCurrentAnimationControllerStatePlayer;
66 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ActorAnimationPlayer>>> mComponentAnimationPlayers;
67 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ActorAnimationControllerInfo>>>
68 mOwnedAnimationControllers;
69 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::ModelPartLocator>> mModelPartLocators;
70#ifdef LL_PLAT_S
71 ::ll::TypedStorage<8, 496, ::RenderParams> mRenderParams;
72#else // LL_PLAT_C
73 ::ll::TypedStorage<8, 512, ::RenderParams> mRenderParams;
74#endif
75 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ActorAnimationPlayer>> mPlaySingleAnimation;
76 ::ll::TypedStorage<8, 8, void*> mModelRenderControllerCacheWasBuiltFrom;
77 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::CommonResourceDefinitionMap>> mCommonResourceDefinitionMap;
78 ::ll::TypedStorage<8, 8, ::std::unordered_map<::HashedString, ::HashedString> const*> mParticleEffectMap;
79 ::ll::TypedStorage<8, 64, ::std::function<void(::ActorAnimationPlayer&)>> mAnimationComponentInitFunction;
80 ::ll::TypedStorage<8, 24, ::std::vector<::AnimationComponent::ChildAnimationComponentInfo>>
81 mChildAnimationComponents;
82 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SkeletalHierarchyIndex, ::std::vector<::BoneOrientation>>>
83 mBoneOrientations;
84 ::ll::TypedStorage<1, 1, bool> mAnimationComponentInitialized;
85 ::ll::TypedStorage<4, 4, ::AnimationComponentGroupType> mAnimationComponentGroupType;
86 ::ll::TypedStorage<8, 8, ::AnimationComponentID> mOwnerUUID;
87 ::ll::TypedStorage<8, 8, int64> mLastUpdateFrame;
88 ::ll::TypedStorage<8, 8, uint64> mLastReloadInitTimeStampClient;
89#ifdef LL_PLAT_C
90 ::ll::TypedStorage<8, 24, ::std::vector<::RenderControllerToProcess>> mRenderControllersToProcess;
91 ::ll::TypedStorage<8, 24, ::std::vector<::SkeletalHierarchyIndex>> mSkeletalHierarchiesToProcess;
92 ::ll::TypedStorage<8, 24, ::std::vector<::Matrix>> mQueryableBoneOrientations;
93 ::ll::TypedStorage<1, 1, bool> mAreRenderControllersConstant;
94#endif
95 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::DataDrivenModel const>> mLastModelInitializedWith;
96 ::ll::TypedStorage<1, 1, bool> mApplyAnimations;
97 ::ll::TypedStorage<1, 1, bool> mNeedToUpdateQueryableBoneOrientations;
98 // NOLINTEND
99
100public:
101 // prevent constructor by default
102 AnimationComponent();
103
104public:
105 // virtual functions
106 // NOLINTBEGIN
107 virtual ~AnimationComponent();
108
109 virtual ::ClientAnimationComponent* tryGetClient();
110 // NOLINTEND
111
112public:
113 // member functions
114 // NOLINTBEGIN
115 MCAPI explicit AnimationComponent(::AnimationComponentArguments&& args);
116
117 MCAPI_C void _addAnimationToStatePlayer(
118 ::HashedString const& friendlyName,
119 ::std::shared_ptr<::ActorAnimationControllerStatePlayer> player
120 );
121
122 MCAPI_C ::RenderParams& _prepRenderParamsForActor(::Actor& actor);
123
124 MCAPI void applyAnimations(bool setDefaultPose);
125
126 MCAPI_C bool attemptToSetParentBoneMapping(
127 ::AnimationComponent& parentAnimationComponent,
128 ::BoneOrientation& childBoneOrientation
129 ) const;
130
131 MCAPI ::std::shared_ptr<::ActorAnimationPlayer> createAnimationPlayer(
132 ::HashedString const& friendlyName,
133 ::ExpressionNode const& blendExpression,
134 ::std::set<::HashedString, ::std::hash<::HashedString>>& animationControllerNameStack
135 );
136
137 MCAPI_C ::std::shared_ptr<::ActorAnimationControllerStatePlayer> editGlobalAnimationData(
138 ::HashedString const& friendlyName,
139 float blendOutTime,
140 ::std::string const& stopExpression,
141 ::MolangVersion stopExpressionVersion,
142 ::std::string const& nextStateName,
143 ::std::string const& runtimeController
144 );
145
146 MCAPI_C void ensureClientAnimationComponentIsInitialized();
147
148 MCAPI_C ::std::shared_ptr<::ActorAnimationPlayer> findAnimation(::HashedString const& rawAnimationName);
149
150 MCAPI_C void forceNextUpdateToApplyAnimations();
151
152 MCAPI_C ::std::shared_ptr<::ActorAnimationControllerPlayer>
153 getAnimationControllerPlayer(::HashedString const& destControllerName, bool createIfMissing);
154
155 MCAPI_C ::std::vector<::BoneOrientation>& getBoneOrientations(::DataDrivenGeometry const& sourceGeo);
156
157 MCAPI ::std::vector<::BoneOrientation>*
158 getBoneOrientations(::SkeletalHierarchyIndex skeletalHierarchyIndex, bool missingIsOkay);
159
160 MCAPI_C ::ModelPartLocator* getLocator(::HashedString const& locatorNameHash);
161
162 MCAPI_C ::Matrix const* getQueryableBoneOrientation(uint64 boneNameHash) const;
163
164 MCAPI_C float getRegisteredAnimationLength(::std::string const& friendlyName) const;
165
166 MCAPI_C bool haveInitializedScriptsRun() const;
167
168 MCAPI void initInstanceSpecificAnimationData(::MolangVariableMap* variableMap);
169
170 MCAPI_C void
171 initializeClientAnimationComponent(::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction);
172
173 MCAPI void initializeServerAnimationComponent(
174 ::Actor& actor,
175 ::std::shared_ptr<::CommonResourceDefinitionMap> animationResourceDefinition,
176 ::std::function<void(::ActorAnimationPlayer&)> animationComponentInitFunction
177 );
178
179 MCAPI_C bool isAnimationRegistered(::HashedString const& friendlyName) const;
180
181 MCAPI_C ::std::shared_ptr<::ActorAnimationControllerStatePlayer> playAnimation(
182 ::HashedString const& friendlyName,
183 ::HashedString const& owningStateName,
184 ::std::string const& runtimeController
185 );
186
187 MCAPI void setDirty();
188
189 MCAPI_C void setInitializedScriptsRun(bool);
190
191 MCAPI_C void setupDeltaTimeAndLifeTimeParams(bool incrementLifetime);
192
193 MCAPI_C bool tryRegisterAnimation(::HashedString const& friendlyName, ::ActorSkeletalAnimationPtr animation);
194
195 MCAPI_C void updateQueryableGeometryBoneOrientations();
196
197 MCAPI_C void updateRenderControllersToProcess(
198 ::std::shared_ptr<::DataDrivenModel> itemModel,
199 ::RenderParams& renderParamsToUseForRenderControllerEvalulation
200 );
201 // NOLINTEND
202
203public:
204 // static variables
205 // NOLINTBEGIN
206 MCAPI static ::std::atomic<int64>& mClientFrameIndex();
207
208 MCAPI static ::std::atomic<int64>& mReloadTimeStampClient();
209
210 MCAPI static ::std::atomic<int64>& mServerFrameIndex();
211 // NOLINTEND
212
213public:
214 // constructor thunks
215 // NOLINTBEGIN
216 MCAPI void* $ctor(::AnimationComponentArguments&& args);
217 // NOLINTEND
218
219public:
220 // destructor thunk
221 // NOLINTBEGIN
222 MCAPI void $dtor();
223 // NOLINTEND
224
225public:
226 // virtual function thunks
227 // NOLINTBEGIN
228 MCFOLD ::ClientAnimationComponent* $tryGetClient();
229
230
231 // NOLINTEND
232
233public:
234 // vftables
235 // NOLINTBEGIN
236 MCNAPI static void** $vftable();
237 // NOLINTEND
238};
Definition ActorAnimationControllerInfo.h:13
Definition ActorAnimationControllerPlayer.h:22
Definition ActorAnimationControllerStatePlayer.h:23
Definition ActorAnimationPlayer.h:19
Definition ActorSkeletalAnimationPtr.h:10
Definition Actor.h:105
static MCAPI void ** $vftable()
Definition BoneOrientation.h:19
Definition CommonResourceDefinitionMap.h:14
Definition DataDrivenGeometry.h:23
Definition DataDrivenModel.h:5
Definition ExpressionNode.h:33
Definition HashedString.h:5
Definition Matrix.h:5
Definition ModelPartLocator.h:11
Definition MolangVariableMap.h:17
Definition RenderParams.h:30
Definition AnimationComponentArguments.h:13
Definition AnimationComponent.h:44
Definition ClientAnimationComponent.h:5
Definition RenderControllerToProcess.h:5