Commit graph

68 commits

Author SHA1 Message Date
Rémi Verschelde
d69809cab6
Merge pull request #72947 from DarkKilauea/nav-fix-avoidance-callback
Fix missing avoidance updates when using same velocity
2023-02-09 10:13:35 +01:00
Josh Jones
097f8a5fdb Fix missing avoidance updates when using same velocity
When using avoidance, if you set the same velocity for the agent, you won't get an update from the avoidance system.

This changes both the `set_target_position` and `set_velocity` setters to always accept user provided values, even if they are the same. This ensures that repathing and avoidance logic is always run when the user expects.
2023-02-08 23:18:53 -08:00
smix8
820b841fcb Fix NavigationAgent debug functions bindings in release builds
Fixes that certain NavigationAgent debug functions bindings were not available in release builds.
2023-02-08 21:49:04 +01:00
Josh Jones
20fdfd466b Improve consistency of NavigationAgent setters 2023-02-02 22:51:37 -08:00
Rémi Verschelde
e52213e2fa
More codespell fixes, do more changes from previous ignore list 2023-02-01 12:11:36 +01:00
smix8
0ab764e84b Add NavigationAgent Path Debug Visualization
Adds path debug visuals for NavigationAgent2D, NavigationAgent3D and NavigationServer.
2023-01-31 18:27:35 +01:00
Josh Jones
22f9ef19e1 Use Callable for Navigation Agent callbacks 2023-01-27 23:14:36 -08:00
smix8
bf1571979c Rename Navigation uses of 'location' to 'position'
Contrary to the entire rest of the engine NavigationAgent's and NavigationLinks decided to deal with locations instead of positions.
2023-01-26 18:19:03 +01:00
smix8
594ffd2200 Tweak NavigationAgent2D defaults
Tweaks default values for NavigationAgent2D to work better out of the box within a new 2D project using default resolution.
2023-01-11 23:47:16 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
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-05 13:25:55 +01:00
Adam Scott
ea33001b95 Add safety-checks before some servers free() 2022-12-29 16:23:38 -05:00
Rémi Verschelde
f84c308cf8
Merge pull request #69688 from smix8/navagent_stop_origin_automove_4.x
Stop NavigationAgents without a target from moving to world origin
2022-12-21 19:39:25 +01:00
Josh Jones
5d8ba2b2d1 Add support for emitting a signal when entering a NavLink 2022-12-17 16:33:41 -08:00
smix8
34e7628f5f Fix Navigation API abbreviations inconsistency
Schema for navigation to name user facing API with  "navigation" without abbreviation and e.g. NavigationServer internals with abbr "nav".
2022-12-17 22:06:22 +01:00
smix8
194c1c44e0 Fix Navigation agent callback wild pointer crash
Fixes crash in sanitizer builds when callback agent or object are already freed.
2022-12-12 13:03:55 +01:00
smix8
860379fc16 Stop NavigationAgents without a target from moving to world origin
Stops NavigationAgents moving to the world origin without anyone telling them to do so.
2022-12-06 22:53:18 +01:00
Rémi Verschelde
0844f0ed10
Merge pull request #65452 from timothyqiu/agent-target
Make NavigationAgent `target_location` a property
2022-10-31 11:56:17 +01:00
Clay John
ada2661a2c
Merge pull request #67956 from RedMser/safe-velocity-type
Fix type of `safe_velocity` parameter
2022-10-28 10:57:46 -07:00
RedMser
b9c3a5534b Fix type of safe_velocity parameter 2022-10-27 22:45:24 +02:00
Sam Briels
815231943b Emit target_reached signal after state is updated 2022-10-27 14:05:43 +02:00
Haoyu Qiu
e4100495b5 Make NavigationAgent target_location a property 2022-10-27 13:51:38 +08:00
Josh Jones
a2c53b881b Update NavigationAgent to use query_path
This paves the way for having agents respond to link traversal.
2022-09-28 23:01:12 -06:00
Marc Gilleron
aed3822a93 Change return type of get_configuration_warnings to PackedStringArray 2022-09-19 16:43:15 +01:00
Micky
b62d06fbed Rename Navigation's neighbor_dist to neightbor_distance
NavigationAgent2D/3D.`neighbor_dist` -> `neighbor_distance` (also affects setters and getters)

