diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-09-06 19:12:28 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-09-06 19:14:47 -0300 |
commit | 23ababdcd57079182172b1c5467fcd6bb0f303d3 (patch) | |
tree | 015d23f2691e7be8a89998aef9100492ffef324e /core/math | |
parent | 78275aad871031ea0a4e20b901ba60d741415300 (diff) |
Changed Vector3.snap from fmod to stepify, which makes more sense, fixes #6399
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/vector3.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index 8afd73f482..b4a13d8f6d 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -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 { |