summaryrefslogtreecommitdiffstats
path: root/core/math
Commit message (Collapse)AuthorAgeFilesLines
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-174-18/+6
| | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Merge pull request #31266 from ↵Rémi Verschelde2019-08-147-27/+1
|\ | | | | | | | | IAmActuallyCthulhu/pr/remove-redundant-author-comments Remove redundant author doc comments
| * Remove redundant author doc commentsIAmActuallyCthulhu2019-08-127-27/+1
| |
* | remove unused self list include from astarRobin Hübner2019-08-131-1/+0
| |
* | Add Basis constants and format Transform constantsAaron Franke2019-08-092-0/+6
|/
* [Core] [Mono] Optimize Wrap functionsAaron Franke2019-08-041-6/+6
| | | | Use is_zero_approx(), avoid a negative, and also rename "rng" to "range".
* Merge pull request #30776 from akien-mga/editor-configurable-float-stepRémi Verschelde2019-07-252-0/+10
|\ | | | | Inspector: Make default float step configurable
| * Inspector: Make default float step configurableRémi Verschelde2019-07-232-0/+10
| | | | | | | | | | | | | | | | | | | | Also allow lifting the decimal step formatting with a hint range step of 0. A new `range_step_decimals()` is added for this to avoid breaking compatibility on the general purpose `step_decimals()` (which still returns 0 for an input step of 0). Supersedes #25470. Partial fix for #18251.
* | Update some dead links in the codebaseMichael Alexsander Silva Dias2019-07-231-2/+2
|/
* Merge pull request #30693 from Chaosus/lerp_angleRémi Verschelde2019-07-203-0/+21
|\ | | | | Added lerp_angle built-in function
| * Added lerp_angles built-in functionChaosus2019-07-203-0/+21
| | | | | | | | | | Co-authored-by: Xrayez <https://github.com/Xrayez> Co-authored-by: DleanJeans <https://github.com/DleanJeans>
* | Merge pull request #30576 from qarmin/lgtm_coverageRémi Verschelde2019-07-202-7/+3
|\ \ | |/ |/| Changed some code reported by LGTM and Coverity
| * Changed some code showed in LGTM and Coverageqarmin2019-07-202-7/+3
| |
* | Add integer posmod and rename default arg namesAaron Franke2019-07-183-0/+16
|/ | | | | "posmod" is the integer version of "fposmod". We do not need a "mod" because of the % operator. I changed the default arg names from "x" and "y" to "a" and "b" because they are not coordinates. I also changed pow's arg names to "base" and "exp". Also, I reorganized the code in the VS built-in funcs switch statement.
* Merge pull request #30341 from Toshiwoz/masterRémi Verschelde2019-07-121-4/+0
|\ | | | | when doing Vector3 slerp it is not necessary to have it normalized.
| * when doing Vector3 slerp it is not necessary to have it normalized.Toshiwo2019-07-051-4/+0
| |
* | Merge pull request #30455 from qarmin/const_referenceRémi Verschelde2019-07-102-2/+2
|\ \ | | | | | | Pass by reference to const
| * | Use reference to constant in functionsqarmin2019-07-102-2/+2
| | |
* | | SCons: Fix MBEDTLS_CONFIG_FILE string escapeRémi Verschelde2019-07-081-1/+1
|/ / | | | | | | Fixes #30431, regression from #30277.
* | Merge pull request #30382 from simonpuchert/geo-optRémi Verschelde2019-07-061-18/+14
|\ \ | | | | | | Some small optimizations in core/math/geometry.h.
| * | Optimize get_closest_point_to_segment*.Simon Puchert2019-07-061-18/+14
| | | | | | | | | | | | | | | | | | By combining all scalar factors we can get rid of a scalar * vector multiplication and a square root operation, since the resulting formula only uses the squared length.
* | | Added release function to PoolVector::Access.Ibrahn Sahir2019-07-061-2/+2
|/ / | | | | | | | | | | For clarity, assign-to-release idiom for PoolVector::Read/Write replaced with a function call. Existing uses replaced (or removed if already handled by scope)
* | Add b64 to string helper in CryptoCoreFabio Alessandrelli2019-07-032-0/+12
| |
* | SCons: Use CPPDEFINES instead of CPPFLAGS for pre-processor definesRémi Verschelde2019-07-031-1/+1
| | | | | | | | | | | | | | | | It's the recommended way to set those, and is more portable (automatically prepends -D for GCC/Clang and /D for MSVC). We still use CPPFLAGS for some pre-processor flags which are not defines.
* | CryptoCore class to access to base crypto utils.Fabio Alessandrelli2019-07-023-1/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Godot core needs MD5/SHA256/AES/Base64 which used to be provided by separate libraries. Since we bundle mbedtls in most cases, and we can easily only include the needed sources if we so desire, let's use it. To simplify library changes in the future, and better isolate header dependencies all functions have been wrapped around inside a class in `core/math/crypto_base.h`. If the mbedtls module is disabled, we only bundle the needed source files independently of the `builtin_mbedtls` option. If the module is enabled, the `builtin_mbedtls` option works as usual. Also remove some unused headers from StreamPeerMbedTLS which were causing build issues.
* | Merge pull request #30126 from qarmin/remove_unnecessary_codeRémi Verschelde2019-07-014-38/+32
|\ \ | | | | | | Remove unnecessary code and add some error explanations
| * | Remove unnecessary code and add some error explanationsqarmin2019-07-014-38/+32
| | |
* | | Merge pull request #30112 from AgentEnder/masterRémi Verschelde2019-06-291-0/+6
|\ \ \ | |/ / |/| | AStar get_current_point enabled consideration
| * | AStar get_closest_point/get_closest_position_in_segment enabled considerationCraigory V Coppola2019-06-291-0/+6
| | |
* | | Some code changed with Clang-Tidyqarmin2019-06-263-4/+3
|/ /
* | Made use of semicolons more consitent, fixed formattingJohnJLight2019-06-192-2/+3
| |
* | Merge pull request #27237 from Chaosus/astar_2dRémi Verschelde2019-06-192-2/+172
|\ \ | | | | | | Added 2D functions to AStar
| * | Added 2D functions to AStarChaosus2019-05-302-2/+172
| | |
* | | Fix AStar set/is_point_disabled crashChaosus2019-06-181-0/+6
| | |
* | | Merge pull request #29488 from Daw11/astar-remove-nodeRémi Verschelde2019-06-132-8/+21
|\ \ \ | | | | | | | | Fix the performance of remove_point of AStar
| * | | Save inside the Points of AStar the neighbours that aren't connectedDaw112019-06-042-8/+21
| | | | | | | | | | | | | | | | Improve the performance of remove_point because it doesn't have to search every neighbour of every node
* | | | Merge pull request #29702 from KoBeWi/fix_random_crashRémi Verschelde2019-06-121-1/+4
|\ \ \ \ | | | | | | | | | | Validate parameters of randi_range()
| * | | | Validate parameters of randi_range()Tomasz Chabora2019-06-121-1/+4
| |/ / /
* | | | Merge pull request #27193 from toasteater/fix/pcg-randfRémi Verschelde2019-06-122-8/+62
|\ \ \ \ | |_|_|/ |/| | | Improved uniformity of RandomPCG::randf.
| * | | Improved uniformity of RandomPCG::randf.toasteater2019-03-192-8/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating single precision floats, Godot casts a uint32_t to float, causing uniformity loss. This new randf, inspired by T. R. Campbell's random_real, samples the output of rand as the fraction part of an infinite binary number, with some tricks to reduce ops and branching. This method provides "good enough" uniformity at decent speed, for floats greater than 2^-64. Smaller numbers are floored to 0.
* | | | Fix Vector3 slerp method normalizing cross productToshiwo2019-06-071-1/+1
| |/ / |/| |
* | | Merge pull request #27789 from Giacom/move_towardsRémi Verschelde2019-06-017-0/+28
|\ \ \ | | | | | | | | Added move_toward functions for float, Vector2 and Vector3
| * | | Added move_toward functions for float, Vector2 and Vector3Giacom2019-05-287-0/+28
| | |/ | |/|
* | | Merge pull request #28957 from aaronfranke/basis-optimizeRémi Verschelde2019-05-271-11/+18
|\ \ \ | |/ / |/| | Optimize Basis constructor for Axis Angle
| * | Optimize Basis constructor for Axis AngleAaron Franke2019-05-171-11/+18
| | |
* | | Expose 2D Delaunay triangulation in Geometry singletonAndrii Doroshenko (Xrayez)2019-05-241-0/+14
| | | | | | | | | | | | | | | | | | | | | Can be used via scripting as `Geometry.triangulate_delaunay_2d(points)` The interface is the same as in `Triangulate` library, returning indices into triangulated points.
* | | Expose 2D polygon boolean operations in Geometry singletonAndrii Doroshenko (Xrayez)2019-05-222-1/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clipper 6.4.2 is used internally to perform polypaths clipping, as well as inflating/deflating polypaths. The following methods were added: ``` Geometry.merge_polygons_2d(poly_a, poly_b) # union Geometry.clip_polygons_2d(poly_a, poly_b) # difference Geometry.intersect_polygons_2d(poly_a, poly_b) # intersection Geometry.exclude_polygons_2d(poly_a, poly_b) # xor Geometry.clip_polyline_with_polygon_2d(poly_a, poly_b) Geometry.intersect_polyline_with_polygon_2d(poly_a, poly_b) Geometry.offset_polygon_2d(polygon, delta) # inflate/deflate Geometry.offset_polyline_2d(polyline, delta) # returns polygons // This one helps to implement CSG-like behaviour: Geometry.transform_points_2d(points, transform) ``` All the methods return an array of polygons/polylines. The resulting polygons could possibly be holes which could be checked with `Geometry.is_polygon_clockwise()` which was exposed to scripting as well.
* | | Fix typos with codespellRémi Verschelde2019-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 1.15.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear doubleclick leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* | | Merge pull request #28925 from Daw11/astar-sorted-arrayMax Hilbrunner2019-05-182-66/+47
|\ \ \ | |/ / |/| | Improve the performance of AStar
| * | Use a binary heap for the open list of AstarDaw112019-05-162-66/+47
| | |