LeviLamina
Loading...
Searching...
No Matches
ChunkPos.h
1
#pragma once
2
3
#include "mc/_HeaderOutputPredefine.h"
4
#include "mc/deps/core/math/Vec3.h"
5
#include "mc/world/level/BlockPos.h"
6
7
// clang-format off
8
class
BlockPos
;
9
class
Vec3
;
10
// clang-format on
11
12
class
alignas(uint64) ChunkPos :
public
ll::math::intN2<ChunkPos> {
13
public
:
14
template
<std::
float
ing_po
int
T0, std::
float
ing_po
int
T1>
15
[[nodiscard]]
constexpr
ChunkPos(T0 x, T1 z)
16
: intN2((
static_cast<
int
>
(std::floor(x)) >> 4), (
static_cast<
int
>
(std::floor(z)) >> 4)) {}
17
18
using
intN2::intN2;
19
20
ChunkPos(
BlockPos
const
& bp) {
21
x = bp.x >> 4;
22
z = bp.z >> 4;
23
}
24
25
ChunkPos(
Vec3
const
& pos) {
26
x =
static_cast<
int
>
(floorf(pos.x)) >> 4;
27
z =
static_cast<
int
>
(floorf(pos.z)) >> 4;
28
}
29
30
public
:
31
// static variables
32
// NOLINTBEGIN
33
MCAPI static ::ChunkPos
const
& INVALID();
34
35
MCAPI static ::ChunkPos
const
& MAX();
36
37
MCAPI static ::ChunkPos
const
& MIN();
38
39
MCAPI static ::ChunkPos
const
& ONE();
40
// NOLINTEND
41
};
BlockPos
Definition
BlockPos.h:17
Vec3
Definition
Vec3.h:10
src
mc
world
level
ChunkPos.h
Generated on
for LeviLamina by
1.16.1