summaryrefslogtreecommitdiff
path: root/core/math
AgeCommit message (Collapse)Author
2023-05-12Enable shadow warnings and fix raised errorsNinni Pipping
(cherry picked from commit 71ee65dc5701a0675ae6b1879a694a28c7206a63)
2023-05-12Make acos and asin safelawnjelly
A common bug with using acos and asin is that input outside -1 to 1 range will result in Nan output. This can occur due to floating point error in the input. The standard solution is to provide safe_acos function with clamped input. For Godot it may make more sense to make the standard functions safe. (cherry picked from commit 50c5ed4876250f785be54b8f6124e7663afa38dc)
2023-03-27Fix randfn to prevent generating of nan valuesYuri Rubinsky
(cherry picked from commit d11bb866ffb1d5e0215ffc11dd6848a11976d90e)
2023-02-28Minor typo and docs URL fixesRémi Verschelde
2023-02-20BVH - fix lockguards for multithread modelawnjelly
Due to a lack of variable name, the BVH lock guards lifetimes previously did not cover the whole function call. This is fixed, and the warning message for contention is removed as multithread mode seems to be desired in production in 4.x.
2023-02-13Bias octahedral tangent y axis to avoid errors around 0clayjohn
2023-02-11Merge pull request #72316 from 0xafbf/component-wise-minmaxRémi Verschelde
Added component-wise `min` and `max` functions for vectors
2023-02-11Added component-wise `min` and `max` functions for vectorsAndrés Botero
2023-02-11Math: Prevent division by zero in posmodRémi Verschelde
Fixes #43932. Co-authored-by: David Hoppenbrouwers <david@salt-inc.org>
2023-02-04Fix scaled_orthogonal() & subgizmo global scalingSilc Renew
2023-02-01More codespell fixes, do more changes from previous ignore listRémi Verschelde
2023-02-01Fix various typos with codespellRémi Verschelde
Finally do the childs -> children rename too.
2023-01-28Add support for interpolating skewed transformsAaron Franke
2023-01-27Merge pull request #72170 from Chaosus/astar_fixYuri Rubinsky
2023-01-27Merge pull request #72168 from RandomShaper/sensible_lock_returnRémi Verschelde
Booleanize various sync primitives' wait & locking methods
2023-01-27Enchance the performance of AStar by using a LocalVector(2)Yuri Rubinsky
2023-01-27Booleanize various sync primitives' wait & locking methodsPedro J. Estébanez
2023-01-26Fix range loop iteration regressionsbitsawer
2023-01-23Convert en_GB spelling to en_US with codespellRémi Verschelde
2023-01-23Merge pull request #71676 from vnen/gdscript-unicode-identifiersRémi Verschelde
Add support for Unicode identifiers in GDScript and Expression
2023-01-22Enchance the performance of `AStar` by using a `LocalVector`Yuri Rubinsky
2023-01-21Use range iterators in LocalVector loopskobewi
2023-01-21Add support for Unicode identifiers in Expression classGeorge Marques
2023-01-19Cleanup unused engine code v2kobewi
2023-01-15Rename `center` method to `get_center` in Plane.Raul Santos
2023-01-08Fix error in `AstarGrid2D::get_id_path`Yuri Rubinsky
2023-01-06Fix jumping in `AStarGrid2D` when `DIAGONAL_MODE_NEVER` is enabledYuri Rubinsky
2023-01-06Merge pull request #70547 from TokageItLab/pingpong-wrapRémi Verschelde
Fix pingpong-loop with `loop_wrap` is not working & clean-up cubic interpolation key retrieve process
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-01Optimize `wrapf` function a bitYuri Rubinsky
2022-12-25Fix pingpong with loop wrap is not workingSilc Renew
2022-12-24Divide `AStarGrid2D::default_heuristic` into two different heuristicsYuri Rubinsky
2022-12-21Merge pull request #70403 from rburing/fix_edge_map_capacityRémi Verschelde
Fix edge map capacity in convex hull computer
2022-12-21Fix edge map capacity in convex hull computerRicardo Buring
The desired capacity could be less than the default, so reserve would error.
2022-12-20Add `get_point_position` method to `AStarGrid2D`Yuri Rubinsky
2022-12-20Restore weight scale for `AStarGrid2D` (partially)Yuri Rubinsky
2022-12-15[RTL/TextServer] Add baseline inline alignment mode for objects and RTL tables.bruvzg
2022-12-15Fix "p_zfar" to "p_znear" in Projection.create_orthogonalHei
Was confused why it always gave inf:s.
2022-11-24Merge pull request #68386 from MewPurPur/snappedi-snappedfRémi Verschelde
Implement snappedi, snappedf, and Vector[2/3/4]i.snapped
2022-11-24Refactor interpolating functions in some classes to use Math classSilc Renew
2022-11-24Refactor Curve3D::_bake() methodYaohua Xiong
The main change is to caculate tangent directly from bezier curve, without going through discretized polyline, avoiding pitfalls of discretization. Other changes are: 1. Add an bezier_derivative() method for Vector3, Vector2, and Math; 2. Add an tesselate_even_length() method to Curve3D, which tesselate bezier curve to even length segments adaptively; 3. Cache the tangent vectors in baked_tangent_vector_cache;
2022-11-19Implement snappedi, snappedf, and Vector[2/3/4]i.snappedVolTer
2022-11-18Static analysis: remove "break" after "return"Andy Maloney
Changes as requested to keep in sync with godotengine/godot-cpp#929
2022-11-14Fix periods in editor strings and messagesHugo Locurcio
- Ensure all strings with ellipsis end with 3 periods instead of 2. - Fix extraneous period in "Error calling from signal '...' to callable" messages.
2022-11-02Allow getting Quaternion rotation in different Euler ordersAaron Franke
2022-11-02Merge pull request #66747 from aaronfranke/move-euler-orderRémi Verschelde
Move EulerOrder enum to math_defs.h and global scope
2022-11-02Move EulerOrder enum to math_defs.h and global scopeAaron Franke
2022-11-02Style: Misc docs and comment style and language fixesRémi Verschelde
- Removed empty paragraphs in XML. - Consistently use bold style for "Example:", on a new line. - Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`). - Fix invalid usage of backticks for inline code in BBCode. - Fix some American/British English spelling inconsistencies. - Other minor fixes spotted along the way, including typo fixes with codespell. - Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-01Replace Quaternion Euler constructor with `from_euler` methodAaron Franke
2022-10-13Merge pull request #67057 from Anutrix/rng-generator-default-seedRémi Verschelde