Fix reachable Q_UNREACHABLE() when Geometry lacks a required attribute
attributeBySemantic() hit Q_UNREACHABLE() -- undefined behavior in
release builds -- whenever a custom QQuick3DGeometry assigned to
ConvexMeshShape.geometry or TriangleMeshShape.geometry was missing a
position (or, for indexed geometry, index) attribute. This is reachable
through ordinary API misuse, not just adversarial content, so it's not
just defensive programming: reverting this change makes the added test
abort with "ASSERT failure in Q_UNREACHABLE(): ... qmeshshape.cpp, line
38" (exit code 134); with the fix, a clean qWarning() and exit code 0.
Change it to report failure via a bool return and have all three call
sites fail gracefully with a qWarning(), matching the existing
validation checks in the same functions.
Adds a regression test exercising both ConvexMeshShape and
TriangleMeshShape with a geometry that has vertex data but no position
attribute (NoPositionGeometry, following the existing examplegeometry.cpp
pattern from the geometry test), asserting the world keeps simulating
instead of crashing. No rendering is involved, so the scene is a plain
Node rather than a View3D.
Pick-to: 6.12 6.11 6.8
Change-Id: I0fea9e7e8b5b0fc6d3ad6745754867d5102abb27
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>