LeviLamina
Loading...
Searching...
No Matches
ActorRenderer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/renderer/BaseActorRenderer.h"
7#include "mc/deps/core/container/small_vector_base.h"
8#include "mc/deps/minecraft_renderer/renderer/MaterialPtr.h"
9#include "mc/deps/minecraft_renderer/renderer/TexturePtr.h"
10#include "mc/world/phys/AABB.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
15class ActorRenderData;
17class Model;
18class RenderParams;
19class Tessellator;
20class Vec2;
21class Vec3;
22struct ActorTextureInfo;
23struct ActorUniqueID;
25struct RopePoints;
26namespace mce { class Color; }
27namespace mce { class Mesh; }
28namespace mce { class TextureGroup; }
29// clang-format on
30
31class ActorRenderer : public ::BaseActorRenderer, public ::std::enable_shared_from_this<::ActorRenderer> {
32public:
33 // ActorRenderer inner types declare
34 // clang-format off
35 struct LeashPins;
36 // clang-format on
37
38 // ActorRenderer inner types define
39 struct LeashPins {
40 public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::UntypedStorage<4, 12> mUnkadd485;
44 ::ll::UntypedStorage<4, 12> mUnk9c3e04;
45 ::ll::UntypedStorage<4, 12> mUnk95cfb7;
46 ::ll::UntypedStorage<4, 12> mUnkc010bc;
47 ::ll::UntypedStorage<4, 12> mUnk8a6402;
48 // NOLINTEND
49
50 public:
51 // prevent constructor by default
52 LeashPins& operator=(LeashPins const&);
53 LeashPins(LeashPins const&);
54 LeashPins();
55 };
56
57public:
58 // member variables
59 // NOLINTBEGIN
60 ::ll::TypedStorage<1, 1, bool> mRenderingInventory;
61 ::ll::TypedStorage<1, 1, bool const> mHasWaterHole;
62 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mEntityAlphatestMaterial;
63 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mEntityAlphatestGlintMaterial;
64 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mGlintTexture;
65 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mAtlasTexture;
66 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::TextureGroup>> mTextureGroup;
67 ::ll::TypedStorage<4, 24, ::AABB> mBaseRenderBounds;
68 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Model>> mModel;
69 // NOLINTEND
70
71public:
72 // prevent constructor by default
73 ActorRenderer();
74
75public:
76 // virtual functions
77 // NOLINTBEGIN
78 virtual ~ActorRenderer() /*override*/;
79
80 virtual void render(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData) = 0;
81
82 virtual void renderDebug(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
83
84 virtual void renderEffects(::BaseActorRenderContext& renderContext, ::ActorRenderData& actorRenderData);
85
86 virtual void renderLeash(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
87
88 virtual void renderWaterHole(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
89
90 virtual void addAdditionalRenderingIfNeeded(::std::shared_ptr<::mce::TextureGroup> textureGroup);
91
92 virtual ::AABB getRenderBounds(::Actor const& entity) const;
93
94 virtual void getLeashOffsets(
95 ::Actor& yRot,
96 float yRotPrev,
97 float a,
98 float legacyOffset,
99 bool output,
100 ::Bedrock::small_vector_base<::Vec3>&
101 ) const;
102
103 virtual void setIsOnScreen(::Actor& actor, bool const isOnScreen, float distance) const;
104
105 virtual bool shouldUpdateBonesAndEffectsIfOffScreen(::RenderParams& renderParams) const;
106
107 virtual bool shouldUpdateEffectsIfOffScreen(::RenderParams& renderParams) const;
108 // NOLINTEND
109
110public:
111 // member functions
112 // NOLINTBEGIN
113 MCAPI ActorRenderer(
114 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
115 ::Vec2 const& renderDim,
116 ::Vec3 const& renderDimOffset,
117 bool hasWaterHole
118 );
119
120 MCAPI ActorRenderer(
121 ::std::shared_ptr<::Model> model,
122 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
123 ::Vec2 const& renderDim,
124 ::Vec3 const& renderDimOffset,
125 bool hasWaterHole
126 );
127
128 MCAPI void _getLeashPins(
129 float actorFrameAlpha,
130 ::BaseActorRenderContext& renderContext,
131 ::Actor& actor,
132 ::Bedrock::small_vector_base<::ActorRenderer::LeashPins>& output
133 ) const;
134
135 MCAPI ::std::vector<::NameTagRenderObject> extractText(
136 ::Tessellator& tessellator,
137 ::Actor const& entity,
138 ::std::string const& str,
139 ::std::vector<int> const& widths,
140 ::Vec3 camTargetPos,
141 float a,
142 ::mce::Color color
143 );
144
145 MCAPI ::mce::TexturePtr getAtlasTexture();
146
147 MCFOLD ::Model const* getModel() const;
148
149 MCFOLD ::Model* getModel();
150
151 MCAPI void renderGui(::BaseActorRenderContext& renderContext, ::ActorRenderData& actorRenderData);
152 // NOLINTEND
153
154public:
155 // static functions
156 // NOLINTBEGIN
157 MCAPI static void _addLeashPinToOutput(
158 ::Vec3 const& fromLeashes,
159 ::Vec3 const& toLeashes,
160 ::Actor const& actor,
161 ::Actor const* roper,
162 ::ActorUniqueID roperID,
163 uint64 ropeIndex,
164 float actorFrameAlpha,
165 ::Bedrock::small_vector_base<::ActorRenderer::LeashPins>& output
166 );
167
168 MCAPI static void _buildFlameMesh(::Tessellator& tessellator, ::std::shared_ptr<::mce::TextureGroup> textureGroup);
169
170 MCAPI static void _drawClassicLeash(
171 ::BaseActorRenderContext& renderContext,
172 ::Vec3 const& ropeStart,
173 ::Vec3 const& delta,
174 ::mce::TexturePtr& tex
175 );
176
177 MCAPI static void _drawRopeRange(
178 ::BaseActorRenderContext& renderContext,
179 int begin,
180 int end,
181 ::Vec3 const& basisX,
182 ::Vec3 const& basisY,
183 ::Vec3 const& deltaNorm,
184 ::RopePoints const& nodes,
185 ::mce::TexturePtr& tex,
186 float a,
187 ::Vec3* startPoint,
188 ::Vec3* endPoint
189 );
190
191 MCAPI static void _getLeashPins(
192 float actorFrameAlpha,
193 ::BaseActorRenderContext& renderContext,
194 ::Actor& actor,
195 ::Bedrock::small_vector_base<::ActorRenderer::LeashPins>& output,
196 ::Bedrock::small_vector_base<::Vec3>& leashFromOffsets
197 );
198
199 MCAPI static bool isDitheringEnabled(::BaseActorRenderContext const& renderContext, ::Actor const& actor);
200
201 MCAPI static void renderDebugAttachPos(int renderAttachPos, ::Actor const& mob);
202
203 MCAPI static void renderFlame(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
204
205 MCAPI static void renderLeash(
206 ::BaseActorRenderContext& renderContext,
207 ::ActorRenderData& entityRenderData,
208 ::Bedrock::small_vector_base<::ActorRenderer::LeashPins>& allLeashPins
209 );
210
211 MCAPI static void resetTextures();
212
213 MCAPI static bool shouldRenderLeash(::Actor& entity, bool ignoreLighting);
214 // NOLINTEND
215
216public:
217 // static variables
218 // NOLINTBEGIN
219 MCAPI static ::Vec2 const& DEFAULT_RENDER_BOUNDS();
220
221 MCAPI static ::mce::MaterialPtr& mFlameMaterial();
222
223 MCAPI static ::mce::Mesh& mFlameMesh();
224
225 MCAPI static ::ActorTextureInfo& mFlameTexture();
226
227 MCAPI static ::mce::MaterialPtr& mLeashMat();
228
229 MCAPI static ::mce::TexturePtr& mLeashTexture();
230 // NOLINTEND
231
232public:
233 // constructor thunks
234 // NOLINTBEGIN
235 MCAPI void* $ctor(
236 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
237 ::Vec2 const& renderDim,
238 ::Vec3 const& renderDimOffset,
239 bool hasWaterHole
240 );
241
242 MCAPI void* $ctor(
243 ::std::shared_ptr<::Model> model,
244 ::std::shared_ptr<::mce::TextureGroup> textureGroup,
245 ::Vec2 const& renderDim,
246 ::Vec3 const& renderDimOffset,
247 bool hasWaterHole
248 );
249 // NOLINTEND
250
251public:
252 // destructor thunk
253 // NOLINTBEGIN
254 MCAPI void $dtor();
255 // NOLINTEND
256
257public:
258 // virtual function thunks
259 // NOLINTBEGIN
260 MCAPI void $renderDebug(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
261
262 MCFOLD void $renderEffects(::BaseActorRenderContext& renderContext, ::ActorRenderData& actorRenderData);
263
264 MCAPI void $renderLeash(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
265
266 MCFOLD void $renderWaterHole(::BaseActorRenderContext& renderContext, ::ActorRenderData& entityRenderData);
267
268 MCFOLD void $addAdditionalRenderingIfNeeded(::std::shared_ptr<::mce::TextureGroup> textureGroup);
269
270 MCAPI ::AABB $getRenderBounds(::Actor const& entity) const;
271
272 MCAPI void $getLeashOffsets(
273 ::Actor& yRot,
274 float yRotPrev,
275 float a,
276 float legacyOffset,
277 bool output,
278 ::Bedrock::small_vector_base<::Vec3>&
279 ) const;
280
281 MCFOLD void $setIsOnScreen(::Actor& actor, bool const isOnScreen, float distance) const;
282
283 MCFOLD bool $shouldUpdateBonesAndEffectsIfOffScreen(::RenderParams& renderParams) const;
284
285 MCFOLD bool $shouldUpdateEffectsIfOffScreen(::RenderParams& renderParams) const;
286 // NOLINTEND
287
288public:
289 // vftables
290 // NOLINTBEGIN
291 MCNAPI static void** $vftable();
292 // NOLINTEND
293};
Definition ActorRenderData.h:5
Definition ActorRenderer.h:5
static MCAPI void ** $vftable()
Definition Actor.h:125
Definition BaseActorRenderContext.h:5
Definition BaseActorRenderer.h:5
Definition Model.h:5
Definition RenderParams.h:30
Definition Tessellator.h:5
Definition Vec2.h:5
Definition Vec3.h:10
Definition Color.h:13
Definition Mesh.h:7
Definition TextureGroup.h:7
Definition ActorRenderer.h:13
Definition ActorTextureInfo.h:5
Definition ActorUniqueID.h:10
Definition NameTagRenderObject.h:5
Definition RopePoints.h:11