Rename Math::stepify to snapped

This commit is contained in:
Marcel Admiraal 2020-12-21 18:02:57 +00:00
parent be509bf5e4
commit b743a2ef3c
28 changed files with 148 additions and 148 deletions

View file

@ -60,15 +60,15 @@ int Vector3::max_axis() const {
return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0);
}
void Vector3::snap(Vector3 p_val) {
x = Math::stepify(x, p_val.x);
y = Math::stepify(y, p_val.y);
z = Math::stepify(z, p_val.z);
void Vector3::snap(Vector3 p_step) {
x = Math::snapped(x, p_step.x);
y = Math::snapped(y, p_step.y);
z = Math::snapped(z, p_step.z);
}
Vector3 Vector3::snapped(Vector3 p_val) const {
Vector3 Vector3::snapped(Vector3 p_step) const {
Vector3 v = *this;
v.snap(p_val);
v.snap(p_step);
return v;
}