Commit Graph

1982 Commits

Author SHA1 Message Date
Rémi Verschelde 156b5ca38f
Merge pull request #69644 from radenling/fix-viewport-update-in-editor
Fix for 2D viewport not updating in the editor when the camera moves
2022-12-09 18:06:23 +01:00
Vladislav Slobodenyuk 0b5c4216c8
Fix TileMap drawing itself twice on creation
Adds a check before calling `item_rect_changed()` in
`_recompute_rect_cache()` of `scene/2d/tile_map.cpp`. Makes sure
TileMap is only redrawn if the rect is actually changed.
Fixes #69754
2022-12-09 22:20:31 +09:00
Rémi Verschelde 75e558e271
Merge pull request #69774 from Calinou/backbuffercopy-only-show-rect-when-relevant
Fix BackBufferCopy `rect` property appearing when not relevant in inspector
2022-12-09 06:52:03 +01:00
Hugo Locurcio 080b6ac1ae
Fix BackBufferCopy `rect` property appearing when not relevant in inspector
The `rect` property is only effective if `copy_mode` is Rect.
2022-12-08 19:52:48 +01:00
Rémi Verschelde a914ee8413
TouchScreenButton: Fix screen capability check
Fixes #69572.
2022-12-08 14:28:04 +01:00
Rémi Verschelde de2d0f156e
Merge pull request #69713 from groud/rename_get_surrounding_tiles
Rename get_surrounding_tiles to get_surrounding_cells
2022-12-07 13:24:57 +01:00
Gilles Roudière 3ea54bb3a1 Rename get_surrounding_tiles to get_surrounding_cells 2022-12-07 11:09:10 +01:00
Markus Sauermann e18107a57c Fix Determining Window for Touchscreen
DisplayServer::screen_is_touchscreen will likely never utilize its
parameter p_screen.
This PR replaces this function by DisplayServer::is_touchscreen_available()
with the same functionality.
This solves the problem, that a SubViewport was used for determining
the screen, which resulted in error messages.
2022-12-07 09:54:29 +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
Yaohua Xiong 322dbd0955 Fix Path2D fish bone direction 2022-12-06 20:45:17 +08:00
Richard Adenling a3d8a78f1b Fix for 2D viewport not updating in the editor when the camera moves
This fixes a problem with 2D viewports not taking the camera position
into consideration when previewed in the editor.

Fixes #40441
2022-12-06 11:34:32 +01:00
Rémi Verschelde deb760fb1b
Path2D: Fix build issue after conflicts between #68860 and #69115 2022-12-06 11:22:11 +01:00
Rémi Verschelde 14861c45b5
Merge pull request #68860 from xiongyaohua/path3d_fishbones
Draw fish bones for Path3D and Path2D in the Editor
2022-12-06 10:46:54 +01:00
Yaohua Xiong 91e9ad92f5 Refactor baking code for Curve2D
The main change is to caculate tangent directly from bezier curve, without going
through discretized polyline, avoiding pitfalls of discretization. A similar refacor
had been applied to Curve3D.

The test cases for Curve2D is updated, comparing floating point with is_equal_approxmiate()
instead of `==`, in order to avoid float precision problem.
2022-12-05 21:22:05 +08:00
Yaohua Xiong 9bdc0cb16f draw fish bones for Path2D and Path3D
These fish bones are add to indicate the direction and local transforms alone the path.
2022-12-05 15:39:14 +08:00
kobewi 7e2a8afb57 Rework how current Camera2D is determined 2022-12-02 00:05:02 +01:00
Hendrik Brucker e84f45fc93 Move z_index, z_as_relative and y_sort_enabled from Node2D to CanvasItem 2022-11-29 17:11:22 +01:00
Rémi Verschelde 519b9b5c21
Merge pull request #68486 from smix8/navpoly_outline_convex_error_4.x
Add detail to NavigationPolygon outline error msg
2022-11-28 13:37:00 +01:00
Rémi Verschelde 438b2e2d02
Merge pull request #59801 from Sauermann/fix-node2d-viewport-root-order
Fix Viewport root order after Node2D raise
2022-11-28 08:21:10 +01:00
Rémi Verschelde 34df77285c
Merge pull request #69146 from clayjohn/Polygon2D-error
Ensure that mesh instance is properly freed when freeing Polygon2D
2022-11-25 10:11:47 +01:00
Haoyu Qiu 06a0b26c9e Fix inspector not showing name for LabelSettings.font 2022-11-25 12:48:37 +08:00
clayjohn 5c95288a6e Ensure that mesh instance is properly freed when freeing Polygon2D 2022-11-24 17:34:25 -08:00
Rémi Verschelde 1fa80bf9d6
Merge pull request #67330 from KoBeWi/immortal_scenes
Don't free instanced scenes when recreating tiles
2022-11-24 18:54:08 +01:00
Micky b6db09968d Fix AudioStreamPlayer2D and 3D's `playing` not updating right away 2022-11-22 15:46:28 +01:00
Rémi Verschelde 3a874804ab
Merge pull request #68886 from timothyqiu/motion-distance
Revert move vector parameter name to "motion"
2022-11-20 11:43:32 +01:00
Hugo Locurcio 2a0afb1dcc
Improve collision exception error messages for easier understanding 2022-11-19 17:35:44 +01:00
Haoyu Qiu 42ab2b9ef5 Revert move vector parameter name to motion 2022-11-19 20:19:50 +08:00
clayjohn 0e5a98cdd8 Fix drawing of 2D skeletons in the RD renderer.
Also clean up skeleton code in preparation for adding them to GLES3

