Commit graph

1593 commits

Author SHA1 Message Date
Rémi Verschelde 3668312e78
Merge pull request #54847 from nekomatata/fix-test-move-regression 2021-11-10 20:38:49 +01:00
PouleyKetchoupp 5da057adaf Fix test_move reporting collision when touching another body
Reporting rest collision information is needed for move_and_collide and
move_and_slide so floor detection can be done properly, but in the case
of just testing the motion for collision, it makes sense to return false
if the body is able to move all along the path without being stopped.

Updated the logic in test_move and clarified the documentation for
test_move and move_and_collide.
2021-11-10 11:20:02 -07:00
PouleyKetchoupp bfd0d33244 Fix errors in CharacterBody when floor is destroyed or removed
In all physics servers, body_get_direct_state() now silently returns
nullptr when the body has been already freed or is removed from space,
so the client code can detect this state and invalidate the body rid.

In 2D, there is no change in behavior (just no more errors).

In 3D, the Bullet server returned a valid direct body state when the
body was removed from the physics space, but in this case it didn't
make sense to use the information from the body state.
2021-11-10 08:27:33 -07:00
Andrii Doroshenko (Xrayez) 6742a338a8 Rename GradientTexture to GradientTexture1D
1. Explicit and unambiguous when comparing to `GradientTexture2D`
2. Consistent with other class names where 1D is used in the engine.
2021-11-07 15:11:04 +02:00
Rémi Verschelde 13aaa73124
Merge pull request #54573 from nekomatata/query-parameters 2021-11-05 21:52:39 +01:00
PouleyKetchoupp acbd24ea84 Use parameter classes instead of arguments for all physics queries
Same as what is already done for shape queries, applied to point and ray
queries. Easier to document and more flexible to add more parameters.

Also expose intersect_point method to script in 3D.
Remove intersect_point_on_canvas in 2D, replaced with a parameter.
2021-11-04 11:44:39 -07:00
Hugo Locurcio c012fbc8b2
Rename PROPERTY_USAGE_NOEDITOR to PROPERTY_USAGE_NO_EDITOR
This is consistent with other constants that include `NO`,
such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-11-03 23:06:17 +01:00
Rémi Verschelde a2803f3d86
Merge pull request #54072 from KoBeWi/hrcr_is_ded 2021-11-03 17:31:48 +01:00
Rémi Verschelde 87ddc5bbbf
Merge pull request #54104 from Scony/improve-navigation-obstacles
Improve NavigationObstacle3D usability
2021-11-03 10:13:53 +01:00
Rémi Verschelde 81c93caf02
Merge pull request #54471 from rafallus/callable_area_monitor 2021-11-02 23:20:41 +01:00
clayjohn b7445f1ff8 Validate fog volume properties 2021-11-01 21:38:04 -07:00
rafallus 770e3a8e51 Use Callable in Area monitor callback 2021-11-01 21:53:17 -06:00
Camille Mohr-Daurat a57de3b818
Merge pull request #37880 from nekomatata/rigid-body-damping-override
Improved RigidDynamicBody linear/angular damping override
2021-11-01 11:24:01 -07:00
Hugo Locurcio ce97ddbcb1
Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3
- Use lowercase driver names for the `--rendering-driver`
  command line argument.
2021-10-30 02:05:49 +02:00
Yuri Roubinsky e058cf93bd Fix crashing of FogVolumes when WorldEnvironment was added 2021-10-29 14:25:49 +03:00
Rémi Verschelde 75baf16bab
Merge pull request #53353 from clayjohn/VULKAN-fog-volumes
FogVolumes, FogShaders, FogMaterial, and overhaul of VolumetricFog
2021-10-29 10:29:04 +02:00
clayjohn 1b2cd9f251 Addition of FogVolumes, FogShaders, FogMaterial, and overhaul of VolumetricFog
Co-authored-by: Brian Semrau <brian.semrau@gmail.com>
2021-10-28 22:02:23 -07:00
Lyuma c088a2dd89 Fix crash due to reentrancy in AudioStreamPlayer* finished signal.
This crash occurred when an audio stream finished playing in NOTIFICATION_INTERNAL_PROCESS,
during which it would iterate through a loop of playbacks,
leading to a "finished" signal, which removed the audio player from the tree
which led to a NOTIFICATION_EXIT_TREE,
which would mutate the array of playbacks while within the above loop.

This moves the signal callback outside of the loop which avoids the crash.
Note: previously, the signal was called multiple times if the same player finishes multiple times in one frame. Now it is at most once per frame.

