summaryrefslogtreecommitdiff
path: root/core/math
AgeCommit message (Collapse)Author
2022-03-09Remove VARIANT_ARG* macrosreduz
* Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-07VariantUtility: Unexpose `Math::range_step_decimals`Rémi Verschelde
This method was meant only as a convenience for editor code to allow using a step of 0 to disable snapping. It was exposed by mistake when refactoring GlobalScope.
2022-03-07Protection for array operator for Vector2 / 3 in DEV buildslawnjelly
A previous PR had changed the array operator to give unbounded access. This could cause crashes where old code depended on this previous safe behaviour. This PR adds DEV_ASSERT macros for out of bound access to DEV builds, allowing us to quickly identify bugs in calling code, without affecting performance in release or release_debug editor builds.
2022-03-04Merge pull request #57630 from lawnjelly/bvh4_templated_checksRémi Verschelde
[4.x] BVH - Sync BVH with 3.x
2022-03-01Merge pull request #58488 from lawnjelly/float_literals_castsRémi Verschelde
2022-02-26Use is_zero_approx and fix spelling in CameraMatrix invertAaron Franke
2022-02-24Float literals - fix main primitives to use real_t castinglawnjelly
Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
2022-02-19Core: Use forward declares for Vector3/Vector3iRémi Verschelde
Add add Vector3 operator in Vector3i.
2022-02-16Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
2022-02-12Implement cubic_interpolate() as MathFunc for refactoringSilc 'Tokage' Renew
2022-02-10Float literals - fix main primitives to use .flawnjelly
Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
2022-02-09Fix Vector2 and Vector2i coord access via operator[]Bartłomiej T. Listwon
2022-02-07Merge pull request #57729 from TechnoPorg/astar-fix-invalid-includeRémi Verschelde
Remove a cross include from a_star.cpp
2022-02-06Remove a cross include from a_star.cppTechnoPorg
2022-02-06Fix integer vector mul/div operators and bindings.reduz
* Vector2i and Vector3i mul/div by a float results in Vector2 and Vector3 respectively. * Create specializations to allow proper bindings. This fixes #44408 and supersedes #44441 and keeps the same rule of int <op> float returnig float, like with scalars.
2022-02-05Merge pull request #57620 from Haydoggo/expression-exp-fixRémi Verschelde
Fix Expression's parsing of positive exponent literals
2022-02-05Make parser treat all exponent literals as floatHayden
2022-02-04Merge pull request #57623 from akien-mga/core-math-struct-em-allRémi Verschelde
2022-02-04BVH - Sync BVH with 3.xlawnjelly
Templated mask checks and generic NUM_TREES Fix leaking leaves
2022-02-04Core: Make all Variant math types structsRémi Verschelde
Some were declared as structs (public by default) and others as classes (private by default) but in practice all these math types exposed as Variants are all 100% public.
2022-02-04Core: Move Vector2i to its own `vector2i.h` headerRémi Verschelde
Also reduce interdependencies and clean up a bit.
2022-02-04Core: Move Rect2i to its own `rect2i.h` headerRémi Verschelde
And take the opportunity to improve interdependencies a bit with forward declares where possible.
2022-02-04Cleanup and move char functions to the `char_utils.h` header.bruvzg
2022-02-04Added hex and bin literal support to Expression parserHayden Leete
fixed formatting
2022-02-02Vectors: Use clear() and has().Anilforextra
Use clear() instead of resize(0). Use has() instead of "find(p_val) != -1".
2022-02-01Merge pull request #57469 from Sauermann/fix-rect2i-intersectRémi Verschelde
2022-01-31Fix incorrect Rect2i calculations: intersects and enclosesMarkus Sauermann
Clarify expand documentation
2022-01-30Add support for the escaped UTF-16 and UTF-32 Unicode characters in the ↵bruvzg
scripts and expressions.
2022-01-20Rename or refactor macros to avoid leading underscoresOmar Polo
These are not used consistently and some can conflict with system-specific defines. While here, also delete some unused macros.
2022-01-20Add nodiscard to core math classes to catch c++ errors.lawnjelly
A common source of errors is to call functions (such as round()) expecting them to work in place, but them actually being designed only to return the processed value. Not using the return value in this case in indicative of a bug, and can be flagged as a warning by using the [[nodiscard]] attribute.
2022-01-14Remove zero size checks from Rect2 grow methodsAaron Franke
2022-01-13Merge pull request #56740 from AnilBK/camera-pre-allocateRémi Verschelde
2022-01-13CameraMatrix: Pre-allocate Vector in get_projection_planes().Anilforextra
2022-01-12Merge pull request #56492 from akien-mga/remove-author-docstringsRémi Verschelde
2022-01-12Use List Initializations for Vectors.Anilforextra
2022-01-07Merge pull request #53618 from aaronfranke/signed-angle-vec3iRémi Verschelde
Add length and length_squared to Vector2i/3i
2022-01-07Merge pull request #55877 from aaronfranke/slerp-same-lenRémi Verschelde
2022-01-07Fix typos with codespellRémi Verschelde
Using codespell 2.1.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang ans ba curvelinear dof doubleclick fave findn gird inout leapyear lod merchantibility nd numer ois ony que readded seeked statics
2022-01-06Allow Vector2/3 slerp values to have any lengthAaron Franke
2022-01-06Add length and length_squared to Vector2i/3iAaron Franke
2022-01-05Merge pull request #53684 from TokageItLab/orthogonal-modeRémi Verschelde
2022-01-04Style: Remove inconsistently used `@author` docstringsRémi Verschelde
Each file in Godot has had multiple contributors who co-authored it over the years, and the information of who was the original person to create that file is not very relevant, especially when used so inconsistently. `git blame` is a much better way to know who initially authored or later modified a given chunk of code, and most IDEs now have good integration to show this information.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-25Fix some gizmo behavior to make more consistentSilc 'Tokage' Renew
2021-12-19Fix variable name 'max_size' to 'min_size' in aabbgreat90
2021-12-18Fix font preview text color on light backgroundHaoyu Qiu
2021-12-09align to horizontal_alignment, valign to vertical_alignment, relatedNathan Franke
2021-12-02Expose max_axis_index and max_axis_index for Vector2(i)Aaron Franke
Some cleanup with Vector3(i)'s methods so that it is consistent with Vector2, for example it returns enums internally (GDScript still gets ints).
2021-12-02Merge pull request #55474 from akien-mga/copy-operators-no-referenceRémi Verschelde
2021-12-02Merge pull request #37626 from aaronfranke/rect2-warningsMax Hilbrunner
Print warnings when using a Rect2 or AABB with a negative size