Commit graph

1448 commits

Author SHA1 Message Date
kobewi 1a347e9cf3 Fix MeshInstance2D rect 2021-10-21 15:18:52 +02:00
Rémi Verschelde da98357e6e
doctool: Fix differences between headless and Vulkan rendering backends
Fixes #53913.
2021-10-20 17:48:50 +02:00
Gilles Roudière 1a95f893c4 Implement TileMap patterns palette 2021-10-19 11:57:37 +02:00
Camille Mohr-Daurat 342c1bf1e2
Merge pull request #53054 from MaxLap/doc_shape_signals
Improve area/body_shape_entered/exited signals parameter names and doc
2021-10-14 14:31:58 -07:00
Maxime Lapointe b66fdb8dd2 Improve area/body_shape_entered/exited signals parameter names and doc
Fix some typoed names from the doc
Add _index to "index" parameters of *_shape_* signals, this is both in doc and in the template. This makes the code, signature and doc easier to understand
Add method to get Node from the _index params of those signals. This was not as easy to find as one would expect. Putting this information where it is needed will help.
2021-10-14 15:41:26 -04:00
Rémi Verschelde 004b44e915
Merge pull request #53767 from groud/improve_tile_set_change_performances 2021-10-13 16:03:31 +02:00
Gilles Roudière 0de2fce3e1 Greatly improve editor performances by deferring tiles related updates
Solve few update problems
2021-10-13 14:49:47 +02:00
Rémi Verschelde 8240a11ba0
Merge pull request #53761 from groud/fix_tilemap_memory_leak 2021-10-13 14:04:11 +02:00
Rémi Verschelde a564dd7c6d
Merge pull request #53747 from manueldun/trailSectionSubdivCrash 2021-10-13 12:43:48 +02:00
Gilles Roudière 48fb43035c Fix TileMap memory leak 2021-10-13 12:12:25 +02:00
Manuel Dun 3905b4e67a fix so the error macro uses the incomming parameter p_subdivision instead of the class member 2021-10-12 20:22:33 -04:00
kobewi bf3eaa767b Use z_index for TileMap layer darkening 2021-10-13 01:34:34 +02:00
Rémi Verschelde d9667d9262
Merge pull request #53636 from KoBeWi/colorayer
Add modulate property to TileMap layers
2021-10-12 22:32:38 +02:00
Aaron Franke 7e51e4cb84
Fix some LGTM errors of "Multiplication result converted to larger type" 2021-10-12 00:17:27 -05:00
Douglas Leão 39a90751dc Allow AudioStreamPlayer(2D) to provide pitch_scale on playback 2021-10-10 18:52:29 -03:00
kobewi ec0d72a828 Add modulate property to TileMap layers 2021-10-10 20:28:57 +02:00
George Marques 70e1a50cd1
Joint2D: Use boolean instead of warning string for validity test
Those strings are stripped at release there's a false positive that the
bodies are valid, causing a crash.
2021-10-07 14:18:44 -03:00
Rémi Verschelde c773c709c0
Merge pull request #53051 from kleonc/animated-sprites-centered-rendering 2021-10-05 11:22:17 +02:00
PouleyKetchoupp 4f8d761be6 Fix physics glitch with TileMap moving platforms
Added a parameter in test_body_motion to exclude attached objects from
collision, used to avoid collision with all TileMap tiles with moving
platform motion instead of just the one tile the character touches.

Same changes made in 3D for consistency, and handling potential similar
cases.
2021-10-04 12:27:42 -07:00
PouleyKetchoupp 3ae5687d48 Script interface improvements for test body motion
-Physics servers test body motion use a class to hold parameters instead
of multiple arguments to make it more readable and flexible since there
are many options
-Improved documentation for test body motion and kinematic collision
-Removed read-only properties for body motion results (not handled in
scripts, so they should be get_ methods only instead)
2021-10-04 10:49:10 -07:00
kleonc b266b59e56 Fix rendering centered odd-size texture in AnimatedSprite2D/AnimatedSprite3D 2021-10-03 14:30:51 +02:00
PouleyKetchoupp 39f6ca96a3 Rename Joint2D and Joint3D files for consistency
Now matches the class names to be consistent between 2D and 3D and with
other node types.
2021-10-01 12:00:32 -07:00
Camille Mohr-Daurat 95432893e2
Merge pull request #53272 from fabriceci/bug-platform-ceiling
Fix #53255 when a body gets stuck when it hits a descending platform in 2D/3D
2021-09-30 18:05:52 -07:00
fabriceci 3fa76dfe58 Fix body stuck on descending platform 2021-09-30 23:55:50 +02:00
Lightning_A c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
PouleyKetchoupp d0ec46be68 Remove shape metadata from 2D physics server
Shape metadata was only used to get tile information when colliding with
tilemaps. It's not needed anymore since there's an API in tilemap using
body ids instead.
2021-09-30 10:45:36 -07:00
fabriceci bd411ae187 Add latest changes added in the 3D version 2021-09-30 16:50:07 +02:00
Rémi Verschelde 5d6a98f04e
Merge pull request #53239 from nekomatata/fix-animatable-body-initial-state 2021-09-30 15:15:00 +02:00
PouleyKetchoupp 6e6f292f15 Fix AnimatableBody moving and colliding during the first frame
_update_kinematic_motion() shouldn't be called in the constructor
It's too early and causes a first call to set the body position to 0.
Then the second call to set the actual position triggers kinematic
motion, colliding with objects on the path to the initial position.

