Commit Graph

127 Commits

Author SHA1 Message Date
Micky
694190a354 Rename TileMap/GridMap.world_to_map and opposite to local_to_map
For both TileMap and GridMap:
- `world_to_map` -> `local_to_map`
- `map_to_world` -> `map_to_local`

Also changes any mention of "world" in this context to "local" to avoid future confusion.

Finally, updates the docs of both methods for consistency.
In particular, adding a note on how to convert the returned values from local to global coordinates and vice versa.
2022-09-05 18:08:39 +02:00
Rémi Verschelde
9a368eca43
Merge pull request #64173 from smix8/navigation_debug_gridmap_edgeconnections_4.x 2022-09-01 17:57:58 +02:00
kobewi
1abdffe7a0 Replace Array return types with TypedArray 2 2022-08-23 23:21:32 +02:00
rafallus
da7a5653f4 Expose Basis set_orthogonal_index method as a GridMap function 2022-08-20 21:42:20 -05:00
smix8
4f0730d4bc Add Navigation Debug for GridMap edge connections
Adds navigation visual debug for GridMap edge connections that use baked navigationmesh with bake_navigation=true.
2022-08-13 21:27:56 +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
245da150e7 Streamline Navigation layer function names.
Streamline Navigation layer function names.
2022-06-15 00:18:48 +02:00
FireForge
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
smix8
cb8d95c271 Fix GridMap Navigation transforms and debug
Fix GridMap navigation transforms and debug.
2022-06-08 14:19:16 +02:00
smix8
cc0b525300 Fix GridMap applying wrong NavigationRegion transform
Fix GridMap applying wrong NavigationRegion transform.
2022-06-08 03:30:19 +02:00
smix8
ae4b2597a1 Fix GridMap not adding custom mesh offsets to NavigationMesh generation
Fix GridMap not adding custom mesh offsets to NavigationMesh generation
2022-05-24 19:50:57 +02:00
Aaron Record
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +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
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
kobewi
cd6bd04cba Remove unimplemented set_clip() method 2022-03-02 00:44:30 +01:00
Rémi Verschelde
009254d87c
Merge pull request #58187 from jakobbouchard/notification-switch-chunk-c
Convert _notification methods to switch - Chunk C
2022-02-16 20:58:55 +01:00
Jakob Bouchard
6553f5c242
Convert _notification methods to switch - Chunk C 2022-02-16 13:03:05 -05:00
Haoyu Qiu
19a2ec3d04 Add GridMap.get_used_cells_by_item 2022-02-16 13:04:31 +08:00
Haoyu Qiu
5d4a141c97 Fix GridMap memory leak 2022-02-08 00:27:01 +08:00
rafallus
cc46abd73d Consider gridmap collisions in navigation bake 2022-01-16 18:56:10 -06:00
JFonS
1f0dc02649
Merge pull request #56006 from KoBeWi/6yearslater
Add physics material to GridMap
2022-01-06 13:28:42 +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
kobewi
59a9b2192e Add physics material to GridMap 2021-12-17 01:50:58 +01:00
Lightning_A
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
Anilforextra
fc9767abb1 Use functions defined in the their classes. 2021-09-29 09:36:34 +05:45
Vincent
70108fd850 implement individual mesh transform for meshlibrary items 2021-09-09 16:40:16 +02:00
PouleyKetchoupp
989acbbe81 Uniformize layer names, script methods and documentation
- Back to 1-based layer names to make it clearer in editor UI
- Layer bit accessors are renamed to layer value and 1-based too
- Uniform errors and documentation in render and physics
- Fix a few remaining collision_layer used in place of collision_mask
2021-08-12 08:06:42 -07:00
Rémi Verschelde
ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke
4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04: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
Pitanov V.V
4da4514b71
Fix GridMap erase Octans 2021-07-02 03:26:26 +10:00
Lightning_A
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Aaron Franke
de3f6699a5
Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
Rafał Mikrut
efcb097674 Prevent setting too big or too small Collision Mask and Layer 2021-04-30 17:19:04 +02:00
jfons
809d88b925 Fix visibility toggle for baked GridMaps 2021-03-12 12:57:04 +01:00
Gilles Roudière
ba1344408f Implement Navigation layers 2021-03-10 11:23:06 +01:00
Gilles Roudière
a9dc53d152 Remove Navigation2D/3D nodes, and move the navigation map to the world resource 2021-03-10 11:23:06 +01:00
reduz
1aa2823fa3 Removed _change_notify
-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-02-10 19:31:24 -03:00
reduz
8b19ffd810 Make Servers truly Thread Safe
-Rendering server now uses a split RID allocate/initialize internally, this allows generating RIDs immediately but initialization to happen later on the proper thread (as rendering APIs generally requiere to call on the right thread).
-RenderingServerWrapMT is no more, multithreading is done in RenderingServerDefault.
-Some functions like texture or mesh creation, when renderer supports it, can register and return immediately (so no waiting for server API to flush, and saving staging and command buffer memory).
-3D physics server changed to be made multithread friendly.
-Added PhysicsServer3DWrapMT to use 3D physics server from multiple threads.
-Disablet Bullet (too much effort to make multithread friendly, this needs to be fixed eventually).
2021-02-10 13:21:46 -03:00
Rafał Mikrut
f7209b459b Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
Rémi Verschelde
b5334d14f7
Update copyright statements to 2021
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 🎆
2021-01-01 20:19:21 +01:00
reduz
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Tomer Keren
fe52c6b0b7 Setting visibility on GridMap now works. Closes #41374.
Continuing the work from f43a0ef327,
It seems the maps visibility was not actually set and a flase value was propogated to the meshes
Trying to set the maps visibility directly (Using `set_visibility` causes the map to no longer to recieve visibility notifications, instead this approach was chosen
2020-10-16 14:04:24 +03:00
Aaron Franke
8a333cdf9f
Update GridMap to use Vector3i instead of three ints 2020-07-02 16:50:55 -04:00
Rémi Verschelde
0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde
07bc4e2f96 Style: Enforce separation line between function definitions
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.
2020-05-14 16:54:55 +02:00
Rémi Verschelde
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
qarmin
559bc3ca87 Change non-existent World to World3D 2020-04-18 11:00:51 +02:00
lupoDharkael
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Juan Linietsky
a6f3bc7c69 Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D

Also renamed corresponding files.
2020-03-27 15:21:27 -03:00