1
0
Fork 0
Commit Graph

82 Commits

Author SHA1 Message Date
Luo Zhihao 793228f171
JoltPhysics: Fix orphan StringName 2025-09-08 22:18:46 +08:00
Jorrit Rouwe 09fcaa7db4 Fixed crash when rendering a soft body 3d
When a mesh is provided that has vertices that are not referenced by any face, these vertices will be discarded. In the internal 'mesh_to_physics' map, this led to uninitialized data which could result in a crash. Now we initialize the map with -1 and report an error when users try to manipulate these vertices.

Fixes #109883
2025-08-24 15:38:11 +02:00
Mikael Hermansson 6c907c2d37 Fix `move_and_slide` forcing synchronization with physics thread
Co-authored-by: Ricardo Buring <ricardo.buring@gmail.com>
2025-08-14 18:58:36 +02:00
Thaddeus Crews 8c0900450c
Merge pull request #108495 from simpkins/deadlock_comments
Document some deadlocks in the physics server code
2025-07-18 11:05:12 -05:00
Adam Simpkins cb25b933e7 Document some deadlocks in the physics server code
Add some comments documenting locations where
PhysicsServer3D::soft_body_set_mesh() can deadlock.

godotengine/godot-proposals#12670 has a proposal for some alternate
thread-safe soft body APIs.  In the meantime it seems worth at least
documenting some of the current pitfalls in the code.
2025-07-13 13:44:48 -07:00
Mikael Hermansson 5a16e2fc78 Fix contacts not being reported properly when using Jolt Physics 2025-07-12 14:20:38 +02:00
Thaddeus Crews 8f816614f6
Merge pull request #108239 from mihe/jolt/scene-switch-crash
Fix crash in Jolt Physics when switching scenes in editor
2025-07-04 10:09:05 -05:00
Thaddeus Crews b7dcb1f728
Merge pull request #108094 from simpkins/jolt_soft_body_transform
Jolt physics: wake up a soft body when its transform changes
2025-07-03 12:21:27 -05:00
Mikael Hermansson e2985a2e1f Fix crash in Jolt Physics when switching scenes in editor
Co-authored-by: Jorrit Rouwe <jrouwe@gmail.com>
2025-07-03 16:45:53 +02:00
Mikael Hermansson 63021bb4aa Improve performance for shapeless objects when using Jolt Physics 2025-07-03 14:14:00 +02:00
Adam Simpkins 71e3a229f6 Jolt physics: wake up a soft body when its transform changes
This updates `JoltSoftBody3D::set_transform()` to wake up the
soft body after changing the transform.

Previously, if you had a soft body that was sleeping in a steady state
on a ground plane, and you then translated it upwards by 1 meter it
would just hang in the air.  Now it falls to the ground correctly.

Issue #108090 has some details and an MRP (although that issue is mostly
about other problems in SoftBody3D iteself).
2025-06-28 16:34:51 -07:00
Rémi Verschelde f97c51132e
Merge pull request #107832 from simpkins/soft_body_normals
Fix Jolt Physics soft body vertex normal calculation
2025-06-28 13:03:01 +02:00
Adam Simpkins dd80a3aa19 Fix jolt_physics soft body vertex normal calculation
The code previously iterated through each face and set all vertices to
that face's normal.  This resulted in each vertex getting the normal
from just one face that it belonged to (whichever face was last in this
array).  This caused weird shading artifacts.

This fixes the code so that the vertex normal is now the average normal
of all faces that it belongs to.  This results in "smooth shading"
behavior for soft body meshes.  This is still somewhat undesirable if
the input mesh was using flat shading, but it looks less bad than the
previous behavior of picking a normal at random from one attached face.

This matches the behavior of GodotPhysicsServer3D.

Fixes #107831.
2025-06-27 17:04:15 -07:00
Mikael Hermansson 50e24e24ed Fix crash when disabling `SoftBody3D` while using Jolt Physics 2025-06-27 12:52:47 +02:00
Mikael Hermansson 89f9a23d9e Batch the adding of Jolt Physics bodies
Co-authored-by: Jorrit Rouwe <jrouwe@gmail.com>
2025-06-14 14:11:07 +02:00
Mikael Hermansson e160040f0c Remove Jolt Physics project setting "Areas Detect Static Bodies" 2025-06-03 09:52:57 +02:00
Mikael Hermansson b3ddb88035 Fix Area3D signal emissions when using Jolt Physics 2025-05-30 11:53:17 +02:00
Thaddeus Crews dcde70f409
Merge pull request #106693 from mihe/jolt/area-cleanup
Remove force enter/exit logic from `JoltArea3D`
2025-05-28 09:47:40 -05:00
Thaddeus Crews bb47f01481
Merge pull request #106390 from akien-mga/linux-drop-ppc32
Linux: Drop `ppc32` (32-bit PowerPC) architecture support
2025-05-28 09:47:34 -05:00
Thaddeus Crews 05ceab6b7b
Merge pull request #106321 from elzewyr/shrink-factor
SoftBody3D: Add a property for scaling rest lengths of edge constraints
2025-05-27 09:39:29 -05:00
Thaddeus Crews de2cd663fd
Merge pull request #100463 from PiCode9560/softbody-apply-force-and-impulse
Add ability to apply forces and impulses to `SoftBody3D`
2025-05-26 11:24:45 -05:00
Thaddeus Crews b8be0f1634
Merge pull request #106761 from mihe/jolt/move-only-shape-ref
Change `JoltShapeInstance3D` to use move semantics
2025-05-26 11:24:22 -05:00
Mikael Hermansson 92da11f69c Change `JoltShapeInstance3D` to use move semantics 2025-05-23 21:39:55 +02:00
PiCode fe3aaa2ae3 Add functions to apply impulse and force to SoftBody on GodotPhysics and JoltPhysics 2025-05-23 22:04:52 +03:00
Mikael Hermansson d153a267b0 Remove error for degenerate soft body faces when using Jolt Physics 2025-05-22 20:17:47 +02:00
Mikael Hermansson 3d98aaf728 Remove force enter/exit logic from `JoltArea3D` 2025-05-21 21:40:40 +02:00
Thaddeus Crews c225686e82
Merge pull request #106490 from mihe/jolt/non-monitoring-area-performance
Improve performance with non-monitoring areas when using Jolt Physics
2025-05-21 09:06:26 -05:00
Mikael Hermansson 617a39d5ea Improve performance with non-monitoring areas when using Jolt Physics 2025-05-20 13:20:12 +02:00
Elzewyr 9f67bf96fa SoftBody3D: Add a property for scaling rest lengths of edge constraints 2025-05-16 18:38:00 +03:00
Thaddeus Crews 5e27318b6c
Merge pull request #106366 from jrouwe/fix_106301
Jolt physics: Setting position instead of velocity in `JoltSoftBody3D::set_vertex_position`
2025-05-15 10:22:29 -05:00
Rémi Verschelde 1de9789806
Linux: Drop `ppc32` (32-bit PowerPC) architecture support
This was added together with `ppc64le` in #54490, but seemingly only for the
purpose of getting it to compile on a Linux distro that aims at maximizing
support for all CPU architectures.

