Commit graph

62 commits

Author SHA1 Message Date
smix8
245da150e7 Streamline Navigation layer function names.
Streamline Navigation layer function names.
2022-06-15 00:18:48 +02:00
smix8
bc38ebe4f0 Fix crash of navigation agents callback when object is invalid
Fix crash of navigation agents callback when object is invalid.
2022-06-14 13:04:02 +02:00
Rémi Verschelde
4e3b0e176b
Merge pull request #61682 from smix8/navigation_bake_config_precision_4.x 2022-06-08 16:06:00 +02:00
Rémi Verschelde
e4994e2817
Merge pull request #61739 from smix8/navigation_region_cost_4.x 2022-06-08 16:05:38 +02:00
smix8
cfdfd304f1 Add NavigationRegion costs for pathfinding
Add NavigationRegion costs for pathfinding.
2022-06-06 15:25:06 +02:00
smix8
df9919ec33 Add warnings when NavigationMesh bake settings result in precision loss
Add warnings when NavigationMesh bake settings result in precision loss.
2022-06-04 11:31:52 +02:00
smix8
3066091780 Match NavMap and ProjectSettings with NavigationMesh defaults
Match NavMap and ProjectSettings with NavigationMesh defaults since the NavMap edge merging requires a matching cell_size with the NavigationMesh to create connections without issues.
2022-06-03 19:17:49 +02:00
smix8
caceceab08 Fix MultiMeshInstance crash in navmesh baking when MultiMesh Resource is empty
Fix MultiMeshInstance crash in navmesh baking when MultiMesh Resource is empty
2022-05-27 19:35:00 +02:00
Rémi Verschelde
ce069fbe99
Merge pull request #61128 from smix8/navigation_agent_process_mode_4.x 2022-05-19 15:24:34 +02:00
Rémi Verschelde
86cdf1f2cf rvo2: Sync with upstream commit bfc0486
bfc048670a
2022-05-18 14:53:52 +02:00
smix8
6b51ab66d8 Make Navigation Agents and Obstacles respect parent process mode
Temporarily removes agent from navigation map when parent node cannot process due to SceneTree pause and process_mode property. Normal process_mode does not work as other agents would still avoid the paused agents because they were still active on the navigation map and the rvo world. Also fixes potential crash when region_get_map or agent_get_map is called while no map is set.
2022-05-17 20:08:39 +02:00
Rémi Verschelde
eaa4e86433
Merge pull request #61061 from smix8/navigation_mesh_sample_distance_range_4.x 2022-05-16 15:05:17 +02:00
smix8
e33fa9d833 Clamp NavigationMesh sample_distance above zero
While default ReCast library has support for 0.0 'sample_distance' the Godot implementation does not an crashes.
Previously Godot would set all sample_distance values below 0.9 to 0 which causes the crashes.

This limits the sample_distance range selection to 0.1 - 16.0 and also clamps sample_distance that are below 0.1 before ReCast receives them.
2022-05-16 14:25:20 +02:00
Rémi Verschelde
f3c0e75fba
Merge pull request #60958 from smix8/navigation_server_rid_utility_4.x 2022-05-16 13:46:49 +02:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
smix8
371054e3e5 Add NavigationServer2D/3D API functions to find missing RID info
Utility functions for NavigationServer2D/3D to find missing RID information when working with Server API directly. e.g. from map to regions and agents, from agent or region to map, from region to map and agents and so on ....

