Changed Vector3.snap from fmod to stepify, which makes more sense, fixes #6399

This commit is contained in:
Juan Linietsky
2016-09-06 19:12:28 -03:00
parent 78275aad87
commit 23ababdcd5
6 changed files with 640 additions and 516 deletions

View File

@@ -65,13 +65,9 @@ int Vector3::max_axis() const {
void Vector3::snap(float p_val) {
x+=p_val/2.0;
x-=Math::fmod(x,p_val);
y+=p_val/2.0;
y-=Math::fmod(y,p_val);
z+=p_val/2.0;
z-=Math::fmod(z,p_val);
x=Math::stepify(x,p_val);
y=Math::stepify(y,p_val);
z=Math::stepify(z,p_val);
}
Vector3 Vector3::snapped(float p_val) const {