Commit graph

1410 commits

Author SHA1 Message Date
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 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
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
Gilles Roudière 173c0f8737
Merge pull request #52622 from rileylyman/tilemap-crash
Break TileMap _clear_internals out from _recreate_internals
2021-09-15 09:39:36 +02:00
Riley Lyman dfcf4491d6 Break TileMap _clear_internals out from _recreate_internals 2021-09-14 20:45:10 -07:00
Gilles Roudière 73cc6f94bf Fix transform of TileMap nodes and tilemap selection 2021-09-14 12:18:36 +02:00
Max Hilbrunner 8f8744a563
Merge pull request #52433 from groud/document_tiles
Tiles renames and documentation
2021-09-10 16:32:19 +02:00
Juan Linietsky d0a7eeaaff
Merge pull request #44844 from KoBeWi/hey_listen!_but_2d
Add Listener2D
2021-09-09 19:19:10 -03:00
Gilles Roudière 0c85f3acc1 Tiles renames/bugfixing and documentation 2021-09-08 15:52:43 +02:00
Juan Linietsky ca11f8ad30
Merge pull request #52237 from ellenhp/polyphony
Add optional polyphonic playback to built-in audio player nodes
2021-09-07 17:38:51 -03:00
Ellen Poe 0e3cab41eb Add polyphony to Audio Stream Player nodes 2021-09-07 09:44:39 -07:00
Juan Linietsky 93aa158b5e
Merge pull request #52277 from groud/implement_array_property_hint
Implement properties arrays in the Inspector.
2021-09-07 11:59:46 -03:00
Gilles Roudière 4bd7700e89 Implement properties arrays in the Inspector. 2021-09-07 09:51:28 +02:00
Anilforextra a1f616dcfc Use builtin Vector2 functions for calculation of angles.
.
2021-09-07 08:30:26 +05:45
PouleyKetchoupp 82ea2a7045 Proper support for custom mass properties in 2D/3D physics bodies
Changes:
-Added support for custom inertia and center of mass in 3D
-Added support for custom center of mass in 2D
-Calculated center of mass from shapes in 2D (same as in 3D)
-Fixed mass properties calculation with disabled shapes in 2D/3D
-Removed first_integration which is not used in 2D and doesn't seem to
make a lot of sense (prevents omit_force_integration to work during the
first frame)
-Support for custom inertia on different axes for RigidBody3D
2021-09-06 10:20:16 -07:00
Camille Mohr-Daurat a93fb2655a
Merge pull request #52286 from nekomatata/restore-kinematic-body
Add AnimatableBody inherited from StaticBody for moving platforms
2021-09-06 09:32:46 -07:00
Gilles Roudière a4cd553f42 Fix crash in TileMap physics 2021-09-06 13:11:41 +02:00
SeleckyErik 7741afb55a Fix ParallaxLayer's transform resetting in editor
Disable resetting of ParallaxLayer's position and scale in editor to
allow setting the initial values.
2021-09-01 14:57:14 +02:00
PouleyKetchoupp 83baecdff0 Add AnimatableBody inherited from StaticBody for moving platforms
Instead of having a physics node named Static that can be either Static
or Kinematic, AnimatableBody is added again as a separate node:
-Inherited from StaticBody to make its usage clearer
-Still separated from CharacterBody to make its usage more focused

Properly implemented constant velocity for kinematic bodies in godot
physics servers (induced velocity without actually moving).

