Fix compute distance crash if no closest point param is defined.

This commit is contained in:
2025-12-16 18:22:26 -06:00
parent b5286af526
commit 4504d0ae96
@@ -2787,7 +2787,8 @@ float PhysicsBackend::ComputeShapeSqrDistanceToPoint(void* shape, const Vector3&
#if USE_LARGE_WORLDS
PxVec3 closestPointPx;
float result = PxGeometryQuery::pointDistance(C2P(point), shapePhysX->getGeometry(), trans, &closestPointPx);
*closestPoint = P2C(closestPointPx);
if (closestPoint)
*closestPoint = P2C(closestPointPx);
return result;
#else
return PxGeometryQuery::pointDistance(C2P(point), shapePhysX->getGeometry(), trans, (PxVec3*)closestPoint);