Commit Graph

342 Commits

Author SHA1 Message Date
风青山 2f515d6a27
Add forgotten `get_space()` check in `GodotArea3D::remove_soft_body_from_query()`
My fault, I added a `get_space()` check for the other `GodotArea3D::remove_*_from_query()`
but forgot about `soft_body`.
2024-09-18 07:59:50 +08:00
rune-scape ef9b82a076 fix rare physics crash 2024-06-18 02:18:11 -07:00
jsjtxietian d9399f59f5 Add useful error msg in `GodotSoftBody3D::set_mesh` 2024-05-14 11:43:09 +08:00
A Thousand Ships 86de59d60a
[Core] Add `LocalVector::has` for convenience 2024-05-06 18:03:37 +02:00
A Thousand Ships 31e7ee63f2
Fix unsafe uses of `Callable.is_null()`
`Callable.is_null()` is not equivalent to `!Callable.is_valid()` and
doesn't guarantee the call is valid.
2024-04-27 16:22:57 +02:00
Hugo Locurcio 74aeab5385
Increase size of WorldBoundaryShape to be much larger
The size was previously 20,000 pixels or units, which could be easily
reached in many projects. It is now 2,000,000,000,000,000 pixels or units,
which is larger than the supported coordinate space with a single-precision
build, and still very large in a double precision build.
2024-04-16 18:26:46 +02:00
Markus Mikonsaari 3f69af9e64 Fix separating axes for 3D cylinder-face collisions
When checking for lateral surfaces of a cylinder against the points on a
face, the axis projection does not remove the cylinder position. This
results in the axis pointing to the wrong direction and reports
collisions when there shouldn't be.
2024-04-01 21:47:54 +03:00
A Thousand Ships 79ba22a73f
Use `Vector*` component-wise `min/max/clamp` functions where applicable 2024-03-20 13:47:42 +01:00
Mikael Hermansson 7901a0524b Allow for 32 max collisions in `test_body_motion` 2024-03-15 15:40:42 +01:00
Thaddeus Crews 9903e6779b
Enforce template syntax `typename` over `class` 2024-03-07 22:39:09 -06:00
Rémi Verschelde 3a08c646ee
Pre-commit: Update to clang-format 17.0.6 and black 24.2.0 2024-02-28 14:25:35 +01:00
A Thousand Ships 15369fdb1d
Remove unnecessary `this->` expressions 2024-01-29 09:59:18 +01:00
Occalepsus 492f1c2406 Fix body leaving area gravity influence 2023-12-21 16:10:02 +01:00
风青山 ea30aabfb1 Clear monitoring in `Area*` when its space changes to invalid
So that it can work properly when the space changes to valid again.

Change `space` in advance to prevent disabled areas from being queried again.
2023-12-15 20:54:54 +01:00
Rémi Verschelde a1d7c62df7
Merge pull request #83003 from AThousandShips/null_check_extra
Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
2023-10-09 15:37:14 +02:00
A Thousand Ships f18aa00e85 Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-10-08 17:23:33 +02:00
Mai Lavelle 5e15586ec2 Fixes to allow object-less callables throughout Godot
This fixes #81887
2023-10-06 16:31:35 -04:00
kobewi 09b30be86d Add vararg call() method to C++ Callable 2023-10-05 11:35:29 +02:00
Rémi Verschelde 2c8c7b95aa
Merge pull request #82313 from AThousandShips/null_check_servers
[Servers] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
2023-09-26 13:45:31 +02:00
Rémi Verschelde eefe161549
Merge pull request #81610 from Ughuuu/add-angle-limits-and-motor-to-pin-joint-2d
Update PinJoint2D API with angle limits and motor speed
2023-09-26 13:45:07 +02:00
Rémi Verschelde 1e4165ac60
Merge pull request #78757 from Crimzoth/RigidBody3D-mass-issue-fix
Correctly set mass for a rigid body with custom inertia and center of mass
2023-09-26 13:44:36 +02:00
Dragos Daian 0fcfb07246 Update PinJoint2D API with angle limits and motor speed
add enabled methods for motor and angular limits
use correct name to get joint
update copyright
2023-09-26 10:29:23 +02:00
A Thousand Ships fdd3d36c6d [Servers] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-09-25 18:45:30 +02:00
Mikael Hermansson ee9f41a12d Fix bindings of `PhysicsServer3DRenderingServerHandler` 2023-09-20 12:24:32 +02:00
PrecisionRender af7f787c6e Add ability to get barycentric coordinates from ray 2023-08-02 15:16:44 -05:00
Crimzoth 3bab21fdd7 Fix: Mass not set properly for RigidBody
Removed erroneous check, which caused _inv_mass not to be calculated when RigidBody2D or RigidBody3D used both custom center of mass and custom inertia.
2023-06-27 18:56:38 +02:00
Rémi Verschelde 7ff0a3086d
Merge pull request #76138 from rburing/ccd_against_moving
Improve rigid body CCD against moving bodies
2023-06-19 22:34:16 +02:00
lawnjelly b69c8b4791 Single Compilation Unit build.
Adds support for simple SCU build (DEV_ENABLED only).
This speeds up compilation by compiling multiple cpp files within a single translation unit.
2023-06-06 15:36:51 +01:00
Ricardo Buring 8812d27bc7 Restore edge and face support thresholds in 3D 2023-05-17 20:14:19 +02:00
Rémi Verschelde 769d8a7bbe
Merge pull request #76088 from rburing/contact_points_global_3d
PhysicsDirectBodyState3D: report contact points using global coordinates
2023-05-10 09:09:17 +02:00
Black-Cat d710af2e97
Fix precision in physics supports generation
Lower threshold for dot was (1.0 - threshold) which is incorrect.
Patch changes it to correct version sqrt(1.0 - threshold * threshold)

