Do not set a kinematic target on a body with simulation disabled
A body whose simulationEnabled is false has no simulation object behind
it in PhysX, and PxRigidDynamic::setKinematicTarget() is not allowed for
it. PhysX 4.1 tests the pointer and does nothing, so the call we make
every frame from QPhysXDynamicBody::sync() is harmless there, but it is
only checked, not handled: the check is a PX_CHECK_AND_RETURN, which is
compiled out of a release build, and what follows it dereferences that
pointer. It is left in PhysX 5, where the release build crashes in
Sc::BodySim::setKinematicTarget() as soon as such a body is synced.
Skip the call for those bodies, which changes nothing observable on 4.1
and keeps the coming PhysX 5 update from having to carry the fix.
Nothing is lost by skipping it: the target is recomputed from the node
transform on the first frame the body takes part in the simulation
again.
Pick-to: 6.12 6.11 6.8
Change-Id: I4790c1f688c50dda7e33a83f84f8f771daed7b76
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>