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
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.
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).
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.
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.
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