Properly update Mesh2D AABBs when skeleton is updated
2022-11-18 23:36:40 -08:00
Rémi Verschelde d0025a1f02
Merge pull request #64077 from Calinou/tweak-audiostreamplayer2d3d-default-panning
Decrease default AudioStreamPlayer2D/3D panning strength
2022-11-15 22:29:23 +01:00
kobewi 3e730c4277 Fix false warning when renaming Joint2D's node 2022-11-15 13:31:44 +01:00
clayjohn 9ce57050a5 Add GPUParticles to the OpenGL3 renderer.
This includes collision (2D SDF, Box, Sphere, Heightmap),
attraction (Box, Sphere), and all sorting modes.

This does not include 3D SDF collisions, trails, or
manual emission.
2022-11-14 23:28:25 -08:00
Markus Sauermann 3b14f0334c Remove redundant Variant-types initializations 2022-11-14 19:35:19 +01:00
smix8 f30ebacbe8 Add detail to NavigationPolygon outline error msg
Adds additional information to the error msg when the convex partition fails due to invalid outline arrays.
2022-11-10 21:12:51 +01:00
Hugo Locurcio ab7a807f2b
Rename GPUParticles2D/3D's `trail_length_secs` to `trail_lifetime`
The property already has a "seconds" suffix in the inspector.
The "lifetime" term makes it more obvious that the property is
specified as time, not a distance in units.

The property hint now allows manually entering values greater than
10 seconds.

