9#if PROTOCOL_VERSION > 772
25 Vector3(
const T& x_,
const T& y_,
const T& z_)
39#if PROTOCOL_VERSION > 772
49 template <
typename U, std::enable_if_t<!std::is_
floating_po
int_v<U> || !std::is_
integral_v<T>,
int> = 0>
52 x =
static_cast<T
>(position.
x);
53 y =
static_cast<T
>(position.
y);
54 z =
static_cast<T
>(position.
z);
58 template <
typename U, std::enable_if_t<std::is_
floating_po
int_v<U> && std::is_
integral_v<T>,
int> = 0>
61 x =
static_cast<T
>(position.
x);
62 y =
static_cast<T
>(position.
y);
63 z =
static_cast<T
>(position.
z);
68 assert(v.size() == 3);
107 return (
x == a.
x) && (
y == a.
y) && (
z == a.
z);
112 return (
x != a.
x) || (
y != a.
y) || (
z != a.
z);
118 (
x == a.
x &&
y < a.
y) ||
119 (
x == a.
x &&
y == a.
y &&
z < a.
z);
217 return (
x - v.
x) * (
x - v.
x)
218 + (
y - v.
y) * (
y - v.
y)
219 + (
z - v.
z) * (
z - v.
z);
273 const double norm = std::sqrt(
SqrNorm());
281 return x *
x +
y *
y +
z *
z;
286 o <<
"(" << vec.
x <<
"," << vec.
y <<
"," << vec.
z <<
")";
308 static_cast<int>(std::floor(
x)),
309 static_cast<int>(std::floor(
y)),
310 static_cast<int>(std::floor(
z))
319 template <
typename T>
325 size_t value = hasher(v.
x);
326 value ^= hasher(v.
y) + 0x9e3779b9 + (value << 6) + (value >> 2);
327 value ^= hasher(v.
z) + 0x9e3779b9 + (value << 6) + (value >> 2);
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
bool operator!=(const Vector3 &a) const
Vector3 operator/(const Vector3 &v) const
Vector3(const Vector3< U > &position)
Vector3(const ProtocolCraft::LpVec3 &v)
Vector3 operator+(const T d) const
Vector3 operator+(const Vector3 &a) const
Vector3(const ProtocolCraft::NetworkPosition &position)
Vector3 & operator+=(const Vector3 &v)
Vector3 & operator*=(const Vector3 &v)
double SqrDist(const Vector3 &v) const
double dot(const Vector3 &v) const
ProtocolCraft::NetworkPosition ToNetworkPosition() const
ProtocolCraft::Json::Value Serialize() const
bool operator==(const Vector3 &a) const
Vector3 operator-(const T d) const
Vector3(const std::array< T, 3 > &v)
Vector3< int > ToBlockPos() const
Vector3 & operator/=(const Vector3 &v)
bool operator<(const Vector3 &a) const
T & operator[](const int i)
Vector3 operator/(const T d) const
Vector3(const std::vector< T > &v)
Vector3 operator-(const Vector3 &a) const
friend std::ostream & operator<<(std::ostream &o, const Vector3 &vec)
Vector3 & operator-=(const Vector3 &v)
Vector3 operator*(const Vector3 &v) const
Vector3 operator*(const T d) const
Vector3(const T &x_, const T &y_, const T &z_)
size_t operator()(const Botcraft::Vector3< T > &v) const