Fix snapped implementation, it was not snapping size correctly

master
Marc Gilleron 2021-03-12 23:33:29 +00:00
parent fb952ef119
commit 43588cae17
2 changed files with 10 additions and 1 deletions

View File

@ -239,7 +239,10 @@ public:
}
inline Rect3i snapped(int step) const {
return Rect3i(pos.floordiv(step) * step, size.floordiv(step) * step);
Rect3i r = downscaled(step);
r.pos *= step;
r.size *= step;
return r;
}
};

View File

@ -91,6 +91,12 @@ struct Vector3i {
z -= other.z;
}
_FORCE_INLINE_ void operator*=(const int s) {
x *= s;
y *= s;
z *= s;
}
_FORCE_INLINE_ Vector3i operator-() const {
return Vector3i(-x, -y, -z);
}