LeviLamina
Loading...
Searching...
No Matches
Tessellator.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec3.h"
7#include "mc/deps/core_graphics/enums/PrimitiveMode.h"
8#include "mc/deps/minecraft_renderer/renderer/MeshData.h"
9
10// auto generated forward declare list
11// clang-format off
12class Vec2;
14namespace mce { class Color; }
15namespace mce { class MaterialPtr; }
16namespace mce { class Mesh; }
17namespace mce { class TexturePtr; }
18namespace mce { struct BufferResourceService; }
19// clang-format on
20
21class Tessellator {
22public:
23 // Tessellator inner types declare
24 // clang-format off
26 // clang-format on
27
28 // Tessellator inner types define
29 enum class UploadMode : int {};
30
31 enum class SupplementaryFieldAutoGenerationMode : int {};
32
33 struct DebugContextCallback {};
34
35 using Index = uint;
36
37public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<1, 1, bool> mIsFormatFixed;
41 ::ll::TypedStorage<8, 288, ::mce::MeshData> mMeshData;
42 ::ll::TypedStorage<1, 1, bool> mHasNormals;
43 ::ll::TypedStorage<8, 8, uint64> mNextReserve;
44 ::ll::TypedStorage<4, 20, ::std::optional<::glm::vec4>> mNextNormal;
45 ::ll::TypedStorage<4, 36, ::std::optional<::glm::vec2>[3]> mNextUV;
46 ::ll::TypedStorage<4, 8, ::std::optional<uint>> mNextColor;
47 ::ll::TypedStorage<2, 4, ::std::optional<ushort>> mNextBoneId;
48 ::ll::TypedStorage<2, 4, ::std::optional<ushort>> mNextPBRTextureIdx;
49 ::ll::TypedStorage<4, 8, ::std::optional<uint>> mNextMERS;
50 ::ll::TypedStorage<1, 1, bool> mIndexPhase;
51 ::ll::TypedStorage<4, 12, ::Vec3> mPostTransformOffset;
52 ::ll::TypedStorage<4, 12, ::Vec3> mPostTransformScale;
53 ::ll::TypedStorage<1, 1, uchar> mQuadFacing;
54 ::ll::TypedStorage<1, 1, bool> mQuadTwoSided;
55 ::ll::TypedStorage<8, 24, ::std::vector<::TessellatorQuadInfo>> mQuadInfoList;
56 ::ll::TypedStorage<4, 12, ::Vec3> mFaceCenterAccumulator;
57 ::ll::TypedStorage<4, 4, int> mCurQuadVertex;
58 ::ll::TypedStorage<1, 1, bool> mApplyTransform;
59 ::ll::TypedStorage<4, 64, ::glm::mat4x4> mTransformMatrix;
60 ::ll::TypedStorage<1, 1, bool> mNoColor;
61 ::ll::TypedStorage<1, 1, bool> mVoidBeginEnd;
62 ::ll::TypedStorage<1, 1, bool> mForceTessellateIntercept;
63 ::ll::TypedStorage<
64 8,
65 64,
66 ::std::function<void(::Tessellator const&, ::mce::MaterialPtr const&, ::mce::TexturePtr const&)>>
67 mInterceptTessellator;
68 ::ll::TypedStorage<4, 4, uint> mCount;
69 ::ll::TypedStorage<4, 4, uint> mMaxVertexCount;
70 ::ll::TypedStorage<1, 1, bool> mTessellating;
71 ::ll::TypedStorage<1, 1, bool> mBuildFaceData;
72 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::mce::Mesh>> mPreGeneratedMesh;
73 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::mce::BufferResourceService>> mBufferResourceService;
74 // NOLINTEND
75
76public:
77 // prevent constructor by default
78 Tessellator();
79
80public:
81 // member functions
82 // NOLINTBEGIN
83 MCAPI explicit Tessellator(::std::weak_ptr<::mce::BufferResourceService> bufferResourceService);
84
85 MCAPI void _tex(::Vec2 const& coord, int unit);
86
87 MCAPI void addPostTransformOffset(float x, float y, float z);
88
89 MCAPI void
90 begin(::Tessellator::DebugContextCallback debugContextCallback, int reservedVertices, bool buildFaceData);
91
92 MCAPI void begin(
93 ::Tessellator::DebugContextCallback debugContextCallback,
94 ::mce::PrimitiveMode mode,
95 int reservedVertices,
96 bool buildFaceData
97 );
98
99 MCAPI void clear();
100
101 MCAPI void color(::mce::Color const& c);
102
103 MCAPI void color(float r, float g, float b, float a);
104
105 MCAPI ::mce::Mesh
106 end(::Tessellator::UploadMode uploadMode,
107 ::std::string_view debugName,
108 ::Tessellator::SupplementaryFieldAutoGenerationMode supplementaryFieldGenerationMode);
109
110 MCAPI void normal(float x, float y, float z, float w);
111
112 MCAPI void postTransformScale(::Vec3 const& scale);
113
114 MCAPI void quad(uint i1, uint i2, uint i3, uint i4);
115
116 MCAPI void resetTransform(bool setToIdentity);
117
118 MCAPI void rotateAroundPivot(::Vec3 const& pivotOffset, float angle, ::Vec3 const& rotationAxis, bool preTransform);
119
120 MCAPI void simpleQuad(
121 ::Vec3 const& pos0,
122 ::Vec2 const& uv0,
123 ::Vec3 const& pos1,
124 ::Vec2 const& uv1,
125 ::Vec3 const& pos2,
126 ::Vec2 const& uv2,
127 ::Vec3 const& pos3,
128 ::Vec2 const& uv3
129 );
130
131 MCAPI void tex1(::Vec2 const& v);
132
133 MCAPI void triggerIntercept(::mce::MaterialPtr const& material, ::mce::TexturePtr const& texture);
134
135 MCAPI void trim();
136
137 MCAPI void vertex(float x, float y, float z);
138
139 MCAPI void vertexUV(float x, float y, float z, float u, float v);
140
141 MCAPI ~Tessellator();
142 // NOLINTEND
143
144public:
145 // constructor thunks
146 // NOLINTBEGIN
147 MCAPI void* $ctor(::std::weak_ptr<::mce::BufferResourceService> bufferResourceService);
148 // NOLINTEND
149
150public:
151 // destructor thunk
152 // NOLINTBEGIN
153 MCAPI void $dtor();
154 // NOLINTEND
155};
Definition Tessellator.h:5
Definition Vec2.h:5
Definition Color.h:13
Definition MaterialPtr.h:15
Definition Mesh.h:7
Definition TexturePtr.h:19
Definition TessellatorQuadInfo.h:5
Definition Tessellator.h:17
Definition BufferResourceService.h:7