LeviLamina
Loading...
Searching...
No Matches
CaveFeature.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/util/FloatRange.h"
8#include "mc/util/molang/ExpressionNode.h"
9#include "mc/world/level/levelgen/feature/IFeature.h"
10#include "mc/world/level/levelgen/feature/cave_feature_utils/CarvingParameters.h"
11
12// auto generated forward declare list
13// clang-format off
14class Block;
15class BlockPos;
16class BoundingBox;
17class ChunkPos;
19class Random;
20class RenderParams;
21namespace CaveFeatureUtils { struct CarverConfiguration; }
22// clang-format on
23
24class CaveFeature : public ::IFeature {
25public:
26 // CaveFeature inner types declare
27 // clang-format off
28 struct CachedMetaData;
29 // clang-format on
30
31 // CaveFeature inner types define
33 public:
34 // CachedMetaData inner types declare
35 // clang-format off
37 // clang-format on
38
39 // CachedMetaData inner types define
41 public:
42 // member variables
43 // NOLINTBEGIN
44 ::ll::TypedStorage<4, 12, ::Vec3 const> mStartPos;
45 ::ll::TypedStorage<4, 4, float const> mHorizontalRadius;
46 ::ll::TypedStorage<4, 4, float const> mVerticalRadius;
47 ::ll::TypedStorage<4, 24, ::CaveFeatureUtils::CarvingParameters const> mCarvingParameters;
48 ::ll::TypedStorage<4, 4, int const> mCurrentStep;
49 ::ll::TypedStorage<4, 4, int const> mTotalSteps;
50 ::ll::TypedStorage<4, 4, float const> mThickness;
51 // NOLINTEND
52 };
53
54 public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<4, 4, ::std::atomic<uint>> mUseCount;
58 ::ll::TypedStorage<8, 24, ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>>
59 mCarveEllipsoidParamsVector;
60 // NOLINTEND
61 };
62
63public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<8, 8, ::Block const*> mFillWithBlock;
67 ::ll::TypedStorage<8, 16, ::ExpressionNode> mWidthMod;
68 ::ll::TypedStorage<4, 4, int> mSkipCarveChance;
69 ::ll::TypedStorage<4, 4, int> mHeightLimit;
70 ::ll::TypedStorage<4, 8, ::FloatRange> mYScale;
71 ::ll::TypedStorage<4, 8, ::FloatRange> mHorizontalRadiusMultiplier;
72 ::ll::TypedStorage<4, 8, ::FloatRange> mVerticalRadiusMultiplier;
73 ::ll::TypedStorage<4, 8, ::FloatRange> mFloorLevel;
74 ::ll::TypedStorage<8, 32, ::std::string const> VALID_PASS;
75 ::ll::TypedStorage<4, 4, float const> X_DAMPENING_FACTOR;
76 ::ll::TypedStorage<4, 4, float const> Y_DAMPENING_FACTOR;
77 ::ll::TypedStorage<4, 4, float const> STEEP_FLATTENING_FACTOR;
78 ::ll::TypedStorage<4, 4, float const> FLATTENING_FACTOR;
79 ::ll::TypedStorage<4, 4, int const> STEEP_CHANCE;
80 ::ll::TypedStorage<4, 4, int const> TUNNEL_SKIP_CHANCE;
81 ::ll::TypedStorage<4, 4, int const> CAVE_COUNT_BASE_FACTOR;
82 ::ll::TypedStorage<4, 4, int const> ROOM_CARVE_CHANCE;
83 ::ll::TypedStorage<4, 4, int const> MAX_NUM_TUNNELS_ADDED_ON_ROOM_CARVE;
84 ::ll::TypedStorage<1, 1, bool> mCacheEnabled;
85 ::ll::TypedStorage<
86 8,
87 64,
88 ::std::unordered_map<int, ::std::unordered_map<int, ::std::shared_ptr<::CaveFeature::CachedMetaData>>>>
89 mCachedMetaDataMap;
90 ::ll::TypedStorage<8, 80, ::std::mutex> mCacheMutex;
91 ::ll::TypedStorage<4, 4, ::std::atomic<uint>> mPlaceCount;
92 // NOLINTEND
93
94public:
95 // virtual functions
96 // NOLINTBEGIN
97 virtual ~CaveFeature() /*override*/;
98
99 virtual ::std::optional<::BlockPos> place(::IFeature::PlacementContext const& context) const /*override*/;
100
101 virtual bool isValidPlacement(::std::string const& pass) /*override*/;
102
103 virtual void addRoom(
104 ::IBlockWorldGenAPI& target,
105 ::CaveFeatureUtils::CarverConfiguration const& configuration,
106 ::Random& random,
107 ::ChunkPos const& chunkPos,
108 ::Vec3 const& startPos,
109 ::RenderParams& renderParams,
110 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
111 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
112 ) const;
113
114 virtual void addTunnel(
115 ::IBlockWorldGenAPI& target,
116 ::CaveFeatureUtils::CarverConfiguration const& configuration,
117 ::Random& random,
118 ::ChunkPos const& chunkPos,
119 ::Vec3 const& startPos,
120 float thickness,
121 float horizontalRotation,
122 float verticalRotation,
123 int step,
124 int dist,
125 float yScale,
126 ::RenderParams& renderParams,
127 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
128 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
129 ) const;
130
131 virtual bool carveEllipsoidVolume(
132 ::IBlockWorldGenAPI& target,
133 ::CaveFeatureUtils::CarverConfiguration const& configuration,
134 ::Random&,
135 ::ChunkPos const& chunkPos,
136 ::Vec3 const& startPos,
137 ::BoundingBox const& volume,
138 float rad,
139 float yRad,
140 ::CaveFeatureUtils::CarvingParameters const& carvingParameters
141 ) const;
142
143 virtual void addFeature(
144 ::IBlockWorldGenAPI& target,
145 ::ChunkPos const& pos,
146 ::Random& random,
147 ::ChunkPos const& startChunk,
148 ::RenderParams& renderParams,
149 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
150 ) const;
151 // NOLINTEND
152
153public:
154 // member functions
155 // NOLINTBEGIN
156 MCAPI CaveFeature();
157
158 MCAPI bool carveEllipsoid(
159 ::IBlockWorldGenAPI& target,
160 ::CaveFeatureUtils::CarverConfiguration const& configuration,
161 ::Random& random,
162 ::ChunkPos const& chunkPos,
163 ::Vec3 const& startPos,
164 float horizontalRadius,
165 float const verticalRadius,
166 ::CaveFeatureUtils::CarvingParameters const& carvingParameters
167 ) const;
168 // NOLINTEND
169
170public:
171 // constructor thunks
172 // NOLINTBEGIN
173 MCAPI void* $ctor();
174 // NOLINTEND
175
176public:
177 // destructor thunk
178 // NOLINTBEGIN
179 MCAPI void $dtor();
180 // NOLINTEND
181
182public:
183 // virtual function thunks
184 // NOLINTBEGIN
185 MCAPI ::std::optional<::BlockPos> $place(::IFeature::PlacementContext const& context) const;
186
187 MCAPI bool $isValidPlacement(::std::string const& pass);
188
189 MCAPI void $addRoom(
190 ::IBlockWorldGenAPI& target,
191 ::CaveFeatureUtils::CarverConfiguration const& configuration,
192 ::Random& random,
193 ::ChunkPos const& chunkPos,
194 ::Vec3 const& startPos,
195 ::RenderParams& renderParams,
196 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
197 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
198 ) const;
199
200 MCAPI void $addTunnel(
201 ::IBlockWorldGenAPI& target,
202 ::CaveFeatureUtils::CarverConfiguration const& configuration,
203 ::Random& random,
204 ::ChunkPos const& chunkPos,
205 ::Vec3 const& startPos,
206 float thickness,
207 float horizontalRotation,
208 float verticalRotation,
209 int step,
210 int dist,
211 float yScale,
212 ::RenderParams& renderParams,
213 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
214 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
215 ) const;
216
217 MCAPI bool $carveEllipsoidVolume(
218 ::IBlockWorldGenAPI& target,
219 ::CaveFeatureUtils::CarverConfiguration const& configuration,
220 ::Random&,
221 ::ChunkPos const& chunkPos,
222 ::Vec3 const& startPos,
223 ::BoundingBox const& volume,
224 float rad,
225 float yRad,
226 ::CaveFeatureUtils::CarvingParameters const& carvingParameters
227 ) const;
228
229 MCAPI void $addFeature(
230 ::IBlockWorldGenAPI& target,
231 ::ChunkPos const& pos,
232 ::Random& random,
233 ::ChunkPos const& startChunk,
234 ::RenderParams& renderParams,
235 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
236 ) const;
237
238
239 // NOLINTEND
240
241public:
242 // vftables
243 // NOLINTBEGIN
244 MCNAPI static void** $vftable();
245 // NOLINTEND
246};
Definition BlockPos.h:17
Definition Block.h:41
Definition BoundingBox.h:13
static MCAPI void ** $vftable()
Definition ChunkPos.h:13
Definition IBlockWorldGenAPI.h:25
Definition IFeature.h:18
Definition Random.h:10
Definition RenderParams.h:29
Definition Vec3.h:10
Definition CarverConfiguration.h:14
Definition CarvingParameters.h:10
Definition CaveFeature.h:32
Definition IFeature.h:26
Definition context.h:5