Also updated description for the different physics nodes to make their
usage clearer.
2021-08-31 18:14:32 -07:00
Juan Linietsky 7946066577
Merge pull request #49471 from nekomatata/body-state-sync-callback
Clean physics direct body state usage in 2D and 3D physics
2021-08-31 14:30:17 -03:00
Camille Mohr-Daurat 0ee1179c1c
Merge pull request #52279 from fabriceci/delta-double
Change delta type to double in Physics_body_2/3D
2021-08-31 08:25:36 -07:00
kobewi f2cb0a8d4b Add Listener2D 2021-08-31 16:53:14 +02:00
fabriceci f9d548627d delta time as double 2021-08-31 14:32:56 +02:00
fabriceci 1a481c8191 Change platform detection by allowing select layers by type (wall or floor) 2021-08-31 09:59:04 +02:00
Juan Linietsky 07707a3627
Revert "Display a matrix for Node2D and don't display a duplicate origin" 2021-08-29 17:01:07 -03:00
Aaron Franke ee7bb9bbb9
Display a matrix for Node2D and don't display a duplicate origin 2021-08-29 10:34:50 -05:00
Juan Linietsky 54caaa21ce
Merge pull request #51296 from ellenhp/mix_in_audio_server
Move mixing out of the AudioStreamPlayback* nodes
2021-08-27 15:38:20 -03:00
Camille Mohr-Daurat 87f575efdd
Merge pull request #52135 from fabriceci/fix-transmission-velocity-on-wall-4
Remove velocity transmission on_wall when collider is CharacterBody.
2021-08-27 10:56:42 -07:00
Ellen Poe 3598d300cb Do all audio mixing in the AudioServer 2021-08-27 10:41:57 -07:00
fabriceci 4da0cfe459 Remove velocity transmission on_wall when collider is CharacterBody. 2021-08-26 23:02:30 +02:00
PouleyKetchoupp 6a9ed72185 Clean physics direct body state usage in 2D and 3D physics
Use a C++ callback instead of Callable for synchronizing physics nodes' state with physics servers.

Remove usage of PhysicsDirectBodyState in physics nodes when not
necessary.

Store PhysicsDirectBodyState for bodies individually instead of a
singleton to avoid issues when accessing direct body state for multiple
bodies.

PhysicsDirectBodyState is initialized only when needed, so it doesn't
have to be created when using the physics server directly.

Move PhysicsDirectBodyState2D and PhysicsDirectBodyState3D to separate
cpp files.
2021-08-25 08:57:42 -07:00
PouleyKetchoupp d9720d4395 Fix CharacterBody motion with RayShape
Make separation ray shapes work properly in move_and_slide, wihtout the
specific code in CharacterBody like before.

Now most of the logic is handled inside the physics server. The only
thing that's needed is to use ray shapes only for recovery and ignore
them when performing the motion itself (unless we're snapping or slips
on slope is on).
2021-08-24 17:34:55 -07:00
reduz 44d62a9f4b Implement NativeExtension pointer arguments
* Allows calling into native extensions directly with a pointer
* Makes it easier to implement some APIs more efficiently
* Appears with a "*" in the documentation for the argument.
* Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint.
* AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
2021-08-23 19:58:40 -03:00
Hugo Locurcio 0af213a4e0
Merge pull request #51259 from nekomatata/fix-tilemap-one-way-collision
Fix one-way collision in Tilemap
2021-08-23 18:54:01 +02:00
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
QbieShay d6672096fc moved particle parameters to minmax and split scale axis
This commit adds quite a chunk of modifications to particles
- particle (value + randomness) now use min and max instead
- passing a curveXYZtexture is now possible and will scale particles per-axis
- CPUParticle3D have an optional parameter to split the scale curve per-axis
2021-08-22 18:42:17 +02:00
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
fabriceci 68f0cf97bc add motion mode to handle TPS 2021-08-20 17:32:33 +02:00
Rémi Verschelde 4f640762f7
Merge pull request #51881 from KoBeWi/zz__iinnddeexx
Fix z_index applied twice for TileMap layers
2021-08-19 21:30:10 +02:00
ThreeRhinosInAnElephantCostume 78e2d35a7e fixed camera2d's "current" property getting reset when switching scenes 2021-08-19 15:19:19 +02:00
kobewi a7ace9fec1 Fix z_index applied twice for TileMap layers 2021-08-19 12:40:09 +02:00