I don't think anyone has ever _run_ Godot on a `ppc32` system (do those even
support OpenGL ES 3.0?) and so I don't think we should aim to support it.

Debian dropped support for its PowerPC (`ppc32`) arch in Debian 9, released
in 2017.
2025-05-14 10:22:12 +02:00
Thaddeus Crews f70420a8b1
Merge pull request #106346 from mihe/jolt/scu-support
Fix SCU build issues related to Jolt Physics
2025-05-13 16:22:26 -05:00
Jorrit Rouwe c529f36532 Jolt physics: Setting position instead of velocity in JoltSoftBody3D::set_vertex_position
This fixes a discrepancy between godot physics and Jolt physics where in Jolt a vertex pinned to a body only gets its velocity updated while in godot it gets its position updated. This causes it to lag one frame behind.

Fixes #106301
2025-05-13 22:45:58 +02:00
Adam Scott f114a8d1d1
Add WebAssembly SIMD support 2025-05-13 07:35:53 -04:00
Mikael Hermansson 9cea7ebc91 Fix SCU build issues related to Jolt Physics 2025-05-13 12:34:55 +02:00
Mikael Hermansson f539d0a447 Remove emitting of error in `JoltBody3D::_exit_all_areas` 2025-05-06 11:36:22 +02:00
Thaddeus Crews e939aefe2f
Merge pull request #105748 from mihe/jolt/body-pointer
Remove no-op locking in Jolt Physics module
2025-05-05 11:24:10 -05:00
Thaddeus Crews 01fc9aee6c
Core: Modernize C headers with C++ equivalents 2025-05-02 08:23:01 -05:00
Lukas Tenbrink 91362a61da Simplify `StringName` to `bool` conversions.
Move `mutex` include of `string_name.h` to `string_name.cpp`.
2025-04-30 16:59:34 +02:00
Mikael Hermansson 2b88477efc Remove no-op locking in Jolt Physics module 2025-04-29 12:23:24 +02:00
Thaddeus Crews 3947cbe3b2
Merge pull request #104386 from Repiteo/core/cpp-math
Core: Replace C math headers with C++ equivalents
2025-04-27 19:21:22 -05:00
Thaddeus Crews 2d3bdcac35
Merge pull request #105470 from clayjohn/RID-owner-limit
Increase chunk limit for known problematic RID_Owners.
2025-04-18 12:21:30 -05:00
clayjohn 941ad15724 Increase chunk limit for known problematic RID_Owners.
The default limit is fine for most RID_Owners but 3d instances, CanvasItems, and physics bodies need a higher limit.

There is a small memory cost to increasing the limit, so it should only be done where needed.
2025-04-16 17:03:47 -07:00
Thaddeus Crews ad40939b6f
Core: Replace C math headers with C++ equivalents
- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
2025-04-16 15:49:02 -05:00
Thaddeus Crews 94282d88f9
Core: Use `Math` namespace for constants 2025-04-10 16:29:30 -05:00
Thaddeus Crews 171187d1aa
Merge pull request #101011 from aaronfranke/limit-max-contacts-reported
Place a hard limit on the `max_contacts_reported` property in 2D/3D physics
2025-04-09 18:11:53 -05:00
Thaddeus Crews 2fe029ded8
Merge pull request #104449 from mihe/jolt/v5.3.0
Jolt: Update to 5.3.0
2025-04-04 09:29:20 -05:00
Thaddeus Crews f25fc34439
SCons: Add `CPPEXTPATH` for external includes 2025-04-02 07:29:08 -05:00
Aaron Franke a5de242a2f
Place a hard limit on the max_contacts_reported property 2025-03-29 01:17:55 -07:00
Michael Alexsander 5ad414d046
Allow to compile templates without physics servers 2025-03-28 11:00:44 -03:00