Side effect of sync to physics now enabled by default.
2021-09-29 18:30:57 -07:00
Gilles Roudière f2caab4691 Improve TileMap physics for moving platforms and conveyor belts like movements 2021-09-29 17:56:30 +02:00
Camille Mohr-Daurat 341b532d5e
Merge pull request #52754 from nekomatata/dynamic-body-modes
Clarify RigidDynamicBody modes
2021-09-28 17:11:17 -07:00
fabriceci dd5f01e83e Set stop on slope on by default on CharacterBody. 2021-09-28 22:31:46 +02:00
Camille Mohr-Daurat c38ef94951
Merge pull request #53174 from fabriceci/apply-delta-move-and-collide
Physic API change: apply the delta in move and collide like move and slide
2021-09-28 11:32:09 -07:00
fabriceci 32bf7c419c Sync to physics true by default for AnimatableBody 2021-09-28 16:11:17 +02:00
fabriceci 60fee25c44 Apply delta in move and collide 2021-09-28 14:53:24 +02:00
Rémi Verschelde 60988a06c2
Merge pull request #52953 from nekomatata/fix-collision-recovery-depth 2021-09-28 12:11:38 +02:00
PouleyKetchoupp bf523a2b2a Improved logic for CharacterBody collision recovery depth
Allows 2D character controller to work without applying gravity when
touching the ground (also more safely in 3D), and collision detection
is more flexible with different safe margin values.

Character body motion changes in 2D and 3D:
-Recovery only for depth > min contact depth to help with collision
detection consistency (rest info could be lost if recovery was too much)
-Adaptive min contact depth (based on margin) instead of space parameter

Extra CharacterBody changes:
-2D: apply changes made in 3D for stop on slope and floor snap that help
fixing some jittering cases
-3D: fix minor inconsistencies in stop on slope and floor snap logic
2021-09-27 15:31:41 -07:00
kobewi 140b54fd35 Fix TileMap layer loading 2021-09-27 13:13:48 +02:00
Rémi Verschelde 32ab77ef8f
Merge pull request #52430 from AnilBK/vector2-replacements 2021-09-24 13:04:42 +02:00
Anilforextra cc51b045da Construct values only when necessary. 2021-09-23 22:26:07 +05:45
Gilles Roudière f9e6329496 Implement animated tiles 2021-09-23 17:24:37 +02:00
PouleyKetchoupp 9269952053 Don't override KinematicCollision reference when still in use in script
In case the reference is stored in script, create a new instance to
avoid overriding the previous values.
Otherwise, re-use the reference as before to avoid extra allocations.
2021-09-22 18:08:04 -07:00
fabriceci fd9e573ba6 Port 2D improvement to move and slide 3D
Co-authored-by: Camille Mohr-Daurat <pouleyketchoup@gmail.com>
2021-09-22 00:14:04 +02:00
Anilforextra 90908cd67d Add Get Center Method for Rect2/Rect2i and AABB. 2021-09-21 21:14:17 +05:45
PouleyKetchoupp ed1ba5093f Clarify RigidDynamicBody modes
RigidDynamicBody modes are replaced with several properties to make their
usage clearer:
-lock_rotation: disable body's rotation (instead of MODE_LOCKED)
-freeze: no gravity or forces (instead of MODE_STATIC and MODE_KINEMATIC)
-freeze_mode: Static (can be only teleported) or Kinematic (can be animated)

Also renamed MODE_DYNAMIC_LOCKED to MODE_DYNAMIC_LINEAR in the physics
servers.
2021-09-16 16:03:48 -07:00
Wilson E. Alvarez f3a564f9a5
Rename Listener2D/Listener3D to AudioListener2D/AudioListener3D 2021-09-16 17:51:51 -04:00
Camille Mohr-Daurat 3581b893ed
Merge pull request #52681 from nekomatata/rename-rigid-body
Rename RigidBody to RigidDynamicBody and SoftBody to SoftDynamicBody
2021-09-16 11:20:21 -07:00
PouleyKetchoupp 85819b199a Rename RigidBody to RigidDynamicBody and SoftBody to SoftDynamicBody 2021-09-16 09:55:20 -07:00
fabriceci 04a53f86d0 Retrieve platform layer from PhysicsServer2D 2021-09-16 12:31:55 +02:00
Rémi Verschelde eb1262f6ea
Merge pull request #52308 from rxlecky/parallax-layer-position-reset-fix-issue-51914
Fix ParallaxLayer's transform resetting in editor
2021-09-15 13:16:56 +02:00