The internal rendering value's default now matches the particles
nodes' default.
2022-11-07 13:37:40 +01:00
kobewi f8f25adc0b Don't free instanced scenes when recreating tiles 2022-11-07 00:32:41 +01:00
Rémi Verschelde 05ce0e3de1
Merge pull request #68222 from groud/fix_corner_terrain_painting
Fix terrain painting in corner-only matching mode
2022-11-04 10:05:58 +01:00
Gilles Roudière ffacb31734 Fix terrain painting in corner-only matching mode 2022-11-03 19:08:43 +01:00
Markus Sauermann 022d24a9ae Fix Viewport root order after Node2D raise 2022-11-02 21:45:00 +01:00
Rémi Verschelde 23e793fd18
Merge pull request #68137 from kleonc/shape-cast-get-collider-rid
Add `ShapeCast2D/3D::get_collider_rid` method
2022-11-02 18:53:23 +01:00
kleonc bbd225a804 Add `ShapeCast2D/3D::get_collider_rid` method 2022-11-01 21:17:18 +01:00
Yaohua Xiong 399c2a8dea Move rotation sampling from Path2D to Curve2D
The rotation sampling code is moved from Path2D to a new method
`sample_baked_with_rotation` on Curve2D.
2022-11-01 13:18:52 +08:00
Rémi Verschelde 5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +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
Rémi Verschelde 420eb1aa34
Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
Rémi Verschelde d0fbeec66a
Merge pull request #67580 from KoBeWi/little_things
Minor code improvements
2022-10-31 10:34:57 +01:00
Max Hilbrunner f013315980
Merge pull request #67754 from kleonc/tilemap-fix-collision-shapes-debug-draw
Fix `TileMap` collision shapes debug draw
2022-10-30 00:15:42 +02: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
kobewi 64fc443e24 Warn if isometric TileMap is not Y-sorted 2022-10-26 14:27:58 +02:00
Marc Gilleron 7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
Clay John 040f49ed6e
Merge pull request #67390 from groud/more_conservative_terrain_painting
Make terrain painting not change neighbors centers bits
2022-10-23 17:11:06 -07:00
Clay John 9be3fd640b
Merge pull request #67513 from Calinou/editor-light2d-fix-shadow-filter-smooth-visibility
Fix Light2D Shadow Filter Smooth property being visible with filter None
2022-10-23 17:03:07 -07:00
kleonc fcb663df51 Fix `TileMap` collision shapes debug draw 2022-10-22 16:14:54 +02:00
Gilles Roudière fe65d7aa7b Make terrain painting not change neighbors centers bits 2022-10-20 14:47:45 +02:00
kobewi 2f9cbbe0fb Fix texture filter and repeat in TileMap 2022-10-19 23:23:40 +02:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
kobewi 4aaed4fee1 Minor code improvements 2022-10-18 16:44:57 +02:00
Hugo Locurcio 6dcb295a07
Fix Light2D Shadow Filter Smooth property being visible with filter None 2022-10-17 01:35:10 +02:00
Micky 43b9cc96da Rename Camera2D's `smoothing` to `position_smoothing`
For Camera2D:
`smoothing_enabled` ->  `position_smoothing_enabled`
`set_enable_follow_smoothing` -> `set_position_smoothing_enabled`
`is_follow_smoothing_enabled` -> `is_position_smoothing_enabled`
`smoothing_speed` -> `position_smoothing_speed`
`set_follow_smoothing` -> `set_position_smoothing_speed`
`get_follow_smoothing` -> `get_position_smoothing_speed`
2022-10-11 16:51:26 +02:00
Rémi Verschelde 55815998d4 Merge pull request #67194 from RedMser/dirlight2d-height-suffix
Remove incorrect `px` suffixes
2022-10-11 09:26:49 +02:00
RedMser a8a4e290fb Remove incorrect px suffixes 2022-10-10 18:18:15 +02:00
Rémi Verschelde 8017827144 SCons: Re-enable treating `#warning` as error with `werror`
Replace all TODO uses of `#warning` by proper TODO comments, and will open
matching bug reports to keep track of them.

We don't have a great track record fixing TODOs, but I'd wager we're even
worse for fixing these "TODO #warning" so we should prohibit this usage.
2022-10-10 16:12:26 +02:00
bruvzg 0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Gilles Roudière 64e0c138d9 Fix TileMap occluders having a wrong transform 2022-10-06 14:06:33 +02:00
Rémi Verschelde 48e6f84295 Merge pull request #66951 from rburing/restore_recovery_as_collision
Revert "Turn on recovery as collisions only for floor snapping"
2022-10-06 08:56:44 +02:00
Ricardo Buring 311cdd2571 Revert "Turn on recovery as collisions only for floor snapping as this leads to unwanted behaviour for other surface than the floor."
This reverts commit 10395f5df2.
2022-10-05 22:51:29 +02:00
Rémi Verschelde 5b6ccf2fd2 Merge pull request #66720 from qarmin/unintialized_memory
Remove usage of unitialized variables
2022-10-05 11:42:47 +02:00
Rémi Verschelde 9cd62741bb Merge pull request #66839 from aaronfranke/editor-prop-hide-slider
Fix `hide_slider` vs `no_slider` inconsistency in editor property code
2022-10-05 08:47:06 +02:00
Luis Lopez c262589e26 Add rotation smoothing to Camera2D
Camera2D has follow smoothing to interpolate towards a target position, but no rotation smoothing to align with the target rotation.

This adds rotation smoothing directly into the Camera2D API by having two new properties:
  - `rotation_smoothing_enabled`
  - `rotation_smoothing_speed`
