LeviLamina
Loading...
Searching...
No Matches
SimpleBlockVolume.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/platform/brstd/function_ref.h"
7#include "mc/world/level/BlockPos.h"
8#include "mc/world/level/block/BlockVolumeBase.h"
9
10// auto generated forward declare list
11// clang-format off
12class AABB;
14class BoundingBox;
15class ChunkPos;
17class Vec3;
18namespace cereal { struct ReflectionCtx; }
19// clang-format on
20
21class SimpleBlockVolume : public ::BlockVolumeBase {
22public:
23 // SimpleBlockVolume inner types declare
24 // clang-format off
25 class allocator;
26 // clang-format on
27
28 // SimpleBlockVolume inner types define
29 enum class CornerIndex : uchar {
30 FrontBottomLeft = 0,
31 BackBottomLeft = 1,
32 FrontTopLeft = 2,
33 BackTopLeft = 3,
34 FrontBottomRight = 4,
35 BackBottomRight = 5,
36 FrontTopRight = 6,
37 BackTopRight = 7,
38 };
39
40 enum class IntersectionResult : int {
41 Disjoint = 0,
42 Contains = 1,
43 Intersects = 2,
44 };
45
46 class allocator {};
47
48 using CornerHandle = uchar;
49
50public:
51 // member variables
52 // NOLINTBEGIN
53 ::ll::TypedStorage<4, 12, ::BlockPos> mFrom;
54 ::ll::TypedStorage<4, 12, ::BlockPos> mTo;
55 // NOLINTEND
56
57public:
58 // prevent constructor by default
59 SimpleBlockVolume();
60
61public:
62 // virtual functions
63 // NOLINTBEGIN
64 virtual ::BlockPos getMin() const /*override*/;
65
66 virtual ::BlockPos getMax() const /*override*/;
67
68 virtual ::BoundingBox getBoundingBox() const /*override*/;
69
70 virtual ::glm::ivec3 getSpan() const /*override*/;
71
72 virtual int getCapacity() const /*override*/;
73
74 virtual bool isInside(::BlockPos const& pos) const /*override*/;
75
76 virtual void translate(::BlockPos const& delta) /*override*/;
77
78 virtual void forEach(::brstd::function_ref<bool(::BlockPos const&)> callback) const /*override*/;
79
80 virtual ::std::set<::ChunkPos> getChunks() const /*override*/;
81
82 virtual ::std::unordered_set<::BlockPos> getFlattenedBlockPositions() const /*override*/;
83
84 virtual ::std::unique_ptr<::BaseBlockLocationIterator> getIterator() const /*override*/;
85 // NOLINTEND
86
87public:
88 // member functions
89 // NOLINTBEGIN
90 MCAPI explicit SimpleBlockVolume(::BoundingBox const& bounds);
91
92 MCAPI SimpleBlockVolume(::SimpleBlockVolume&& volume);
93
94 MCAPI SimpleBlockVolume(::SimpleBlockVolume const& volume);
95
96 MCAPI SimpleBlockVolume(::BlockPos const& from, ::glm::ivec3 const& size);
97
98#ifdef LL_PLAT_C
99 MCAPI SimpleBlockVolume(::BlockPos const& from, ::Vec3 const& size);
100#endif
101
102 MCAPI SimpleBlockVolume(::BlockPos&& from, ::BlockPos&& to);
103
104 MCAPI SimpleBlockVolume(::BlockPos const& from, ::BlockPos const& to);
105
106 MCAPI ::SimpleBlockVolumeIterator begin() const;
107
108 MCFOLD bool contains(::BlockPos const& pos) const;
109
110 MCAPI bool doesAreaTouchFaces(::BlockPos const& min, ::BlockPos const& max) const;
111
112 MCAPI bool doesBlockTouchFaces(::BlockPos const& blockPos) const;
113
114#ifdef LL_PLAT_C
115 MCAPI uchar getCornerHandle(::SimpleBlockVolume::CornerIndex cornerIndex) const;
116
117 MCAPI ::BlockPos getCornerPosition(uchar cornerHandle) const;
118#endif
119
120 MCFOLD ::BlockPos getFrom() const;
121
122#ifdef LL_PLAT_C
123 MCAPI ::AABB getLocalAABB() const;
124#endif
125
126 MCFOLD ::BlockPos getTo() const;
127
128#ifdef LL_PLAT_C
129 MCAPI ::AABB getWorldAABB() const;
130#endif
131
132 MCAPI ::SimpleBlockVolume::IntersectionResult intersects(::SimpleBlockVolume const& other) const;
133
134 MCAPI ::SimpleBlockVolume& operator=(::SimpleBlockVolume&& other);
135
136 MCAPI ::SimpleBlockVolume& operator=(::SimpleBlockVolume const& other);
137
138 MCAPI bool operator==(::SimpleBlockVolume const&) const;
139
140#ifdef LL_PLAT_C
141 MCAPI ::SimpleBlockVolume& setCornerPosition(uchar cornerHandle, ::BlockPos const& pos);
142#endif
143
144 MCAPI ::SimpleBlockVolume& setPosition(::BlockPos const& newPosition);
145
146#ifdef LL_PLAT_C
147 MCAPI ::SimpleBlockVolume& translateCorner(uchar cornerHandle, ::glm::ivec3 const& delta);
148#endif
149
150 MCAPI ::SimpleBlockVolume translated(::glm::ivec3 const& delta) const;
151 // NOLINTEND
152
153public:
154 // static functions
155 // NOLINTBEGIN
156 MCAPI static void cerealBindTypes(::cereal::ReflectionCtx& ctx);
157
158#ifdef LL_PLAT_C
159 MCAPI static ::glm::vec3 getCornerUnitOffset(::SimpleBlockVolume::CornerIndex cornerIndex);
160#endif
161 // NOLINTEND
162
163public:
164 // constructor thunks
165 // NOLINTBEGIN
166 MCAPI void* $ctor(::BoundingBox const& bounds);
167
168 MCFOLD void* $ctor(::SimpleBlockVolume&& volume);
169
170 MCFOLD void* $ctor(::SimpleBlockVolume const& volume);
171
172 MCAPI void* $ctor(::BlockPos const& from, ::glm::ivec3 const& size);
173
174#ifdef LL_PLAT_C
175 MCAPI void* $ctor(::BlockPos const& from, ::Vec3 const& size);
176#endif
177
178 MCFOLD void* $ctor(::BlockPos&& from, ::BlockPos&& to);
179
180 MCFOLD void* $ctor(::BlockPos const& from, ::BlockPos const& to);
181 // NOLINTEND
182
183public:
184 // virtual function thunks
185 // NOLINTBEGIN
186 MCAPI ::BlockPos $getMin() const;
187
188 MCAPI ::BlockPos $getMax() const;
189
190 MCAPI ::BoundingBox $getBoundingBox() const;
191
192 MCAPI ::glm::ivec3 $getSpan() const;
193
194 MCAPI int $getCapacity() const;
195
196 MCFOLD bool $isInside(::BlockPos const& pos) const;
197
198 MCAPI void $translate(::BlockPos const& delta);
199
200 MCAPI void $forEach(::brstd::function_ref<bool(::BlockPos const&)> callback) const;
201
202 MCAPI ::std::set<::ChunkPos> $getChunks() const;
203
204 MCAPI ::std::unordered_set<::BlockPos> $getFlattenedBlockPositions() const;
205
206 MCAPI ::std::unique_ptr<::BaseBlockLocationIterator> $getIterator() const;
207
208
209 // NOLINTEND
210
211public:
212 // vftables
213 // NOLINTBEGIN
214 MCAPI static void** $vftable();
215 // NOLINTEND
216};
Definition AABB.h:18
Definition BaseBlockLocationIterator.h:8
Definition BlockPos.h:21
Definition BlockVolumeBase.h:16
Definition BoundingBox.h:13
Definition ChunkPos.h:11
Definition SimpleBlockVolumeIterator.h:8
Definition SimpleBlockVolume.h:46
Definition Vec3.h:10
Definition function_ref.h:60
STL namespace.
Definition ReflectionCtx.h:11
Definition ctx.h:5