Co-authored-by: Ricardo Buring <ricardo.buring@gmail.com>
2023-04-29 12:12:10 +01:00
Danil Alexeev 36bedd341a
Fix misuses of error macros 2023-04-18 10:20:48 +03:00
Ricardo Buring 47c5b8bafc Improve rigid body CCD against moving bodies 2023-04-16 19:46:33 +02:00
Ricardo Buring 15b8cb9d9c PhysicsDirectBodyState3D: report contact points using global coordinates
Also update the documentation to reflect this in both 2D and 3D.
2023-04-15 14:31:17 +02:00
Tim Gift fffc6aba58 Resolved issues with script PhysicsDirectBodyState3d contacts
Resolved a problem with PhysicsDirectBodyState3D sometimes returning incorrect contact positions and added a new get_contact_local_velocity_at_position method to compliment the existing one for the collider.
2023-04-12 11:40:34 -07:00
Ricardo Buring d7aed57b60 Fix typo bug in convex-convex separating axis test 2023-04-08 20:37:12 +02:00
Ricardo Buring bec1182093 Revert attempted fix of trimesh CCD 2023-03-13 13:54:10 +01:00
Rémi Verschelde 02e5da2cc5
Merge pull request #72917 from rburing/fix_trimesh_ccd
Fix CCD in case of multiple supports in motion direction
2023-02-20 15:40:56 +01:00
Rémi Verschelde 4a1913fc17
Merge pull request #68181 from MarianoGnu/fix-convex-hull-crash
Avoid memory corruption when GodotConvexPolygonShape3D is setup more than once
2023-02-17 00:33:47 +01:00
myaaaaaaaaa 6f88392d02 Move some worker_thread_pool.h includes out of header files 2023-02-13 14:02:01 -05:00
Ricardo Buring 2290f3b6a4 Fix CCD in case of multiple supports in motion direction
For example, an axis-aligned box under the influence of gravity landing
on a horizontal triangle could previously tunnel, because only one of
the supports of the box was considered to be the candidate point that
would collide first. Now all supports are considered as candidates.

Also fix CCD always pushing the fast body into the other body, which
works well for convex shapes but not for trimesh/concave shapes.
2023-02-10 09:55:16 +01:00
smix8 026549db2e Create default World physics spaces on demand only
Changes that the default physics spaces of World resources are only created on first use.
2023-01-31 18:26:52 +01:00
Rémi Verschelde dfb824c1d1
Merge pull request #72107 from rburing/separation_ray_normal
Fix separation ray normal direction
2023-01-31 10:54:34 +01:00
Aaron Franke 79215131b5
Replace Area gravity point distance scale with unit distance 2023-01-29 22:12:00 -06:00
Aaron Franke 866e2b95dc
Remove deprecated AREA_PARAM_GRAVITY_POINT_ATTENUATION 2023-01-29 22:12:00 -06:00
Ricardo Buring ed54f4dce8 Fix separation ray normal direction 2023-01-26 12:09:35 +01:00
kobewi 615c517034 Use range iterators in LocalVector loops 2023-01-21 18:44:42 +01:00
Peter Eastman cd46fceb8b Collision detection supports uniform scaling 2023-01-19 22:16:31 -08:00
Peter Eastman 31c2a24893 Analytic collision normals 2023-01-18 18:24:57 -08:00
Rémi Verschelde 800216924c
Merge pull request #70787 from peastman/cylinder
Analytic sphere-box, sphere-cylinder, and capsule-cylinder collisions
2023-01-12 20:08:03 +01:00