Handle a physics node deleted during a frame


Deleting a physics node clears its backend's frontendNode pointer, but
the backend stays in the world until the next frame takes it out. The
passes over m_physXBodies never checked, and crashed. Syncing is the
worst case: writing position and rotation runs bindings that are free to
delete the node, or to set a new scene, which clears frontendNode on
every backend at once. So check frontendNode after every write to a
frontend and before every pass over the backends.

updateFromPhysicsTransform() now reads both parent values before writing
either, and writes position before rotation, where a node with no parent
had them the other way round.

Forcing a body kinematic, which a shape that cannot be simulated
requires, now happens before its shapes are built, and the actor is told
too: PhysX silently refuses to attach a trimesh, heightfield or plane
simulation shape to a body that is not kinematic yet. Ceasing to be
kinematic stays behind the shapes for the mirror reason. buildShapes()
also kept shapes that attachShape() had refused, which left
markDirtyShapes() finding them to be in order so nothing rebuilt them;
it now keeps only what it managed to attach.

Add tests/auto/deleted_node for the three passes and for the scene being
taken away while the world syncs, a case in tests/auto/invalidinput that
drops a body on the forced kinematic one, in a scene of its own, and one
in tests/auto/cooked for a body that is kinematic from the start and
carries a cooked triangle mesh, which is what the dice cup of the
customshapes example is.

Pick-to: 6.12 6.11 6.8
Change-Id: I32e8a39937466787f3ad2f7752ec9320dcb7f6f9
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
commit518374c36c1deb916a5dd8715b69cc6f1f6a9440
parent1fd77c9d25a50888445ed11ed2762431dbc8f0ec
authorJonas Karlsson <jonas.karlsson@qt.io>
committerJonas Karlsson <jonas.karlsson@qt.io>
commit timeWed, 16 Sep 2026 13:15:48 +0000