Affects AudioStreamPlayer, AudioStreamPlayer2D and AudioStreamPlayer3D
2021-10-28 19:45:29 -07:00
Rémi Verschelde f7d852b532
Merge pull request #54350 from akien-mga/clang-format-dont-align-operands 2021-10-28 17:10:52 +02:00
Rémi Verschelde e2deec67b9
Merge pull request #54222 from JFonS/instance-fade 2021-10-28 16:05:55 +02:00
Rémi Verschelde 0ae65472e7
clang-format: Enable BreakBeforeTernaryOperators
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 15:57:41 +02:00
Rémi Verschelde 3a6be64c12
clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde 3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
kobewi de4f29f458 Remove node_hrcr hack 2021-10-28 01:43:34 +02:00
Camille Mohr-Daurat 3c527dcbbd
Merge pull request #54157 from bjauny/fix_potential_nullpointer_collision3d
Fix potential null pointer use, based on #54094 fix
2021-10-27 12:40:50 -07:00
Bastien JAUNY 258b5d0019 Fix potential null pointer use, based on #54094 fix 2021-10-27 20:41:14 +02:00
PouleyKetchoupp daf7dcac7a Improved RigidDynamicBody linear/angular damping override
Damping values are now non-negative.

Add new properties linear_damp_mode and angular_damp_mode to set the way
RigidDynamicBody and PhysicalBone (2D & 3D) use damping values.
It can now be Combine (default) to add to the default/areas, or Replace
to override the value completely (current behavior).
2021-10-25 18:22:12 -07:00
Hugo Locurcio f2c2ecb6e8
Fix properties being displayed when they shouldn't in DirectionalLight3D
The parent `_validate_property()` wasn't called, which led to shadow
properties being visible even if shadows were disabled on a
DirectionalLight3D node.
2021-10-25 22:04:30 +02:00
Rémi Verschelde d98a6363fa
Merge pull request #54084 from reduz/node3d-rotation-options 2021-10-25 20:42:45 +02:00
Rémi Verschelde 8911d6ecc8
Merge pull request #54147 from Calinou/editor-directionallight-3d-only-show-relevant-properties 2021-10-25 20:13:42 +02:00
Pawel Lampe fa26fb865f Improve NavigationObstacle3D usability
Fix NavigationObstacle3D to be attached to navigation map - without it
the NavigationObstacle3D is not working.

Replace radius approximation algorithm with simple "radius" property.
2021-10-25 19:57:33 +02:00
reduz d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
Hugo Locurcio c1de200757
Only show relevant properties in the DirectionalLight3D inspector
Some split distance properties are unused depending on the
current shadow mode. Also, Blend Splits can only be used if the shadow
mode is PSSM 2 Splits or PSSM 4 Splits.

This also moves the Fade Start property to be located after the
split properties. This avoids intertwining "conditional" properties
with a property that's always available.
2021-10-25 18:31:41 +02:00
JFonS c571e4a7f4 Implement distance fade and transparency
The built-in ALPHA in spatial shaders comes pre-set with a per-instance
transparency value. Multiply by it if you want to keep it.

The transparency value of any given GeometryInstance3D is affected by:
   - Its new "transparency" property.
   - Its own visiblity range when the new "visibility_range_fade_mode"
     property is set to "Self".
   - Its parent visibility range when the parent's fade mode is
     set to "Dependencies".

The "Self" mode will fade-out the instance when reaching the visibility
range limits, while the "Dependencies" mode will fade-in its
dependencies.

Per-instance transparency is only implemented in the forward clustered
renderer, support for mobile should be added in the future.

Co-authored-by: reduz <reduzio@gmail.com>
2021-10-25 11:39:34 +02:00
Hristo Stamenov 3ec927cfef Setting the visible multimesh instance to -1 so that they are updated correctly on set_amount.
When emitting stops CPUParticles3D::_set_redraw(bool p_redraw) will set that value to 0 so when you change the amount after that it will actually not update correclty.

