1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Various random code cleanups

This commit is contained in:
sfan5 2025-03-01 11:53:37 +01:00
parent 358658fa34
commit 7892541383
73 changed files with 216 additions and 285 deletions

View file

@ -33,6 +33,12 @@ public:
explicit constexpr vector3d(T n) :
X(n), Y(n), Z(n) {}
template <class U>
constexpr static vector3d<T> from(const vector3d<U> &other)
{
return {static_cast<T>(other.X), static_cast<T>(other.Y), static_cast<T>(other.Z)};
}
// operators
vector3d<T> operator-() const { return vector3d<T>(-X, -Y, -Z); }