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;
16class Vec3;
17namespace cereal { struct ReflectionCtx; }
18// clang-format on
19
20class SimpleBlockVolume : public ::BlockVolumeBase {
21public:
22 // SimpleBlockVolume inner types define
23 enum class CornerIndex : uchar {
24 FrontBottomLeft = 0,
25 BackBottomLeft = 1,
26 FrontTopLeft = 2,
27 BackTopLeft = 3,
28 FrontBottomRight = 4,
29 BackBottomRight = 5,
30 FrontTopRight = 6,
31 BackTopRight = 7,
32 };
33
34 enum class IntersectionResult : int {
35 Disjoint = 0,
36 Contains = 1,
37 Intersects = 2,
38 };
39
40 using CornerHandle = uchar;
41
42public:
43 // member variables
44 // NOLINTBEGIN
45 ::ll::TypedStorage<4, 12, ::BlockPos> mFrom;
46 ::ll::TypedStorage<4, 12, ::BlockPos> mTo;
47 // NOLINTEND
48
49#ifdef LL_PLAT_S
50#else // LL_PLAT_C
51public:
52 // prevent constructor by default
53 SimpleBlockVolume& operator=(SimpleBlockVolume const&);
54 SimpleBlockVolume();
55
56#endif
57public:
58 // virtual functions
59 // NOLINTBEGIN
60 virtual ::BlockPos getMin() const /*override*/;
61
62 virtual ::BlockPos getMax() const /*override*/;
63
64 virtual ::BoundingBox getBoundingBox() const /*override*/;
65
66 virtual ::glm::ivec3 getSpan() const /*override*/;
67
68 virtual int getCapacity() const /*override*/;
69
70 virtual bool isInside(::BlockPos const& pos) const /*override*/;
71
72 virtual void translate(::BlockPos const& delta) /*override*/;
73
74 virtual void forEach(::brstd::function_ref<bool(::BlockPos const&)> callback) const /*override*/;
75
76 virtual ::std::set<::ChunkPos> getChunks() const /*override*/;
77
78 virtual ::std::unordered_set<::BlockPos> getFlattenedBlockPositions() const /*override*/;
79
80 virtual ::std::unique_ptr<::BaseBlockLocationIterator> getIterator() const /*override*/;
81
82 virtual ~SimpleBlockVolume() /*override*/;
83 // NOLINTEND
84
85public:
86 // member functions
87 // NOLINTBEGIN
88#ifdef LL_PLAT_C
89 MCAPI SimpleBlockVolume(::SimpleBlockVolume const& volume);
90
91 MCAPI SimpleBlockVolume(::BlockPos const& from, ::Vec3 const& size);
92
93 MCAPI SimpleBlockVolume(::BlockPos const& from, ::BlockPos const& to);
94#endif
95
96 MCAPI bool doesAreaTouchFaces(::BlockPos const& min, ::BlockPos const& max) const;
97
98#ifdef LL_PLAT_C
99 MCAPI uchar getCornerHandle(::SimpleBlockVolume::CornerIndex cornerIndex) const;
100
101 MCAPI ::BlockPos getCornerPosition(uchar cornerHandle) const;
102
103 MCAPI ::AABB getWorldAABB() const;
104#endif
105
106 MCAPI ::SimpleBlockVolume::IntersectionResult intersects(::SimpleBlockVolume const& other) const;
107
108#ifdef LL_PLAT_C
109 MCAPI bool operator==(::SimpleBlockVolume const& other) const;
110
111 MCAPI ::SimpleBlockVolume& setCornerPosition(uchar cornerHandle, ::BlockPos const& pos);
112
113 MCAPI ::SimpleBlockVolume& translateCorner(uchar cornerHandle, ::glm::ivec3 const& delta);
114#endif
115 // NOLINTEND
116
117public:
118 // static functions
119 // NOLINTBEGIN
120 MCAPI static void cerealBindTypes(::cereal::ReflectionCtx& ctx);
121 // NOLINTEND
122
123public:
124 // constructor thunks
125 // NOLINTBEGIN
126#ifdef LL_PLAT_C
127 MCAPI void* $ctor(::SimpleBlockVolume const& volume);
128
129 MCAPI void* $ctor(::BlockPos const& from, ::Vec3 const& size);
130
131 MCAPI void* $ctor(::BlockPos const& from, ::BlockPos const& to);
132#endif
133 // NOLINTEND
134
135public:
136 // destructor thunk
137 // NOLINTBEGIN
138 MCFOLD void $dtor();
139 // NOLINTEND
140
141public:
142 // virtual function thunks
143 // NOLINTBEGIN
144 MCAPI ::BlockPos $getMin() const;
145
146 MCAPI ::BlockPos $getMax() const;
147
148 MCAPI ::BoundingBox $getBoundingBox() const;
149
150 MCAPI ::glm::ivec3 $getSpan() const;
151
152 MCAPI int $getCapacity() const;
153
154 MCAPI bool $isInside(::BlockPos const& pos) const;
155
156 MCAPI void $translate(::BlockPos const& delta);
157
158 MCAPI void $forEach(::brstd::function_ref<bool(::BlockPos const&)> callback) const;
159
160 MCAPI ::std::set<::ChunkPos> $getChunks() const;
161
162 MCAPI ::std::unordered_set<::BlockPos> $getFlattenedBlockPositions() const;
163
164 MCAPI ::std::unique_ptr<::BaseBlockLocationIterator> $getIterator() const;
165
166
167 // NOLINTEND
168
169public:
170 // vftables
171 // NOLINTBEGIN
172 MCAPI static void** $vftable();
173 // NOLINTEND
174};
Definition AABB.h:18
Definition BaseBlockLocationIterator.h:8
Definition BlockPos.h:19
Definition BlockVolumeBase.h:16
Definition BoundingBox.h:13
Definition ChunkPos.h:11
Definition Vec3.h:10
Definition function_ref.h:60
Definition ReflectionCtx.h:11
Definition ctx.h:5