LeviLamina
Loading...
Searching...
No Matches
ModelPart.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/model/Geometry.h"
7#include "mc/client/model/geom/TextureOffset.h"
8#include "mc/client/renderer/controller/RenderController.h"
9#include "mc/deps/core/math/Vec2.h"
10#include "mc/deps/core/math/Vec3.h"
11#include "mc/deps/core/string/HashedString.h"
12#include "mc/platform/brstd/flat_map.h"
13#include "mc/util/molang/ExpressionNode.h"
14#include "mc/world/actor/animation/BoneAnimationRelativeMode.h"
15#include "mc/world/phys/AABB.h"
16
17// auto generated forward declare list
18// clang-format off
20class BoneOrientation;
21class Cube;
23class GeometryPtr;
25class Matrix;
27class Model;
29class RenderParams;
30class ScreenContext;
31class Tessellator;
32namespace mce { class Color; }
33namespace mce { class MaterialPtr; }
34// clang-format on
35
36class ModelPart {
37public:
38 // ModelPart inner types declare
39 // clang-format off
40 struct TextureMesh;
41 // clang-format on
42
43 // ModelPart inner types define
44 struct TextureMesh {
45 public:
46 // member variables
47 // NOLINTBEGIN
48 ::ll::UntypedStorage<8, 32> mUnk6a7c78;
49 ::ll::UntypedStorage<8, 56> mUnkddeb87;
50 ::ll::UntypedStorage<4, 12> mUnk202e6d;
51 ::ll::UntypedStorage<4, 12> mUnkb2c2b2;
52 ::ll::UntypedStorage<4, 12> mUnka0bfb0;
53 ::ll::UntypedStorage<4, 12> mUnkc2fbc4;
54 ::ll::UntypedStorage<1, 1> mUnka93767;
55 // NOLINTEND
56
57 public:
58 // prevent constructor by default
59 TextureMesh& operator=(TextureMesh const&);
60 TextureMesh();
61
62 public:
63 // member functions
64 // NOLINTBEGIN
66 // NOLINTEND
67
68 public:
69 // constructor thunks
70 // NOLINTBEGIN
71 MCNAPI void* $ctor(::ModelPart::TextureMesh const&);
72 // NOLINTEND
73 };
74
75public:
76 // member variables
77 // NOLINTBEGIN
78 ::ll::TypedStorage<8, 48, ::HashedString> mName;
79 ::ll::TypedStorage<4, 12, ::Vec3> mPos;
80 ::ll::TypedStorage<4, 12, ::Vec3> mOffset;
81 ::ll::TypedStorage<4, 12, ::Vec3> mRot;
82 ::ll::TypedStorage<4, 12, ::Vec3> mScale;
83 ::ll::TypedStorage<4, 12, ::Vec3> mWorldPos;
84 ::ll::TypedStorage<4, 24, ::AABB> mAABB;
85 ::ll::TypedStorage<4, 4, int> mGroupIndex;
86 ::ll::TypedStorage<4, 4, int> mPartIndex;
87 ::ll::TypedStorage<4, 4, int> mMeshIndex;
88 ::ll::TypedStorage<4, 4, int> mBoneOrientationIndex;
89 ::ll::TypedStorage<8, 24, ::std::vector<::ModelPartLocator>> mLocators;
90 ::ll::TypedStorage<8, 16, ::ExpressionNode> mBinding;
91 ::ll::TypedStorage<1, 1, ::BoneAnimationRelativeMode> mRotationRelativeMode;
92 ::ll::TypedStorage<1, 1, bool> mDebug;
93 ::ll::TypedStorage<4, 4, int const> IndexNotSet;
94 ::ll::TypedStorage<1, 1, bool> mMirror;
95 ::ll::TypedStorage<1, 1, bool> mVisible;
96 ::ll::TypedStorage<4, 4, int> mSkinnedMeshGroupIdentifier;
97 ::ll::TypedStorage<8, 24, ::std::vector<::Cube>> mCubes;
98 ::ll::TypedStorage<8, 24, ::std::vector<::ModelPart::TextureMesh>> mTextureMeshes;
99 ::ll::TypedStorage<8, 128, ::Geometry::NodePolyMesh> mPolyMesh;
100 ::ll::TypedStorage<8, 8, ::ModelPart*> mParent;
101 ::ll::TypedStorage<8, 24, ::std::vector<::ModelPart*>> mChildren;
102 ::ll::TypedStorage<4, 8, ::Vec2> mTexSize;
103 ::ll::TypedStorage<8, 16, ::TextureOffset> mTexOffs;
104 ::ll::TypedStorage<1, 1, bool> mNeverRender;
105 ::ll::TypedStorage<4, 12, ::Vec3> mOriginPos;
106 ::ll::TypedStorage<1, 1, bool> mHasColor;
107 ::ll::TypedStorage<1, 1, bool> mMaterialExpressionsNeedColorVertexFormatField;
108 ::ll::TypedStorage<
109 8,
110 48,
112 ::RenderController const*,
114 ::std::less<::RenderController const*>,
115 ::std::vector<::RenderController const*>,
116 ::std::vector<::ExpressionNode>>>
117 mIsVisibleMap;
118 ::ll::TypedStorage<8, 64, ::std::unordered_map<::RenderController const*, ::ExpressionNode>> mMaterialExpressionMap;
119 // NOLINTEND
120
121public:
122 // prevent constructor by default
123 ModelPart& operator=(ModelPart const&);
124 ModelPart(ModelPart const&);
125 ModelPart();
126
127public:
128 // member functions
129 // NOLINTBEGIN
130 MCAPI ModelPart(::ModelPart&& rhs);
131
132 MCAPI ModelPart(int xTexOffs, int yTexOffs, int texWidth, int texHeight);
133
134 MCAPI void _addBoxMapTexWithFaceUVs(::Vec3 const& point0, ::Geometry::Box const& box);
135
136 MCAPI void _adjustUVsInward(
137 ::std::vector<::Vec2>& uvs,
138 ::std::vector<::std::array<::Geometry::NodeVertex, 3>> const& tris,
139 ::std::vector<::std::array<::Geometry::NodeVertex, 4>> const& quads,
140 ::Vec2 const& textureSize
141 );
142
143 MCAPI void _copyBoneMatricesToSkinnedMeshes(
144 ::RenderParams& renderParams,
145 ::gsl::span<::BoneOrientation const> boneOrientations,
146 ::RenderController const* renderControllerId,
148 bool deferred
149 );
150
151 MCAPI void addBox(::Vec3 const& point0, ::Vec3 const& extents, bool mirror, float g, ::mce::Color const& color);
152
153 MCAPI ::ModelPart&
154 addBoxMapTex(::Vec3 const& point0, ::Vec3 const& extents, ::TextureOffset const& inTexOffset, bool mirror, float g);
155
156 MCAPI void assignPartToGroup(::Model& model, bool forceToUniqueGroup, ::DataDrivenGeometry* owningGeometry);
157
158 MCAPI void compileCubes(::Tessellator& tessellator);
159
160 MCAPI void compileQuads(::MinecraftGameplayGraphicsResources& gameplayResources, ::Tessellator& tessellator);
161
162 MCAPI void compileTris(::Tessellator& tessellator);
163
164 MCAPI void copyBoneMatricesToActor(
165 ::RenderParams& renderParams,
166 ::gsl::span<::BoneOrientation const> boneOrientations,
167 ::RenderController const* renderControllerId,
169 );
170
171 MCAPI void copyBoneMatricesToSkinnedMeshes(
172 ::RenderParams& renderParams,
173 ::gsl::span<::BoneOrientation const> boneOrientations,
174 ::RenderController const* renderControllerId,
176 );
177
178 MCAPI void expandAABB(::AABB& bb) const;
179
180 MCAPI void expandAABBWithCompiledGeometry(::AABB& bb) const;
181
182 MCAPI void LL_CC_V generateBoneTransformMatrices(
183 ::RenderParams& renderParams,
184 ::gsl::span<::BoneOrientation> boneOrientations,
185 ::RenderController const* renderControllerId,
186 ::DirectX::XMMATRIX boneToEntitySpaceMatrix
187 );
188
189 MCFOLD bool getNeverRender() const;
190
191 MCAPI ::Vec3 const& getOrigin() const;
192
193 MCFOLD ::ModelPart* getParent() const;
194
195 MCAPI void getPolyCounts(int& triVertexCount, int& quadVertexCount);
196
197 MCAPI void getTotalPolyCounts(uint64& triVertexCount, uint64& quadVertexCount) const;
198
199 MCAPI bool isVisible(::RenderParams& renderParams, ::RenderController const* renderControllerId) const;
200
201 MCAPI bool load(::GeometryPtr source, ::std::string_view nodeName, ::ModelPart* parentPart);
202
203 MCAPI bool load(
204 ::std::shared_ptr<::ActorResourceDefinition> resourceDefinition,
205 ::GeometryPtr source,
206 ::std::string_view nodeName,
207 ::ModelPart* parentPart
208 );
209
210 MCAPI void loadBoxes(
211 ::Vec3 const& newPivot,
212 ::Vec3 const& offset,
213 ::std::vector<::Geometry::Box> const& boxes,
214 ::Vec3 const& bindPoseRotation
215 );
216
217 MCAPI void
218 loadPolyMesh(::Vec3 const& newPivot, ::Vec3 const& bindPoseRotation, ::Geometry::NodePolyMesh const& sourceMesh);
219
220 MCAPI void loadTextureMeshes(
221 ::std::shared_ptr<::ActorResourceDefinition> resourceDefinition,
222 ::Vec3 const& newPivot,
223 ::Vec3 const& sourceTextureMeshes,
224 ::std::vector<::Geometry::NodeTextureMesh> const&
225 );
226
227 MCAPI bool loadWithOrientation(
228 ::std::shared_ptr<::ActorResourceDefinition> resourceDefinition,
229 ::GeometryPtr source,
230 ::std::string_view nodeName,
231 ::Vec3 const& basePos,
232 ::Vec3 const& pivot,
233 ::ModelPart* parentPart
234 );
235
236 MCAPI bool loadWithOrientation_(
237 ::GeometryPtr source,
238 ::std::string_view nodeName,
239 ::Vec3 const& basePos,
240 ::Vec3 const& pivot,
241 ::ModelPart* parentPart
242 );
243
244 MCAPI bool needsColourVertexFormatField(::MaterialVariants const& defaultMaterialVariants) const;
245
246 MCAPI uint64 numCubes() const;
247
248 MCAPI ::ModelPart& operator=(::ModelPart&& rhs);
249
250 MCAPI void render(
251 ::ScreenContext& screenContext,
252 ::Model& model,
253 float scale,
254 bool hideParentBodyPart,
255 uint count,
256 ::Matrix boneToEntitySpaceMatrix
257 );
258
259 MCAPI void renderAtPosition(
260 ::ScreenContext& screenContext,
261 ::Model& model,
262 ::Vec3 const& position,
263 float scale,
264 bool hideParentBodyPart,
265 uint count,
266 ::Matrix boneToEntitySpaceMatrix
267 );
268
269 MCAPI void reset();
270
271 MCAPI void setModelPartMaterial(::mce::MaterialPtr const& mat, ::RenderController const* renderControllerId);
272
273 MCAPI void setModelPartMaterial(
274 ::ExpressionNode const& materialExpression,
275 ::RenderController const* renderControllerId,
276 bool needsColor
277 );
278
279 MCAPI void setOrigin(::Vec3 const& origin);
280
281 MCFOLD void setPos(::Vec3 const& inPos);
282
283 MCAPI ::ModelPart& setTexSize(int xs, int ys);
284
285 MCAPI void setVisibility(::ExpressionNode const& visibility, ::RenderController const* renderControllerId);
286
287 MCAPI void setVisible(bool isVisible);
288
289 MCAPI void translateTo(::Matrix& mv, float scale);
290
291 MCAPI ~ModelPart();
292 // NOLINTEND
293
294public:
295 // constructor thunks
296 // NOLINTBEGIN
297 MCAPI void* $ctor(::ModelPart&& rhs);
298
299 MCAPI void* $ctor(int xTexOffs, int yTexOffs, int texWidth, int texHeight);
300 // NOLINTEND
301
302public:
303 // destructor thunk
304 // NOLINTBEGIN
305 MCAPI void $dtor();
306 // NOLINTEND
307};
Definition AABB.h:18
Definition ActorResourceDefinition.h:5
Definition BoneOrientation.h:16
Definition Cube.h:5
Definition DataDrivenGeometry.h:5
Definition ExpressionNode.h:36
Definition GeometryPtr.h:5
Definition MaterialVariants.h:8
Definition Matrix.h:10
Definition MinecraftGameplayGraphicsResources.h:5
Definition ModelPartLocator.h:11
Definition ModelPart.h:5
Definition Model.h:5
Definition RenderController.h:5
Definition RenderParams.h:30
Definition ScreenContext.h:5
Definition Tessellator.h:5
Definition TextureOffset.h:5
Definition Vec2.h:5
Definition Vec3.h:10
Definition flat_map.h:15
Definition Color.h:13
Definition MaterialPtr.h:15
Definition Geometry.h:20
Definition Geometry.h:24
Definition ModelPart.h:13
MCAPI TextureMesh(::ModelPart::TextureMesh const &)
MCAPI void * $ctor(::ModelPart::TextureMesh const &)