37 inline constexpr
TOffset2(T x, T y) noexcept : x{x}, y{y} {}
39 template<
typename TT>
explicit inline constexpr TOffset2(
TOffset2<TT> other) noexcept : x(
static_cast<T
>(other.x)), y(
static_cast<T
>(other.y)) {}
42 extern template struct CE_SCRIPT_EXPORT(name =
"Offset2Float") TOffset2<
float>;
85 : x(
static_cast<T>(other.x)), y(
static_cast<T>(other.y)), z(
static_cast<T>(other.z)) {}
91 extern template struct CE_SCRIPT_EXPORT(name =
"Offset3Float") TOffset3<
float>;
135 return TOffset3<T>{lhs.
x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z};
145 return TOffset3<T>{lhs.
x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z};
151 return (lhs.x == rhs.x && lhs.y == rhs.y);
161 return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z);
169template<
typename T>
struct std::hash<CeresEngine::Math::TOffset2<T>> {
170 using Type = CeresEngine::Math::TOffset2<T>;
171 constexpr size_t operator()(
const Type& obj)
const {
return CeresEngine::hash(obj.x, obj.y); }
175 using Type = CeresEngine::Math::TOffset3<T>;
176 constexpr size_t operator()(
const Type& obj)
const {
return CeresEngine::hash(obj.x, obj.y, obj.z); }
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
Definition Application.hpp:19
std::uint64_t UInt64
Definition DataTypes.hpp:26
bool operator!=(const ShortAllocator< T, N, A1 > &x, const ShortAllocator< U, M, A2 > &y) noexcept
Definition Allocator.hpp:416
std::int32_t Int32
Definition DataTypes.hpp:21
std::uint16_t UInt16
Definition DataTypes.hpp:20
ButtonSet operator-(const ButtonSet &set, const Button button)
Removes a button from a set.
Definition Input.hpp:270
std::uint8_t UInt8
Definition DataTypes.hpp:17
bool operator==(const ShortAllocator< T, N, A1 > &x, const ShortAllocator< U, M, A2 > &y) noexcept
Definition Allocator.hpp:411
std::int64_t Int64
Definition DataTypes.hpp:24
std::uint32_t UInt32
Definition DataTypes.hpp:23
BasicString< T, CharTraits, RawAllocator > operator+(const BasicString< T, CharTraits, RawAllocator > &lhs, const T *rhs)
Definition String.hpp:119
std::int8_t Int8
Definition DataTypes.hpp:15
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
std::int16_t Int16
Definition DataTypes.hpp:18
2-Dimensional offset structure.
Definition Offset.hpp:22
T x
Offset X axis.
Definition Offset.hpp:25
constexpr TOffset2(TOffset2< TT > other) noexcept
Definition Offset.hpp:39
3-Dimensional offset structure.
Definition Offset.hpp:62
T x
Offset X axis.
Definition Offset.hpp:65
constexpr TOffset3(TOffset3< TT > other) noexcept
Definition Offset.hpp:84
constexpr TOffset3(TOffset2< TT > other, T z) noexcept
Definition Offset.hpp:88