12#ifndef MINESERVER_VECTOR_HPP
13#define MINESERVER_VECTOR_HPP
28 static_assert(std::is_arithmetic_v<T>,
"Type should be a number");
110 template <
typename O>
126 template <
typename O>
142 template <
typename O>
158 template <
typename O>
161 static_assert(std::is_arithmetic_v<O>,
"Type should be a number");
175 template <
typename O>
178 static_assert(std::is_arithmetic_v<O>,
"Type should be a number");
208 luabridge::getGlobalNamespace(state)
210 .beginClass<
Vecf>(
"Vecf")
216 .beginClass<
Veci32>(
"Veci32")
217 .
addConstructor<
void(),
void(std::int32_t, std::int32_t),
void(std::int32_t, std::int32_t, std::int32_t)>()
Vector 3 (x, y, z) with variable type.
Definition vector.hpp:26
T z
Z coordinate.
Definition vector.hpp:43
Vec()
Construct a new Vec object.
Definition vector.hpp:50
Vec & operator-(const Vec< O > &other)
Vector Substraction operator.
Definition vector.hpp:111
Vec & operator*(const O &other)
Scalar Multiplication operator.
Definition vector.hpp:159
Vec & operator*(const Vec< O > &other)
Vector Multiplication operator.
Definition vector.hpp:127
Vec & operator+(const Vec< O > &other)
Vector Addition operator.
Definition vector.hpp:95
Vec(T x, T y)
Construct a new Vec object.
Definition vector.hpp:58
Vec & operator/(const Vec< O > &other)
Vector Division operator.
Definition vector.hpp:143
Vec(const Vec< O > &other)
Construct a new Vec object from another.
Definition vector.hpp:80
Vec(T x, T y, T z)
Construct a new Vec object.
Definition vector.hpp:66
T x
X coordinate.
Definition vector.hpp:33
~Vec()=default
Destroy the Vec object.
Vec & operator/(const O &other)
Scalar Division operator.
Definition vector.hpp:176
T y
Y coordinate.
Definition vector.hpp:38
constexpr std::string_view type_name()
Gets the name of the type paramater.
Definition event.h:56
Vec< float > Vecf
Vector 3 Float.
Definition vector.hpp:191
Vec< std::int32_t > Veci32
Vector 3 Int.
Definition vector.hpp:197
static void loadVectorLua(lua_State *state, const char *namespaceName)
Loads Vector to lua state.
Definition vector.hpp:206