Skip to content
LeviMC
English
AutoLightDark
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;
24class Matrix;
26class Model;
28class RenderParams;
29class ScreenContext;
30class Tessellator;
31namespace mce { class Color; }
32namespace mce { class MaterialPtr; }
33// clang-format on
34
35class ModelPart {
36public:
37 // ModelPart inner types declare
38 // clang-format off
39 struct TextureMesh;
40 // clang-format on
41
42 // ModelPart inner types define
43 struct TextureMesh {
44 public:
45 // member variables
46 // NOLINTBEGIN
47 ::ll::UntypedStorage<8, 32> mUnk6a7c78;
48 ::ll::UntypedStorage<8, 56> mUnkddeb87;
49 ::ll::UntypedStorage<4, 12> mUnk202e6d;
50 ::ll::UntypedStorage<4, 12> mUnkb2c2b2;
51 ::ll::UntypedStorage<4, 12> mUnka0bfb0;
52 ::ll::UntypedStorage<4, 12> mUnkc2fbc4;
53 ::ll::UntypedStorage<1, 1> mUnka93767;
54 // NOLINTEND
55
56 public:
57 // prevent constructor by default
58 TextureMesh& operator=(TextureMesh const&);
59 TextureMesh(TextureMesh const&);
60 TextureMesh();
61 };
62
63public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<8, 48, ::HashedString> mName;
67 ::ll::TypedStorage<4, 12, ::Vec3> mPos;
68 ::ll::TypedStorage<4, 12, ::Vec3> mOffset;
69 ::ll::TypedStorage<4, 12, ::Vec3> mRot;
70 ::ll::TypedStorage<4, 12, ::Vec3> mScale;
71 ::ll::TypedStorage<4, 12, ::Vec3> mWorldPos;
72 ::ll::TypedStorage<4, 24, ::AABB> mAABB;
73 ::ll::TypedStorage<4, 4, int> mGroupIndex;
74 ::ll::TypedStorage<4, 4, int> mPartIndex;
75 ::ll::TypedStorage<4, 4, int> mMeshIndex;
76 ::ll::TypedStorage<4, 4, int> mBoneOrientationIndex;
77 ::ll::TypedStorage<8, 24, ::std::vector<::ModelPartLocator>> mLocators;
78 ::ll::TypedStorage<8, 16, ::ExpressionNode> mBinding;
79 ::ll::TypedStorage<1, 1, ::BoneAnimationRelativeMode> mRotationRelativeMode;
80 ::ll::TypedStorage<1, 1, bool> mDebug;
81 ::ll::TypedStorage<4, 4, int const> IndexNotSet;
82 ::ll::TypedStorage<1, 1, bool> mMirror;
83 ::ll::TypedStorage<1, 1, bool> mVisible;
84 ::ll::TypedStorage<4, 4, int> mSkinnedMeshGroupIdentifier;
85 ::ll::TypedStorage<8, 24, ::std::vector<::Cube>> mCubes;
86 ::ll::TypedStorage<8, 24, ::std::vector<::ModelPart::TextureMesh>> mTextureMeshes;
87 ::ll::TypedStorage<8, 128, ::Geometry::NodePolyMesh> mPolyMesh;
88 ::ll::TypedStorage<8, 8, ::ModelPart*> mParent;
89 ::ll::TypedStorage<8, 24, ::std::vector<::ModelPart*>> mChildren;
90 ::ll::TypedStorage<4, 8, ::Vec2> mTexSize;
91 ::ll::TypedStorage<8, 16, ::TextureOffset> mTexOffs;
92 ::ll::TypedStorage<1, 1, bool> mNeverRender;
93 ::ll::TypedStorage<4, 12, ::Vec3> mOriginPos;
94 ::ll::TypedStorage<1, 1, bool> mHasColor;
95 ::ll::TypedStorage<1, 1, bool> mMaterialExpressionsNeedColorVertexFormatField;
96 ::ll::TypedStorage<
97 8,
98 48,
99 ::brstd::flat_map<
100 ::RenderController const*,
101 ::ExpressionNode,
102 ::std::less<::RenderController const*>,
103 ::std::vector<::RenderController const*>,
104 ::std::vector<::ExpressionNode>>>
105 mIsVisibleMap;
106 ::ll::TypedStorage<8, 64, ::std::unordered_map<::RenderController const*, ::ExpressionNode>> mMaterialExpressionMap;
107 // NOLINTEND
108
109public:
110 // prevent constructor by default
111 ModelPart& operator=(ModelPart const&);
112 ModelPart(ModelPart const&);
113 ModelPart();
114
115public:
116 // member functions
117 // NOLINTBEGIN
118 MCNAPI ModelPart(::ModelPart&& rhs);
119
120 MCNAPI ModelPart(int xTexOffs, int yTexOffs, int texWidth, int texHeight);
121
123 ::RenderParams& renderParams,
124 ::gsl::span<::BoneOrientation const> boneOrientations,
125 ::RenderController const* renderControllerId,
127 bool deferred
128 );
129
130 MCNAPI void addBox(::Vec3 const& point0, ::Vec3 const& extents, bool mirror, float g, ::mce::Color const& color);
131
132 MCNAPI void assignPartToGroup(::Model& model, bool forceToUniqueGroup, ::DataDrivenGeometry* owningGeometry);
133
134 MCAPI void compileCubes(::Tessellator& tessellator);
135
136 MCNAPI void compileQuads(::MinecraftGameplayGraphicsResources& gameplayResources, ::Tessellator& tessellator);
137
138 MCNAPI void compileTris(::Tessellator& tessellator);
139
141 ::RenderParams& renderParams,
142 ::gsl::span<::BoneOrientation const> boneOrientations,
143 ::RenderController const* renderControllerId,
145 );
146
148 ::RenderParams& renderParams,
149 ::gsl::span<::BoneOrientation const> boneOrientations,
150 ::RenderController const* renderControllerId,
152 );
153
154 MCNAPI void expandAABB(::AABB& bb) const;
155
156 MCNAPI void LL_CC_V generateBoneTransformMatrices(
157 ::gsl::span<::BoneOrientation> boneOrientations,
158 ::DirectX::XMMATRIX const boneToEntitySpaceMatrix
159 ) const;
160
161 MCNAPI bool isVisible(::RenderParams& renderParams, ::RenderController const* renderControllerId) const;
162
163 MCNAPI bool load(::GeometryPtr source, ::std::string_view nodeName, ::ModelPart* parentPart);
164
165 MCNAPI bool load(
166 ::std::shared_ptr<::ActorResourceDefinition> const resourceDefinition,
167 ::GeometryPtr const source,
168 ::std::string_view nodeName,
169 ::ModelPart* parentPart
170 );
171
172 MCNAPI void loadBoxes(
173 ::Vec3 const& newPivot,
174 ::Vec3 const& offset,
175 ::std::vector<::Geometry::Box> const& boxes,
176 ::Vec3 const& bindPoseRotation
177 );
178
179 MCNAPI void
180 loadPolyMesh(::Vec3 const& newPivot, ::Vec3 const& bindPoseRotation, ::Geometry::NodePolyMesh const& sourceMesh);
181
183 ::std::shared_ptr<::ActorResourceDefinition> const resourceDefinition,
184 ::GeometryPtr const source,
185 ::std::string_view nodeName,
186 ::Vec3 const& basePos,
187 ::Vec3 const& pivot,
188 ::ModelPart* parentPart
189 );
190
192 ::GeometryPtr const source,
193 ::std::string_view nodeName,
194 ::Vec3 const& basePos,
195 ::Vec3 const& pivot,
196 ::ModelPart* parentPart
197 );
198
199 MCNAPI uint64 numCubes() const;
200
201 MCNAPI ::ModelPart& operator=(::ModelPart&& rhs);
202
203 MCNAPI void render(
204 ::ScreenContext& screenContext,
205 ::Model& model,
206 float scale,
207 bool hideParentBodyPart,
208 uint count,
209 ::Matrix boneToEntitySpaceMatrix
210 );
211
212 MCNAPI void renderAtPosition(
213 ::ScreenContext& screenContext,
214 ::Model& model,
215 ::Vec3 const& position,
216 float scale,
217 bool hideParentBodyPart,
218 uint count,
219 ::Matrix boneToEntitySpaceMatrix
220 );
221
222 MCNAPI void reset();
223
224 MCNAPI void setModelPartMaterial(::mce::MaterialPtr const& mat, ::RenderController const* renderControllerId);
225
226 MCNAPI void translateTo(::Matrix& mv, float scale);
227
228 MCNAPI ~ModelPart();
229 // NOLINTEND
230
231public:
232 // constructor thunks
233 // NOLINTBEGIN
234 MCNAPI void* $ctor(::ModelPart&& rhs);
235
236 MCNAPI void* $ctor(int xTexOffs, int yTexOffs, int texWidth, int texHeight);
237 // NOLINTEND
238
239public:
240 // destructor thunk
241 // NOLINTBEGIN
242 MCNAPI void $dtor();
243 // NOLINTEND
244};
Definition AABB.h:18
Definition ActorResourceDefinition.h:5
Definition BoneOrientation.h:16
Definition Cube.h:5
Definition DataDrivenGeometry.h:5
Definition GeometryPtr.h:5
Definition Matrix.h:10
Definition MinecraftGameplayGraphicsResources.h:5
Definition ModelPartLocator.h:11
Definition ModelPart.h:5
MCAPI void translateTo(::Matrix &mv, float scale)
MCAPI void * $ctor(::ModelPart &&rhs)
MCAPI void $dtor()
MCAPI void copyBoneMatricesToSkinnedMeshes(::RenderParams &renderParams, ::gsl::span<::BoneOrientation const > boneOrientations, ::RenderController const *renderControllerId, ::DataDrivenGeometry &geo)
MCAPI void compileQuads(::MinecraftGameplayGraphicsResources &gameplayResources, ::Tessellator &tessellator)
MCAPI uint64 numCubes() const
MCAPI ModelPart(int xTexOffs, int yTexOffs, int texWidth, int texHeight)
MCAPI bool loadWithOrientation_(::GeometryPtr const source, ::std::string_view nodeName, ::Vec3 const &basePos, ::Vec3 const &pivot, ::ModelPart *parentPart)
MCAPI void setModelPartMaterial(::mce::MaterialPtr const &mat, ::RenderController const *renderControllerId)
MCAPI void _copyBoneMatricesToSkinnedMeshes(::RenderParams &renderParams, ::gsl::span<::BoneOrientation const > boneOrientations, ::RenderController const *renderControllerId, ::DataDrivenGeometry &geo, bool deferred)
MCAPI void loadBoxes(::Vec3 const &newPivot, ::Vec3 const &offset, ::std::vector<::Geometry::Box > const &boxes, ::Vec3 const &bindPoseRotation)
MCAPI void compileTris(::Tessellator &tessellator)
MCAPI void renderAtPosition(::ScreenContext &screenContext, ::Model &model, ::Vec3 const &position, float scale, bool hideParentBodyPart, uint count, ::Matrix boneToEntitySpaceMatrix)
MCAPI ModelPart(::ModelPart &&rhs)
MCAPI void LL_CC_V generateBoneTransformMatrices(::gsl::span<::BoneOrientation > boneOrientations, ::DirectX::XMMATRIX const boneToEntitySpaceMatrix) const
MCAPI void reset()
MCAPI bool load(::GeometryPtr source, ::std::string_view nodeName, ::ModelPart *parentPart)
MCAPI bool loadWithOrientation(::std::shared_ptr<::ActorResourceDefinition > const resourceDefinition, ::GeometryPtr const source, ::std::string_view nodeName, ::Vec3 const &basePos, ::Vec3 const &pivot, ::ModelPart *parentPart)
MCAPI void copyBoneMatricesToActor(::RenderParams &renderParams, ::gsl::span<::BoneOrientation const > boneOrientations, ::RenderController const *renderControllerId, ::DataDrivenGeometry &geo)
MCAPI void * $ctor(int xTexOffs, int yTexOffs, int texWidth, int texHeight)
MCAPI bool load(::std::shared_ptr<::ActorResourceDefinition > const resourceDefinition, ::GeometryPtr const source, ::std::string_view nodeName, ::ModelPart *parentPart)
MCAPI void render(::ScreenContext &screenContext, ::Model &model, float scale, bool hideParentBodyPart, uint count, ::Matrix boneToEntitySpaceMatrix)
MCAPI void expandAABB(::AABB &bb) const
MCAPI bool isVisible(::RenderParams &renderParams, ::RenderController const *renderControllerId) const
MCAPI ~ModelPart()
MCAPI::ModelPart & operator=(::ModelPart &&rhs)
MCAPI void assignPartToGroup(::Model &model, bool forceToUniqueGroup, ::DataDrivenGeometry *owningGeometry)
MCAPI void loadPolyMesh(::Vec3 const &newPivot, ::Vec3 const &bindPoseRotation, ::Geometry::NodePolyMesh const &sourceMesh)
MCAPI void addBox(::Vec3 const &point0, ::Vec3 const &extents, bool mirror, float g, ::mce::Color const &color)
Definition Model.h:5
Definition RenderController.h:5
Definition RenderParams.h:29
Definition ScreenContext.h:5
Definition Tessellator.h:5
Definition Vec3.h:10
Definition Color.h:13
Definition MaterialPtr.h:14
Definition Geometry.h:24
Definition ModelPart.h:13