diff options
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/camera_matrix.cpp | 4 | ||||
-rw-r--r-- | core/math/math_funcs.cpp | 9 | ||||
-rw-r--r-- | core/math/math_funcs.h | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 8b3b6c82f3..30c0cab909 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -302,8 +302,8 @@ Vector<Plane> CameraMatrix::get_projection_planes(const Transform &p_transform) /** Fast Plane Extraction from combined modelview/projection matrices. * References: - * http://www.markmorley.com/opengl/frustumculling.html - * http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf + * https://web.archive.org/web/20011221205252/http://www.markmorley.com/opengl/frustumculling.html + * https://web.archive.org/web/20061020020112/http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf */ Vector<Plane> planes; diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp index 7a2e74a413..f04e40cb6c 100644 --- a/core/math/math_funcs.cpp +++ b/core/math/math_funcs.cpp @@ -79,6 +79,15 @@ int Math::step_decimals(double p_step) { return 0; } +// Only meant for editor usage in float ranges, where a step of 0 +// means that decimal digits should not be limited in String::num. +int Math::range_step_decimals(double p_step) { + if (p_step < 0.0000000000001) { + return 16; // Max value hardcoded in String::num + } + return step_decimals(p_step); +} + double Math::dectime(double p_value, double p_amount, double p_step) { double sgn = p_value < 0 ? -1.0 : 1.0; double val = Math::abs(p_value); diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index b8b5151802..a712356ddc 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -270,6 +270,7 @@ public: // double only, as these functions are mainly used by the editor and not performance-critical, static double ease(double p_x, double p_c); static int step_decimals(double p_step); + static int range_step_decimals(double p_step); static double stepify(double p_value, double p_step); static double dectime(double p_value, double p_amount, double p_step); |