2022-10-04 17:14:03 +02:00
Rémi Verschelde 6a251fd0df Merge pull request #39072 from dalexeev/cs2d_debug_color
Add debug_color property to CollisionShape2D
2022-10-04 12:05:19 +02:00
Aaron Franke 094e8db97c
Fix hide_slider vs no_slider inconsistency in editor property code 2022-10-03 13:40:31 -05:00
Rafał Mikrut 2233624152 Remove usage of unitialized variables 2022-10-01 21:09:22 +02:00
Rémi Verschelde f5f4d9bf00 Merge pull request #66143 from DarkKilauea/nav-queries-agent
Update NavigationAgent to use query_path
2022-09-29 15:33:25 +02: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
MisterMX 407bbdda20 refactor(TileMap): Return Rect2i in get_used_rect
Signed-off-by: MisterMX <mbxd12@web.de>
2022-09-28 17:04:15 +02:00
Rémi Verschelde 8e14f9ba21 Merge pull request #64679 from DarkKilauea/nav-region-props
Improve consistency of NavigationRegion setters
2022-09-22 08:27:35 +02:00
Rémi Verschelde d96b7d767a Merge pull request #66110 from Zylann/reference_get_count
get_reference_count()`
2022-09-22 08:26:29 +02:00
Josh Jones a25bb9811a Improve consistancy of NavigationRegion setters 2022-09-21 22:42:52 -07:00
Marc Gilleron 474cee7daf Rename and expose `RefCounted::get_reference_count()` 2022-09-21 21:18:54 +01:00
Danil Alexeev df2209c700
Add `CollisionShape2D.debug_color` property 2022-09-21 16:07:47 +03:00
Rémi Verschelde 307f560b39 Merge pull request #66183 from KoBeWi/ARE_YOU_READY
Set scene tiles' position before adding them
2022-09-21 11:07:43 +02:00
Rémi Verschelde 7bf61e3912 Merge pull request #64359 from Mickeon/rename-camera-rotating
Reverse Camera2D.`rotating` to `ignore_rotation`
2022-09-21 11:06:41 +02:00
Rémi Verschelde 28e1dc6162 Merge pull request #65828 from rburing/body_state_sync_callable
make `body_set_state_sync_callback` take a `Callable`
2022-09-21 11:05:41 +02:00
Micky ee16de583f Reverse Camera2D.`rotating` to `ignore_rotation`
`rotating` is misleading, as Camera2D is affected by `rotation` and `global_rotation` like any other Node2D

Updates description in the docs, as well.
2022-09-21 01:52:12 +02:00
kobewi a275b70b6e Set scene tiles' position before adding them 2022-09-21 00:37:18 +02:00
Rémi Verschelde 209a837f79 Merge pull request #66112 from Zylann/get_configuration_warnings_psa
Change return type of `get_configuration_warnings` to `PackedStringArray`
2022-09-19 22:03:44 +02:00
Marc Gilleron aed3822a93 Change return type of `get_configuration_warnings` to `PackedStringArray` 2022-09-19 16:43:15 +01:00
fabriceci 10395f5df2 Turn on recovery as collisions only for floor snapping as this leads to unwanted behaviour for other surface than the floor. 2022-09-18 22:23:09 +02:00
Micky 213cc7859e Fix outdated warning in AnimatedSprite2D 2022-09-18 02:52:20 +02:00
Rémi Verschelde 0bb57bd9f2 Merge pull request #65931 from fabriceci/add-recovery-as-collision-in-low-level-methods
Add recovery_as_collision in move_and_collide/test_move
2022-09-18 00:42:29 +02:00
Rémi Verschelde 06c8f1c659 Merge pull request #58567 from madmiraal/fix-26470
Remove ParallaxLayer's invalid dependence on screen_offset
2022-09-18 00:42:22 +02:00
fabriceci a72d5be2c6 Add recovery_as_collision in move_and_collide/test_move 2022-09-17 11:40:03 +02:00
Rémi Verschelde 16d44395b5 Merge pull request #65148 from Mickeon/animated-sprite-negative-speed-scale
Allow negative `speed_scale` in AnimatedSprite2D & 3D
2022-09-16 09:18:42 +02:00
Ricardo Buring ff4e72a0bc PhysicsServer2D and PhysicsServer3D: make body_set_state_sync_callback take a Callable
Prefer Callable to a C-style callback. This is helpful for GDExtension.
2022-09-15 15:09:23 +02:00
Micky 8142bc4ddd Allow negative `speed_scale` in AnimatedSprite2D & 3D
If the `speed_scale` is set to a negative value, the animation plays in reverse.
The second parameter of `play()` still reverses as before. if `speed_scale` and the second parameter of `play()` is true, the animation plays forward.

Also updates the documentation to better describe the pausing and playing behaviour.
2022-09-13 12:41:07 +02:00
Rémi Verschelde 3a82a1315b Merge pull request #65591 from MewPurPur/area-overlapping-function
Implement `Area[2D/3D].has_overlapping_[bodies/areas]`
2022-09-13 10:58:55 +02:00
kobewi 7afaca2091 Don't print error in get_cell_tile_data() 2022-09-13 01:39:35 +02:00
kobewi d5c703b83e Don't store frame of playing AnimatedSprite 2022-09-12 22:59:35 +02:00
Rémi Verschelde 97830e7187
Merge pull request #64155 from Mickeon/sprite-3d-backwards-speed-scale 2022-09-12 12:15:58 +02:00
VolTer ed4fe1e2bd Implement Area.has_overlapping_* 2022-09-10 12:17:37 +02:00
Micky b648ee43ab Harmonise AnimatedSprite3D and its 2D counterpart
Add the following properties to AnimatedSprite3D:
- `backwards` parameter in `play()`;
- `speed_scale`.

Both classes' internals are more similar, down to the line spacings. They've also been updated to be clearer and less inconsistent (e.g. `!frames.is_valid()` -> `frames.is_null()`, use SceneStringNames instead of CoreStringNames, rename the internal _queue_update to _queue_redraw)
2022-09-09 21:06:24 +02:00
Rémi Verschelde ce6f284e5f
Merge pull request #64394 from smix8/navigation_obstacles_reparent_4.x
Fix NavigationObstacle 2D/3D (re)parent issues
2022-09-09 19:20:14 +02:00
smix8 d7f75fab60 Remove / Replace old Navigation Debug Visualization
- removes / replaces leftovers from old navigation debug code
- cleanes SceneTree and ProjectSettings from old navigation debug
2022-09-07 18:30:35 +02:00
Trashtalk 1d233ce58c handled edge case where navigation_link_2d is outside of the tree when calling _edit_get_rect() 2022-09-07 00:05:56 +02:00
Rémi Verschelde 5fb84e5702 Merge pull request #64661 from Mickeon/rename-tilemap-world
Rename TileMap/GridMap.`world_to_map` and opposite to `local_to_map`
2022-09-06 17:01:16 +02:00
Rémi Verschelde adaec8396e Merge pull request #64880 from Mickeon/rename-camera-position
Rename Camera2D's `*_screen_center` and `*_position` to `get_screen_center_position` and `get_target_position`
2022-09-06 17:00:52 +02:00
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
Micky a7ce7b1d3f Fix AudioStreamPlayer not resuming after returning to SceneTree 2022-09-05 16:52:46 +02:00
Hugo Locurcio f7292dbeb3
Rename `or_lesser` range property hint to `or_less`
"less" should be used for quantity, rather than "lesser".

Existing scripts that use `or_lesser` in `_get_property_list()`
will need to be updated to account for this change.
2022-09-02 19:08:20 +02:00
Void fdfe11d4b3 fixed and optimized Area2/3D get_overlapping_bodies/areas
fixed a type and made it so area3d get_overlapping_x is similar to its counterpart func in area2d so that it uses TypedArray instead of Array and ERR_FAIL_COND_V_MSG instead of no message, also minimized array resize calls
2022-09-02 12:00:04 +01:00
Jonathan Nicholl 15d057c521 Add `is_zero_approx` methods to `Vector2`, `3`, and `4` 2022-09-02 00:29:50 -04:00
Rémi Verschelde c6fd311da0 Fix build after merge of #63479 2022-09-02 00:19:33 +02:00
Rémi Verschelde 5263fd5343 Merge pull request #64198 from Geometror/add-bitmap-tests 2022-09-01 23:46:38 +02:00
Rémi Verschelde 2e0cffdb6f Merge pull request #63479 from DarkKilauea/nav-link 2022-09-01 23:44:22 +02:00
Hendrik Brucker ea0472fecf Refactor BitMap and add tests
Co-authored-by: Resul Çelik <resul_celik@hotmail.com>
2022-09-01 18:39:17 +02:00
Hugo Locurcio ae18928748
Rename Curve/Curve2D/Curve3D/Gradient `interpolate()` to `sample()`
"sampling" is a more accurate term than "interpolating" for what's
happening when using that function.
2022-08-30 22:08:38 +02:00
Rémi Verschelde ac053bb72d Fix build issue after #64377 and #64701 2022-08-30 15:20:50 +02:00
Rémi Verschelde ae349d8227
Merge pull request #64377 from Mickeon/rename-canvas-redraw
Rename `CanvasItem.update()` to `queue_redraw()`
2022-08-30 14:47:41 +02:00
Hendrik Brucker 73bbcaecb9 Fix GPUParticles2D ignoring AtlasTexture region 2022-08-30 11:23:35 +02:00
Micky e31bb5ffeb Rename `CanvasItem.update()` to `queue_redraw()`
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-29 14:59:47 +02:00
rafallus 7f2740f7bd Expose input interaction virtual functions in CollisionObject 2022-08-29 14:04:52 +02:00
Josh Jones 3dd59013f4 Added node for Navigation links 2022-08-26 22:05:15 -07:00
Rémi Verschelde f9f2446972
Merge pull request #64367 from Mickeon/rename-var-to-str
Rename `str2var` to `str_to_var` and similar
2022-08-26 23:04:06 +02:00
Rémi Verschelde 1c97dde78f
Merge pull request #64894 from fabriceci/remove-dynamic-bodies-name 2022-08-26 16:16:32 +02:00
Micky 59e11934d8 Rename `str2var` to `str_to_var` and similar
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too.

- `var2str` -> `var_to_str`
- `str2var` -> `str_to_var`
- `bytes2var` -> `bytes_to_var`
- `bytes2var_with_objects` -> `bytes_to_var_with_objects`
- `var2bytes` -> `var_to_bytes`
- `var2bytes_with_objects` -> `var_to_bytes_with_objects`
- `linear2db` -> `linear_to_db`
- `db2linear` -> `db_to_linear`
- `deg2rad` -> `deg_to_rad`
- `rad2deg` -> `rad_to_deg`

- `dict2inst` -> `dict_to_inst`
- `inst2dict` -> `inst_to_dict`
2022-08-26 14:58:22 +02:00
kobewi c8abd40ea8 Easier setting properties of last TileMap layer 2022-08-26 12:54:13 +02:00
fabriceci f8cc88fab3 Restore RigidBody2/3D, SoftBody names in physics 2022-08-26 12:26:25 +02:00
Micky ec963788cc Rename Camera2D's `screen_center` and `*_position`
`get_camera_screen_center` -> `get_screen_center_position`
`get_camera_position` -> `get_target_position`
2022-08-26 12:11:52 +02:00
Rémi Verschelde af692912d4
Merge pull request #54646 from jmb462/fix-animatedsprite-animation-list
Fix AnimatedSprite2D & 3D animation list in inspector
2022-08-26 08:22:51 +02:00
Micky 723bf85145 Rename ParticlesMaterial to ParticleProcessMaterial
Also affects their file names, related classes and documentation.
2022-08-26 02:53:08 +02:00
jmb462 ae9560af82 Fix AnimatedSprite2D & 3D animation list in inspector 2022-08-26 00:05:58 +02:00
Rémi Verschelde 88145e81e2
Merge pull request #64804 from Mickeon/rename-path-progress 2022-08-25 18:35:48 +02:00
Rémi Verschelde af88438c71
Merge pull request #64354 from Mickeon/rename-navigation-distance 2022-08-25 18:35:23 +02:00
Rémi Verschelde ceaff612c8
Merge pull request #64824 from Mickeon/rename-polygon-invert 2022-08-25 18:33:58 +02:00
fabriceci 31549dca29 Shorten variable names for moving platforms in CharacterBody 2022-08-25 09:15:18 +02:00
fabriceci 59bf35f3df Improves the API for monitoring contacts in RigidDynamicBody 2022-08-24 21:23:11 +02:00
Micky 06a8113576 Rename Polygon2D.`invert_enable` to end with "d"
Polygon2D.`invert_enable` -> `invert_enabled`

Also affects the setters and getters, which are now named in full instead of cutting "enabled" off.
Updates old leftover documentation slightly, as well.
2022-08-24 13:09:44 +02:00
Rémi Verschelde b556d8c9a0
Merge pull request #64370 from Mickeon/rename-marker-node
Rename Position* nodes to Marker*
2022-08-24 08:52:13 +02:00
Rémi Verschelde 91e5f48ea7
Merge pull request #64009 from KoBeWi/arrayy_lmao
Replace Array return types with TypedArray (part 2)
2022-08-24 08:18:56 +02:00
Micky bb936b2e27 Rename PathFollow's `offset`s to `progress` & `progress_ratio`
Applies for both PathFollow2D and PathFollow3D
2022-08-24 01:56:03 +02:00
kobewi 1abdffe7a0 Replace Array return types with TypedArray 2 2022-08-23 23:21:32 +02:00
Micky 8bb305356e Rename Position* nodes to Marker*
- Position2D -> Marker2D
- Position3D -> Marker3D

Also changes their respective file names.
2022-08-23 19:49:50 +02:00
Rémi Verschelde 7764151bc1 Rename properties unnecessarily using slash (`/`) in their names
This is a legacy of Godot 2 days before the inspector had support for groups.
"Properties" with a slash in their name can't be accessed from script unless
using `set()`/`get()` so they were not actual properties as far as script
languages are concerned.

Part of #17558.
2022-08-23 11:57:43 +02:00
kobewi 8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
Rémi Verschelde 1f61d47766
Merge pull request #64339 from YuriSizov/core-multilevel-validate-property 2022-08-22 21:39:48 +02:00
Yuri Sizov 1a24c9e14b Make `_validate_property` a multilevel method 2022-08-22 18:35:11 +03:00
Rémi Verschelde 5193332d10
Merge pull request #64343 from TokageItLab/priority-ph 2022-08-22 17:31:23 +02:00
Rémi Verschelde fdc36ad082
Merge pull request #64553 from RedMser/fix-property-validation-refactor 2022-08-22 16:54:47 +02:00
kobewi 7f96ebf1be Use false as default for use_proxies argument 2022-08-22 13:31:01 +02:00
Yuri Sizov d5052d9084
Merge pull request #54549 from KoBeWi/fastcells
Add a method to get TileData from a cell
2022-08-22 13:39:12 +03:00
Paul Joannon 6bc0be16a5
Expose the collider RID in Raycast nodes
Create and expose the method `get_collider_rid` in `RayCast2D` and `Raycast3D`.
This method returns the `RID` of the first object that the ray intersects, or an empty `RID` if no object is intersecting the fay (i.e. `is_colliding` returns `false`).
2022-08-22 09:18:08 +02:00
RedMser c25b8f2876 Remove unintentional PROPERTY_USAGE_INTERNAL
The flag only matters for property definition,
but was also used in _validate_property a lot.
2022-08-18 16:25:00 +02:00
Silc Renew b31115cdc1 Add collision weight to PhysicsBody for penetrations must be avoided
Co-authored-by: Juan Linietsky <reduzio@gmail.com>
2022-08-18 08:10:31 +09:00
Tomasz Chabora 2bdd7e9ea0 Add methods for node reparenting 2022-08-16 19:44:41 +02:00
kobewi 7305390fdc Add a method to get TileData from a cell 2022-08-16 15:04:39 +02:00
Yuri Sizov fff0e7b8e2 Clarify the Line2D, Curve2D/3D documentation and fix parameter names 2022-08-15 21:38:14 +03:00
smix8 5162d9ac8b Fix NavigationObstacle 2D/3D (re)parent issues
Fixes (re)parent issues with NavigationObstacle 2D and 3D (same as NavigationAgents).
Also adds the option from NavigationAgents to override the default navigation map.
2022-08-14 16:23:27 +02: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
Silc Renew 7331295523 add get_depth() to KinematicCollision3D as same of 2D 2022-08-10 10:33:58 +09:00
Hugo Locurcio 160d10dc7b
Decrease default AudioStreamPlayer2D/3D panning strength
The default panning strength is now more in line with how other
engines play positional sound.
2022-08-09 18:46:52 +02:00
Rémi Verschelde d9d5990c51
Merge pull request #64034 from DarkKilauea/fix-nav-region-gizmo 2022-08-08 22:37:00 +02:00
Josh Jones 8c324132d0 Fix typo when setting NavigationRegion travel_cost 2022-08-07 10:40:33 -07:00
Josh Jones 92c40bcf32 Fix NavigationRegion3D gizmo's odd visual behavior 2022-08-06 23:54:57 -07:00
Rémi Verschelde d100c2d59f
Merge pull request #63776 from fire-forge/shapecast2d
Add ShapeCast2D editor handle and improve debug drawing
2022-08-06 00:27:41 +02:00
Hugo Locurcio 84076513b1
Use global coordinates for particles by default
Particles won't move or rotate anymore with the node (or its parents)
by default. This new default behavior is generally more suited
to most use cases. Local coordinates can still be enabled on a per-node basis.

This affects both 2D and 3D particles, and both CPU and GPU-based particles.
2022-08-02 23:25:02 +02:00
FireForge 7cfa9ae539 Improve ShapeCast2D editor and debug drawing
- Rename RayCast2DEditorPlugin to Cast2DEditorPlugin and make it also support editing ShapeCast2D.
- Apply RayCast2D debug drawing improvements from #46675 to ShapeCast2D.
2022-07-31 17:47:36 -05:00
Rémi Verschelde 7199314eb3
Merge pull request #63595 from reduz/remove-signal-connect-binds
Remove Signal connect binds
2022-07-29 18:10:39 +02:00
Juan Linietsky d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
Rémi Verschelde 8b454f8b41
Merge pull request #62601 from smix8/navigation_3d_debug_4.x 2022-07-29 12:29:32 +02:00
smix8 c394ea518e Add more detailed Navigation Debug Visualization
- 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-07-29 09:58:41 +02:00
Marcel Admiraal e61dc6bb04 Ensure changes to Camera2D's limits don't affect smoothed_camera_pos 2022-07-28 15:32:45 +01:00
Marcel Admiraal 3f83c3a0ac When Camera2D enters tree, ensure first update is not lost 2022-07-28 15:29:38 +01:00
Rémi Verschelde 199ea349f5
Merge pull request #57698 from bluenote10/feature/rename_translated_to_translated_local 2022-07-28 10:03:07 +02:00
Rémi Verschelde 0ffc28e3de
Merge pull request #63484 from groud/fix_tilemap_clear_layer 2022-07-26 13:22:54 +02:00
Gilles Roudière 3faa97a58a Fixes TileMap clear_layer not recreating internal CanvasItems 2022-07-26 12:35:54 +02:00
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
Rémi Verschelde a5bc65bbad
Merge pull request #63265 from reduz/stream-bpm-support
Implement BPM support in AudioStream files.
2022-07-23 11:21:14 +02:00
reduz d1ddee2258 Implement BPM support
Based on #62896, only implements the BPM support part.

* Implements BPM support in the AudioStreamOGG/MP3 importers.
* Can select BPM/Bar Size and total beats in a song file, as well as edit looping points.
* Looping is now BPM aware
* Added a special importer UI for configuring this.
* Added a special preview showing the audio waveform as well as the playback position in the resource picker.
* Renamed `AudioStream::instance` to `instantiate` for correctness.
2022-07-23 07:31:17 +02:00
luz paz 38aaaa3cf9 Fix various typos not caught by codespell
Revert upstream `core/input/gamecontrollerdb.txt`. Upstream fix: https://github.com/gabomdq/SDL_GameControllerDB/pull/600
2022-07-21 07:38:23 -04:00
Rémi Verschelde 73f47921ea
Merge pull request #61590 from Haydoggo/path-follow-fix 2022-07-18 09:36:02 +02:00
Marcel Admiraal 4c23fe602b Update camera position when updating camera limit 2022-07-17 08:51:43 +01:00
Fabian Keller 2bf9e6090c rename translate(d) to translate(d)_local in Transform 2D/3D 2022-07-16 11:47:54 +02:00
Hayden Leete fded50fced prevent crash on NaN offset in path_follower 2d and 3d 2022-07-14 14:15:02 +12:00
Xentripetal f514b82fd3 Account for relative z-indexes when y-sorting 2022-07-08 09:18:00 -05:00
Rémi Verschelde 41fdddb1f8
Merge pull request #62677 from akien-mga/particles-fix-warnings-update 2022-07-03 18:42:51 +02:00
Rémi Verschelde 5d9e56ecec Particles: Fix missing configuration warning updates
Fixes #33488.
2022-07-03 16:04:20 +02:00
kleonc 73ecd71b7d Fix no `hint_string` for `frame` property in `AnimatedSprite`s 2022-07-03 15:31:43 +02:00
Rémi Verschelde 8a00d7c847
Merge pull request #62527 from smix8/navigation_agent_property_groups
Group NavigationAgent properties
2022-06-30 01:24:05 +02:00
Rémi Verschelde a7e589df38
Merge pull request #62084 from smix8/path_debug_options_4.x
Add Path2D/3D debug options
2022-06-29 20:36:43 +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
Marcus Elg 6c1ac9f3be Rename export_range's noslider option to no_slider 2022-06-24 10:45:34 +02:00
reduz d69e3791bf Fix editor-only visibility for lights
* Update visibility again for editor-only lights if owner changes.

Fixes #26399, supersedes #52327
2022-06-23 08:19:18 +02:00
Hugo Locurcio b3fe2732e3
Allow using CanvasItemMaterial in the TileSet editor
Previously, only ShaderMaterial overrides could be added.
2022-06-21 17:02:52 +02:00
smix8 e12e239ab4 Add Path2D/3D debug options
Add Path2D/3D debug options.
2022-06-20 17:32:05 +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
Rémi Verschelde 3d49e89b9b
Merge pull request #62181 from smix8/navigation_navagent_pathpoint_dist_4.x 2022-06-20 14:54:16 +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