NavigationServer2D/3D.`agent_set_neighbor_dist()` -> `agent_set_neighbor_distance()`

Also changes their parameters' names.

Doesn't affect "Agent.neighborDist_" in Agent.h
2022-08-13 12:40:55 +02:00
smix8
dde09be302 Group NavigationAgent properties
Groups the ill-defined NavigationAgent properties between pathfinding and avoidance to make it more clear which property affects what.
2022-06-29 18:42:51 +02:00
Rémi Verschelde
21b0c7fc22
Merge pull request #62214 from smix8/navigation_layer_bitmask_helpers_4.x 2022-06-20 15:13:33 +02:00
smix8
55923ade68 Add navigation layer bitmask helper functions
Adds helper functions to work with the navigation layer bitmask.
2022-06-19 13:47:19 +02:00
smix8
07740302f3 Add NavigationAgent desired path distance
Add NavigationAgent desired path distance
2022-06-18 19:11:49 +02:00
smix8
245da150e7 Streamline Navigation layer function names.
Streamline Navigation layer function names.
2022-06-15 00:18:48 +02:00
smix8
f10ff0efda Add NavigationAgent set_navigation_map() function
Add NavigationAgent set_navigation_map() and get_navigation_map() function.
2022-06-14 21:48:47 +02:00
smix8
56fe26b5e0 Fix NavigationAgent reparent issues
Fix NavigationAgent reparent issues
2022-06-01 06:45:12 +02:00
smix8
7f3688603c Process NavigationAgent2D/3D avoidance on demand only
Changes NavigationAgent avoidance callback to a toggle that is disabled by default.
Also fixes a few missing descriptions / wrong warnings.
2022-05-20 23:47:10 +02:00
Aaron Franke
5dc3bfb80e
Use suffixes for units in nodes and resources 2022-05-19 14:34:27 -05: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
26048c805b
Merge pull request #59331 from bartekd97/navigation-agent-layers 2022-04-01 13:35:51 +02:00
Rémi Verschelde
7119d355eb String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
2022-03-28 20:26:35 +02:00
BARTEK-PC\Bartek
4972f1b864 Expose navigable layers for NavigationAgent2D/3D 2022-03-20 15:04:56 +01:00
Rémi Verschelde
0f5455230c
Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde
4dbef3a4f5
i18n: Sync template with current 3.x codebase
Weblate will now track the state of `3.x` to prepare for the 3.5 release.

(cherry picked from commit 02d9ac1071)
2022-01-07 13:35:28 +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
Duroxxigar
54d305eebe Improved readability for failing error conditions 2021-10-08 17:29:25 -04:00
Anilforextra
c390f0515d Use get_global_* functions instead of using transforms. 2021-08-14 14:01:57 +05:45
Aaron Franke
eb4902a455
Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
reduz
6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Rémi Verschelde
3a0cfd3d85
Merge pull request #47960 from smix8/issue_47334_navagent2d_target_reached 2021-04-27 13:34:48 +02:00
smix8
0b87cb5e3d put distance check to target into function
put distance check to target into function
2021-04-27 11:22:37 +02:00
smix8
a491071c24 Fix broken NavigationAgent2D collision avoidance callbacks
Fix broken NavigationAgent2D collision avoidance callbacks
2021-04-20 01:56:04 +02:00
smix8
cd24a63da2 Fix NavigationAgent2D not emitting "target_reached" Signal reliably
Fix NavigationAgent2D not emitting "target_reached" Signal reliably
2021-04-16 22:04:02 +02:00
Nathan Franke
2a8c59c171
Use Array for node configuration warnings
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
2021-04-11 23:25:38 -05:00