Requirement to work with NavigationServer API exklusive without SceneTree nodes and when juggling agents and regions between multiple navigation maps.
2022-05-12 20:23:19 +02:00
smix8
79511af7c9 Add Warning to NavigationMesh bake when source geometry is suspiciously big
Adds Warning when users try to bake a NavigationMesh with suspiciously big source geometry and small cellsizes as this baking process will likely fail or result in a NavigationMesh that will create serious pathfinding performance issues.
2022-05-11 22:06:54 +02:00
reduz
de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
trollodel
72c37c4bcd Use CollisionObject3D API when baking the navmesh with static colliders, instead of collecting CollisionShape3D nodes 2022-05-02 08:41:33 +02:00
Rémi Verschelde
8dfa12cae7
Merge pull request #59979 from bruvzg/cpp_check2 2022-04-27 10:08:26 +02:00
bruvzg
40f0b23482
Create NavMap thread pool only when it's used, to prevent creating excessive amount of running threads. 2022-04-26 15:00:00 +03:00
Rémi Verschelde
c45202a89b
Merge pull request #60359 from adamscott/nav-map-thread-work-pool 2022-04-26 11:51:02 +02:00
Pawel Lampe
66856d5fb0 Fix crash in GodotNavigationServer::map_get_path 2022-04-22 18:49:45 +02:00
bruvzg
de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
Adam Scott
732102cbc5 Use ThreadWorkPool instead of thread_process_array in NavMap 2022-04-19 18:35:15 -04:00
kleonc
9ab69b89f8 NavMap::get_path Fix not resetting least_cost_id 2022-04-14 17:13:53 +02:00
Pawel Lampe
fcd26b8841 Fix navmesh baking
- improved mesh data calculation from standalone static colliders so that no
  VisualServer calls are performed - and thus no VS mutexes need to
  be locked in case of on-thread baking
- improved the same for GridMap's static colliders
2022-04-08 21:01:59 +02:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Pawel Lampe
dcab82ad43 Fix get_simple_path behavior in 2D & 3D 2022-04-05 23:26:37 +02:00
Rémi Verschelde
b78aa4fe19 Style: Apply clang-tidy to current code, add readability-redundant-member-init 2022-04-04 21:49:51 +02:00
Rémi Verschelde
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
Rémi Verschelde
5fe6984639 Modules: Don't build editor-specific classes in templates
They're moved to an `editor` subfolder so that we can easily handle them
separately.
2022-03-28 16:48:15 +02:00
reduz
21637dfc25 Remove VARIANT_ARG* macros
* 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-09 18:39:13 +01:00
Rémi Verschelde
e031aa06ee Core: Use forward declares for Vector3/Vector3i
Add add Vector3 operator in Vector3i.
2022-02-19 16:47:24 +01:00
Jakob Bouchard
6553f5c242
Convert _notification methods to switch - Chunk C 2022-02-16 13:03:05 -05:00
Rémi Verschelde
11572c6e30
Editor: Cleanup some includes dependencies
Removes some unnecessary includes from `editor_node.h`, and instead add
those where they're used.

Removes unnecessary `editor_node.h` includes in various editor classes.

Renames `dynamicfont` to `dynamic_font` in a couple files.

Misc cleanup while jumping through that rabbit hole.
2022-02-15 14:54:15 +01:00
trollodel
cd1d7294d8 Remove the EditorNode parameter from EditorPlugins create methods
Remove EditorNode usage from the Navigation editor plugin.
2022-02-14 18:21:42 +01:00
kleonc
5422d863e1 NavMap Fix polygons being treated like triangle strips instead of triangle fans 2022-02-13 19:26:17 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Pawel Lampe
a30dd094d3 Fix transforms involved into navmesh baking
Within the context of parsing navigation geometry, this commit:
- added missing transform of `MultiMeshInstance`
- changed all transforms to global ones so that they don't need to be
  calculated by hand
2022-01-31 23:07:45 +01:00
rafallus
cc46abd73d Consider gridmap collisions in navigation bake 2022-01-16 18:56:10 -06:00
Rémi Verschelde
ba2bdc478b
Style: Remove inconsistently used @author docstrings
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-04 20:42:50 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Rémi Verschelde
1f666a972f
NavigationMeshInstance: Fix typo to 'vertices' 2021-12-03 01:54:15 +01:00
Carlo Cabanilla
75b61ea1f4 Let MultiMeshInstances affect NavigationMeshes 2021-12-02 14:50:49 -08:00
Lightning_A
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
Rémi Verschelde
88c4380737
Modules: Make sure to include modules_enabled.gen.h where needed 2021-11-12 13:42:58 +01:00
Rémi Verschelde
133c1eb0af
Merge pull request #52367 from Duroxxigar/improve-nav-error-messages
Improve readability for failing errors in nav area
2021-10-21 19:36:16 +02:00
Duroxxigar
54d305eebe Improved readability for failing error conditions 2021-10-08 17:29:25 -04:00
Lightning_A
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00