This fixes an issue where if it was not emitting when the scene loaded and it start after that the amount is not reflected correclty. This also happened when you checked out the box for emitting in the editor, changed the value of amount and then checked on the box for emitting. With this change if it is emitting during the change it does interrupt the previous particles when you change. The amount and the emit starts from beginning but that is to be expected on an amount of particles change.
2021-10-24 22:04:30 +03:00
Silc 'Tokage' Renew 653e2a550c Fixed animation insertion in SkeletonEditor 2021-10-23 16:50:00 +09:00
Rémi Verschelde 9f7218eb69
Merge pull request #54088 from madmiraal/remove-unimplemented-methods 2021-10-22 12:59:32 +02:00
Marcel Admiraal 87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
Rémi Verschelde 133c1eb0af
Merge pull request #52367 from Duroxxigar/improve-nav-error-messages
Improve readability for failing errors in nav area
2021-10-21 19:36:16 +02:00
Rémi Verschelde 836f86688f
Merge pull request #54053 from nekomatata/fix-soft-body-disable-mode
Fix SoftDynamicBody3D crash when setting disable mode
2021-10-21 19:33:01 +02:00
PouleyKetchoupp e6f7235ffb Fix SoftDynamicBody3D crash when setting disable mode
Proper logic for changing physics state when disabled and disabled mode
is changed (it was unnecessarily making calls to re-initialize physics).

Extra error handling in soft body implementations to avoid crashes with
invalid mesh.
2021-10-21 08:56:12 -07:00
Kemikal1 563d3dbf94 Change the unreacheable return value of shape_find_owner()
Update collision_object_3d.cpp

2d modified and UINT32 usage

Proper uINT32max usage

Change the unreacheable return value of shape_find_owner()

This reverts commit 5be98b81428169ba2dd5baecd00f1adfd9260e5c, reversing
changes made to efa3ff6b95.

Change the unreacheable return value of shape_find_owner()

changed from 0 to uint32_max"

This reverts commit c143bb099af2666454f82428a57f2721af60a84d.

Revert "changed from 0 to uint32_max""

This reverts commit 59e94edb9a32edff15f3cb881e6fc394d2aa7f65.

Revert "changed from 0 to uint32_max"

This reverts commit c143bb099af2666454f82428a57f2721af60a84d.

Revert "Revert "changed from 0 to uint32_max"""

This reverts commit c81d1073ec21b4cde4684a6dbd595f3359283bad.

Revert "changed from 0 to uint32_max"

This reverts commit c143bb099af2666454f82428a57f2721af60a84d.

Revert "changed from 0 to uint32_max""

This reverts commit 59e94edb9a32edff15f3cb881e6fc394d2aa7f65.

Revert "Revert "changed from 0 to uint32_max"""

This reverts commit 6dbd972aa5c4580d4f6270ead6c66eea18617f29.

Revert "changed from 0 to uint32_max""

This reverts commit 59e94edb9a32edff15f3cb881e6fc394d2aa7f65.

Revert "Revert "changed from 0 to uint32_max"""

This reverts commit b769ac2d11ad12f02a388d9dad17519f81d9c3b6.

Revert "Revert "Revert "changed from 0 to uint32_max""""

This reverts commit 1e8d84f7ec12da01c3153e08bb8609cf2c6fd58a.

Revert "Revert "Revert "Revert "changed from 0 to uint32_max"""""

This reverts commit 0dc17abefad6d540c18bba7b4df9d8c04e090d0c.

Change the unreacheable return value of shape_find_owner()
2021-10-21 15:02:28 +03:00
Rémi Verschelde 8688b97dda
Merge pull request #54036 from nekomatata/fix-soft-body-memory-corruption 2021-10-21 11:42:44 +02:00
PouleyKetchoupp 1f816979f6 Fix SoftDynamicBody3D memory corruption when switching mesh at runtime
When switching the mesh at runtime, the physics server wasn't properly
updated with the new mesh. Now we keep track of the soft body mesh to
make sure everything is properly initialized on pre-draw.

Also cleaned a few things around private methods.
2021-10-20 10:57:08 -07:00
Rémi Verschelde da98357e6e
doctool: Fix differences between headless and Vulkan rendering backends
Fixes #53913.
2021-10-20 17:48:50 +02:00
Rémi Verschelde 723b988fde
Merge pull request #52210 from BastiaanOlij/enhance_xr_trackers 2021-10-19 08:11:32 +02:00
Rémi Verschelde 015e0c9fd8
Merge pull request #52773 from Calinou/audiostreamplayer3d-tweak-max-distance 2021-10-18 10:49:01 +02:00
Bastiaan Olij 5d1ea92daf Rework XR positional trackers 2021-10-17 12:12:20 +11:00
Rémi Verschelde c2a616f3ec
Merge pull request #53821 from TwistedTwigleg/Godot_Master_SkeletonModificationIK_FixPoseChange
Fix for SkeletonModification3Ds to work with the new bone pose changes.
2021-10-16 23:54:37 +02:00
TwistedTwigleg 0cedc04769 Fix for SkeletonModification3Ds to work with the new bone pose changes, fixed global_pose_to_local_pose function 2021-10-16 16:34:31 -04:00