summaryrefslogtreecommitdiff
path: root/core/math
AgeCommit message (Collapse)Author
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
2021-12-02Merge pull request #47294 from sebastian-heinz/patch-1Rémi Verschelde
2021-12-02Merge pull request #38604 from Calinou/astar-rename-get-point-idsRémi Verschelde
2021-12-02allow variant construction in expressionssebastian-heinz
2021-12-01Rename Vector parameters to be consistentRaul Santos
Renames parameters that were named differently across different scripting languages or their documentation to use the same name everywhere.
2021-11-30Warn when using an AABB or Rect2 with a negative sizeAaron Franke
2021-11-30Rename `AStar.get_points()` to `AStar.get_point_ids()` for clarityHugo Locurcio
The same has been done for AStar2D as well.
2021-11-30Don't return reference on copy assignment operatorsRémi Verschelde
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this can lead to confusing code and subtle bugs. According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++ allows any arbitrary return type, so this is standard compliant. This could be re-assessed if/when we have an actual need for a behavior more akin to that of the C++ STL, for now this PR simply changes a handful of cases which were inconsistent with the rest of the codebase (`void` return type was already the most common case prior to this commit).
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-17Merge pull request #55042 from nekomatata/fix-segment-intersectionRémi Verschelde
2021-11-17Expose `randfn` to global scopeYuri Roubinsky
2021-11-16Fix segment intersection in Geometry2DPouleyKetchoupp
Doing a multiplication to reduce the amount of tests was causing precision which lead to 2D raycast detecting false positive contacts in some cases with convex polygons.
2021-11-16Rename built-in `SGN()` macro to `SIGN()`Hugo Locurcio
This matches the name of the GDScript function (except it's uppercase here).
2021-11-15Merge pull request #43072 from KoBeWi/point_to_angleRémi Verschelde
2021-11-11Color: Bind `from_hsv` as static methodRémi Verschelde
2021-11-09Merge pull request #53819 from TokageItLab/re-implement-ping-pongRémi Verschelde
Reimplement ping-pong animation and reverse playback
2021-11-09Fix Vector2.angle_to_point() being reversedTomasz Chabora
2021-11-05Rename AABB `get_area` to `get_volume`Brian Semrau
2021-11-04Fix Quaternion multiplication operatorAaron Franke
2021-11-03reimplement ping-pongSilc 'Tokage' Renew
2021-10-28clang-format: Enable `BreakBeforeTernaryOperators`Rémi Verschelde
clang-format keeps breaking the way it handles break *after* ternary operators, so I give up and go with the only style they seem to actually test.
2021-10-28clang-format: Various fixes to comments alignment from `clang-format` 13Rémi Verschelde
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28clang-format: Disable alignment of operands, too unreliableRémi Verschelde
Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
2021-10-25Refactored Node3D rotation modesreduz
* Made the Basis euler orders indexed via enum. * Node3D has a new rotation_order property to choose Euler rotation order. * Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations. The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).