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
8// auto generated forward declare list
9// clang-format off
10class AABB;
11class BoneOrientation;
13class GeometryPtr;
14class Matrix;
16class RenderParams;
17class TextureOffset;
18class Vec2;
19class Vec3;
20namespace mce { class Color; }
21namespace mce { class MaterialPtr; }
23class Model;
24class ScreenContext;
25class Tessellator;
27// clang-format on
28
29class ModelPart {
30public:
31 // ModelPart inner types declare
32 // clang-format off
33 struct TextureMesh;
34 // clang-format on
35
36 // ModelPart inner types define
37 struct TextureMesh {
38 public:
39 // member variables
40 // NOLINTBEGIN
48 // NOLINTEND
49
50 public:
51 // prevent constructor by default
52 TextureMesh& operator=(TextureMesh const&);
53 TextureMesh(TextureMesh const&);
54 TextureMesh();
55 };
56
57public:
58 // member variables
59 // NOLINTBEGIN
92 // NOLINTEND
93
94public:
95 // prevent constructor by default
96 ModelPart& operator=(ModelPart const&);
97 ModelPart(ModelPart const&);
98 ModelPart();
99
100public:
101 // member functions
102 // NOLINTBEGIN
103 MCNAPI_C void _adjustUVsInward(
104 ::std::vector<::Vec2>& uvs,
105 ::std::vector<::std::array<::Geometry::NodeVertex, 3>> const& tris,
106 ::std::vector<::std::array<::Geometry::NodeVertex, 4>> const& quads,
107 ::Vec2 const& textureSize
108 );
109
110 MCNAPI_C void _copyBoneMatricesToSkinnedMeshes(
111 ::RenderParams& renderParams,
112 ::gsl::span<::BoneOrientation const> boneOrientations,
113 ::RenderController const* renderControllerId,
115 bool deferred
116 );
117
118 MCNAPI_C void addBox(::Vec3 const& point0, ::Vec3 const& extents, bool mirror, float g, ::mce::Color const& color);
119
120 MCNAPI_C ::ModelPart&
121 addBoxMapTex(::Vec3 const& point0, ::Vec3 const& extents, ::TextureOffset const& inTexOffset, bool mirror, float g);
122
123 MCNAPI_C void assignPartToGroup(::Model& model, bool forceToUniqueGroup);
124
125 MCNAPI_C void assignPartToGroup(::Model& model, bool forceToUniqueGroup, ::DataDrivenGeometry* owningGeometry);
126
127 MCNAPI_C void compileCubes(::Tessellator& tessellator);
128
129 MCNAPI_C void compileQuads(::MinecraftGameplayGraphicsResources& gameplayResources, ::Tessellator& tessellator);
130
131 MCNAPI_C void compileTris(::Tessellator& tessellator);
132
133 MCNAPI_C void copyBoneMatricesToActor(
134 ::RenderParams& renderParams,
135 ::gsl::span<::BoneOrientation const> boneOrientations,
136 ::RenderController const* renderControllerId,
138 );
139
140 MCNAPI_C void expandAABB(::AABB& bb) const;
141
142 MCNAPI_C void generateBoneTransformMatrices(
143 ::RenderParams& renderParams,
144 ::gsl::span<::BoneOrientation> boneOrientations,
145 ::RenderController const* renderControllerId,
146 ::Matrix boneToEntitySpaceMatrix
147 );
148
149 MCNAPI_C void getPolyCounts(int& triVertexCount, int& quadVertexCount);
150
151 MCNAPI_C bool isVisible(::RenderParams& renderParams, ::RenderController const* renderControllerId) const;
152
153 MCNAPI_C bool load(::GeometryPtr source, ::std::string_view nodeName, ::ModelPart* parentPart);
154
155 MCNAPI_C bool load(
156 ::std::shared_ptr<::ActorResourceDefinition> resourceDefinition,
157 ::GeometryPtr source,
158 ::std::string_view nodeName,
159 ::ModelPart* parentPart
160 );
161
162 MCNAPI_C void loadBoxes(
163 ::Vec3 const& newPivot,
164 ::Vec3 const& offset,
165 ::std::vector<::Geometry::Box> const& boxes,
166 ::Vec3 const& bindPoseRotation
167 );
168
169 MCNAPI_C void
170 loadPolyMesh(::Vec3 const& newPivot, ::Vec3 const& bindPoseRotation, ::Geometry::NodePolyMesh const& sourceMesh);
171
172 MCNAPI_C void loadTextureMeshes(
173 ::std::shared_ptr<::ActorResourceDefinition> resourceDefinition,
174 ::Vec3 const& newPivot,
175 ::Vec3 const&,
176 ::std::vector<::Geometry::NodeTextureMesh> const& sourceTextureMeshes
177 );
178
179 MCNAPI_C bool loadWithOrientation(
180 ::std::shared_ptr<::ActorResourceDefinition> resourceDefinition,
181 ::GeometryPtr source,
182 ::std::string_view nodeName,
183 ::Vec3 const& basePos,
184 ::Vec3 const& pivot,
185 ::ModelPart* parentPart
186 );
187
188 MCNAPI_C bool loadWithOrientation_(
189 ::GeometryPtr source,
190 ::std::string_view nodeName,
191 ::Vec3 const& basePos,
192 ::Vec3 const& pivot,
193 ::ModelPart* parentPart
194 );
195
196 MCNAPI_C uint64 numCubes() const;
197
198 MCNAPI_C void render(
199 ::ScreenContext& screenContext,
200 ::Model& model,
201 float scale,
202 bool hideParentBodyPart,
203 uint count,
204 ::Matrix boneToEntitySpaceMatrix
205 );
206
207 MCNAPI_C void renderAtPosition(
208 ::ScreenContext& screenContext,
209 ::Model& model,
210 ::Vec3 const& position,
211 float scale,
212 bool hideParentBodyPart,
213 uint count,
214 ::Matrix boneToEntitySpaceMatrix
215 );
216
217 MCNAPI_C void setModelPartMaterial(::mce::MaterialPtr const& mat, ::RenderController const* renderControllerId);
218
219 MCNAPI_C void translateTo(::Matrix& mv, float scale);
220 // NOLINTEND
221
222public:
223 // constructor thunks
224 // NOLINTBEGIN
225 MCNAPI_C void* $ctor(::ModelPart&& rhs);
226
227 MCNAPI_C void* $ctor(int xTexOffs, int yTexOffs, int texWidth, int texHeight);
228 // NOLINTEND
229
230public:
231 // destructor thunk
232 // NOLINTBEGIN
233 MCNAPI_C void $dtor();
234 // NOLINTEND
235};
Definition AABB.h:18
Definition BoneOrientation.h:19
Definition DataDrivenGeometry.h:19
Definition GeometryPtr.h:10
Definition Matrix.h:5
Definition MinecraftGameplayGraphicsResources.h:5
Definition Model.h:5
Definition RenderController.h:20
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 Color.h:13
Definition MaterialPtr.h:15
Definition ActorResourceDefinition.h:5
Definition Geometry.h:135
Definition ModelPart.h:37
Definition Alias.h:14