summaryrefslogtreecommitdiff
path: root/scene/2d/navigation_region_2d.cpp
AgeCommit message (Collapse)Author
2023-01-07Rework const on NavigationServer methodsJosh Jones
`const` is used on all methods, even when they cause modification of the server. This reworks the methods of the server to only use `const` on method that don't change the state of the server.
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".
2022-12-29Add safety-checks before some servers `free()`Adam Scott
2022-12-20Fix typo and ensure backwards compatibility for changed property namesJosh Jones
Changes to the name of the `navmesh` and `navpoly` properties on `NavigationRegion` caused navigation data to be lost on load. This PR creates uses `_set`/`_get` to handle compatibility with the older names on load, preserving the data. Also fixes a typo on `get_vertices_per_polygon` in `NavigationMesh`, and renames the property to remove the `polygon_` prefix which doesn't match the setter/getter. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-12-17Fix Navigation API abbreviations inconsistencysmix8
Schema for navigation to name user facing API with "navigation" without abbreviation and e.g. NavigationServer internals with abbr "nav".
2022-12-17Move NavigationPolygon to dedicated resource filesmix8
Moves NavigationPolygon resource class from NavigationRegion2D file to a dedicated file in resource folder.
2022-12-10Enable assigning an owner to navigation regions and linksJosh Jones
This allows users of the server APIs to get back the nodes that created certain regions and links.
2022-11-10Add detail to NavigationPolygon outline error msgsmix8
Adds additional information to the error msg when the convex partition fails due to invalid outline arrays.
2022-09-21Improve consistancy of NavigationRegion settersJosh Jones
2022-09-19Change return type of `get_configuration_warnings` to `PackedStringArray`Marc Gilleron
2022-08-29Rename `CanvasItem.update()` to `queue_redraw()`Micky
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on. Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency. Just a few comments have also been changed to say "redraw". In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-08Merge pull request #64034 from DarkKilauea/fix-nav-region-gizmoRémi Verschelde
2022-08-07Fix typo when setting NavigationRegion travel_costJosh Jones
2022-08-06Fix NavigationRegion3D gizmo's odd visual behaviorJosh Jones
2022-07-29Add more detailed Navigation Debug Visualizationsmix8
- Adds more customization options to ProjectSettings. - Displays navregion edge connections and navigation polygon edges in editor and at runtime. - Majority of debug code moved from SceneTree to NavigationServer. - Removes the irritating debug MeshInstance child node from NavigationRegion3D and replaces it with direct RenderingServer API.
2022-06-19Add navigation layer bitmask helper functionssmix8
Adds helper functions to work with the navigation layer bitmask.
2022-06-15Streamline Navigation layer function names.smix8
Streamline Navigation layer function names.
2022-06-06Add NavigationRegion costs for pathfindingsmix8
Add NavigationRegion costs for pathfinding.
2022-06-02Expose get_mesh() for NavigationPolygon Resourcessmix8
Expose get_mesh() for NavigationPolygon Resources.
2022-05-18Update NavigationRegion2D when polygons of NavigationPolygon changesmix8
Updates NavigationRegion2D when the NavigationPolygon emits its 'changed' signal due to e.g. polygons altered by script.
2022-05-16Replace most uses of Map by HashMapreduz
* 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-04-30Add get_region_rid() NavigationRegion2D and NavigationRegion3Dsmix8
Add get_region_rid() to NavigationRegion2D and NavigationRegion3D
2022-03-28String: Remove TTR and DTR defines in non-tools buildRémi Verschelde
This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-02-12Improve compilation speed (forward declarations/includes cleanup)Hendrik Brucker
2022-02-08Add array element type to `_get_polygons` and `_get_outlines`Raul Santos
2022-02-02Vectors: Use clear() and has().Anilforextra
Use clear() instead of resize(0). Use has() instead of "find(p_val) != -1".
2022-01-05NavigationServer: Restore constness for thread safe `get_singleton`Rémi Verschelde
This was removed by mistake in #47024, NavigationServer uses internal mutability for thread safety, and removing `const` breaks the contract.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-17Fix `ColorPicker` inverted input on color circleYuri Roubinsky
2021-11-03Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio
This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-09-07Use builtin Vector2 functions for calculation of angles.Anilforextra
.
2021-08-13Fix some unnecessary includesAaron Franke
2021-08-09Some work on double supportAaron Franke
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-04-11Use Array for node configuration warningsNathan Franke
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
2021-03-15Allow Navigation to be more flexibleGilles Roudière
2021-03-10Implement Navigation layersGilles Roudière
2021-03-10Remove Navigation2D/3D nodes, and move the navigation map to the world resourceGilles Roudière
2021-02-10Removed _change_notifyreduz
-For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
2021-01-12Update PolyPartition / Triangulator libraryAaron Franke
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-10-01Merge pull request #38743 from arrowinaknee/node-config-warningsRémi Verschelde
Update all get_configuration_warning() to retrieve warnings from the parent
2020-05-27Split `Geometry` singleton into `Geometry2D` and `Geometry3D`Andrii Doroshenko (Xrayez)
Extra `_2d` suffixes are removed from 2D methods accoringly.
2020-05-16Update all get_configuration_warning to retrieve warnings from the parentArrowInAKnee
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.