Commit Graph

1022 Commits

Author SHA1 Message Date
lawnjelly b35264ad95 Fix AABB Ray intersection - return inside
* Separates find_intersects from test_intersects for rays, and wraps the former.
* Changes parameter name to "r_intersection_point".
* Fixes broken old version which returned per axis t.
* Returns whether the ray origin is within the AABB.
* Returns intersection point when origin outside.
* Returns "backtracking" intersection point when inside.
* Returns sensible normal when inside.
* Returns valid results on borders.
* Returns robust results dealing with floating point error.

Co-authored-by: Claire Blackshaw <evilkimau@gmail.com>
2024-05-09 20:41:19 +01:00
Jakub Marcowski 7699d678c4
Fix `builtin_embree=no` build linking the wrong version of Embree 2024-05-08 00:40:45 +02:00
K. S. Ernest (iFire) Lee f9b488508c
Add PackedVector4Array Variant type
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-05-03 00:58:27 +02:00
A Thousand Ships 308dbb8c63
[Core] Add scalar versions of `Vector*` `min/max/clamp/snap(ped)`
Convenience for a number of cases operating on single values
2024-05-02 10:31:13 +02:00
Rémi Verschelde 61d146c89e
Merge pull request #90748 from aaronfranke/fix-basis-scale-global
Fix incorrect name of internal Basis global scale getter
2024-04-22 12:52:52 +02:00
Rémi Verschelde 4b6629978e
Merge pull request #90701 from permelin/improve-delaunay3d-triangulation
Delaunay3D/LightmapGI: Improve triangulation
2024-04-22 12:52:12 +02:00
Ricardo Buring 8a28f816d0 Replace Clipper1 library by Clipper2 library 2024-04-20 13:37:59 +02:00
Aaron Franke e83807ef85
Fix incorrect name of Basis global scale getter 2024-04-16 04:26:52 -07:00
Per Melin 89d0934f71 Delaunay3D: Improve triangulation 2024-04-15 18:48:21 +02:00
Thaddeus Crews bbb3eb3a1a
Update lingering `do/while(0)` defines 2024-04-04 14:17:22 -05:00
Rémi Verschelde c5ac5d2308
Merge pull request #90063 from aaronfranke/really-floaty
Fix some uses of `float` and `real_t` in `core/math`
2024-04-04 14:36:57 +02:00
Rémi Verschelde 69a4ff8996
Merge pull request #88328 from Khasehemwy/reversed-z
Use Reverse Z for the depth buffer
2024-04-04 14:30:53 +02:00
Khasehemwy d950f5f838
Use Reverse Z for the depth buffer 2024-04-04 13:54:15 +02:00
ashley aa1bbe1542 add partial path return option for astar
* AStar2D, AStar3D and AStarGrid2D now can return a partial path if the destination point isn't reachable but still in the map. This option is available for both get_point_path and get_id_path
2024-04-03 22:27:33 -07:00
Aaron Franke 158fcf107c
Fix some uses of float and real_t in core/math 2024-03-29 16:44:12 -07:00
Rémi Verschelde c258da378b
Merge pull request #89619 from AThousandShips/rand_fix
[Core] Fix `rand_weighted` not using the current state
2024-03-24 01:19:20 +01:00
Rémi Verschelde cd4e4c0fcc
Merge pull request #89111 from AThousandShips/vec_use
Use `Vector*` component-wise `min/max/clamp` functions where applicable
2024-03-24 01:14:51 +01:00
Ricardo Buring 2ed2ccc2d8 Fixed Timestep Interpolation (2D)
Adds fixed timestep interpolation to the rendering server (2D only).
Switchable on and off with a project setting (default is off).

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2024-03-23 12:28:36 +01:00
A Thousand Ships 79ba22a73f
Use `Vector*` component-wise `min/max/clamp` functions where applicable 2024-03-20 13:47:42 +01:00
A Thousand Ships 9c518d5f42
[Core] Fix `rand_weighted` not using the current state
The method incorrectly used `Math::randf` instead of `randf`
2024-03-17 19:21:16 +01:00
Thaddeus Crews 9903e6779b
Enforce template syntax `typename` over `class` 2024-03-07 22:39:09 -06:00
A Thousand Ships a497a5cb3e
[Core] Codestyle improvements to math types 2024-03-04 18:17:10 +01:00
David Luevano Alvarado 981883d041 Fix `RandomNumberGenerator::rand_weighted` return type 2024-03-02 20:56:01 -06:00
Rémi Verschelde bd7637248c
Merge pull request #88883 from joaoh82/add-weighted-random-method
Add `RandomNumberGenerator::rand_weighted` method
2024-03-01 15:00:32 +01:00
João Henrique Machado Silva 88df5ea8ac Add RandomNumberGenerator::rand_weighted method 2024-02-29 13:29:53 +01:00
Rémi Verschelde 3a08c646ee
Pre-commit: Update to clang-format 17.0.6 and black 24.2.0 2024-02-28 14:25:35 +01:00
Robert Yevdokimov 13e82094ee Remove word duplicates in comments and strings, and fix casing and punctuation 2024-02-23 17:28:28 -05:00
Muller-Castro a8bc9f3e78 Add const lvalue ref to core/* container parameters 2024-02-14 11:20:36 -03:00
A Thousand Ships d8b29efe66
Fix member names of `AudioFrame` to match extension 2024-02-13 15:37:09 +01:00
Silc Lizard (Tokage) Renew 67e38709fd Avoid unqualified-id "near" and "far" in Node3DEditor/Viewport 2024-02-13 18:53:21 +09:00
A Thousand Ships 684752e75b
Replace error checks against `size` with `is_empty` 2024-02-09 12:50:15 +01:00
Rémi Verschelde fa48a51183
Merge pull request #87688 from AThousandShips/what_is_this
Remove unnecessary `this->` expressions
2024-01-29 13:18:09 +01:00
A Thousand Ships 15369fdb1d
Remove unnecessary `this->` expressions 2024-01-29 09:59:18 +01:00
Hugo Locurcio 0437db0106
Display values in vector/quaternion math function errors
This can help track down the source of the error more easily.
2024-01-28 18:45:46 +01:00
Hendrik Brucker 9d7c2978f4 Rework GraphEdit connections (drawing, API, optimizations)
- GraphEdit now uses Line2D nodes to draw connection lines and uses a dedicated canvas item shader for them
2024-01-18 16:53:15 +01:00
A Thousand Ships b4191bf8f6
[Core] Fix `AABB.encloses` failing on shared upper bound
This differs from `Rect2(i)` and was fixed for those classes in the past
2024-01-12 17:58:42 +01:00
Rémi Verschelde acd37f98c0
Merge pull request #83353 from Chubercik/expose_delaunay_3d
Expose 3D Delaunay tetrahedralization in `Geometry3D`
2024-01-04 16:39:23 +01:00
Rémi Verschelde 18e9133d5a
Merge pull request #86364 from aaronfranke/basis-divide
Add and expose Basis/Transform2D/3D division by float operator
2024-01-04 14:26:16 +01:00
Rémi Verschelde bbfcfe50da
Merge pull request #81267 from Chaosus/astargrid_isometric_mode
Add isometric cell shape mode to `AStarGrid2D`.
2024-01-04 14:25:00 +01:00
Rémi Verschelde 22e880ad20
Merge pull request #83163 from Chubercik/vectorXi_dist_methods
Implement `Vector2i/3i/4i` methods: `distance_to` and `distance_squared_to`
2024-01-03 09:58:36 +01:00
Rémi Verschelde 8317b459df
Merge pull request #86590 from rune-scape/rune-uninitialized-astar
Initialize pointers in a_star.cpp
2024-01-02 18:05:48 +01:00
EddieBreeg 8747c67d9e
Fix potential integer underflow in rounded up divisions
A new `Math::division_round_up()` function was added, allowing for easy
and correct computation of integer divisions when the result needs to
be rounded up.

Fixes #80358.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-01-02 14:14:47 +01:00
rune-scape b6a53e62bc Initialize pointers in a_star.cpp 2023-12-28 13:58:11 -08:00
Aaron Franke c77ae051d5
Add and expose Basis/Transform2D/3D division by float operator 2023-12-20 18:24:03 -06:00
Alistair Leslie-Hughes 46531964d0 Improve DynamicBVH code to make it clearer how the stack/heap works.
Inspired by a Coverity issue about possible memcpy usage and overlapping memory.
2023-12-13 09:03:19 +11:00
Aaron Franke 7ee273723d
Fix Basis is_orthogonal and is_rotation methods, add is_orthonormal 2023-12-06 13:12:05 -06:00
Pedro J. Estébanez fe4850c0d0 Use mingw-std-threads in MinGW builds 2023-11-18 11:56:05 +01:00
Silc Lizard (Tokage) Renew 80c9533810 Rework blending method in Variant animation for Int/Array/String 2023-11-16 21:37:18 +09:00
Jakub Marcowski c33e291474 Update `triangulate_delaunay()` to avoid needless reallocations 2023-10-16 12:37:57 +02:00
Jakub Marcowski bc78c832e9 Expose 3D Delaunay tetrahedralization in `Geometry3D` 2023-10-16 11:48:49 +02:00