Finds the nearest point on real Jolt collision geometry without changing the physics world.
jolt_closest_point searches managed rigid bodies for the collision surface nearest to a public Z-up world-space position. It returns the existing JoltBody wrapper, the exact target-surface point, an outward world-space normal and the Euclidean point-to-surface distance. For one known body, JoltBody.get_closest_point performs the same narrow-phase measurement without searching the world.
The query uses Jolt 5.6 narrow-phase collision geometry rather than body centres or axis-aligned bounds.
Rotated primitives, Convex, Mesh, HeightField, Compound child transforms, reusable shapes and OffsetCenterOfMassShape are measured against their real surfaces.
For a point inside a solid convex shape, the result is the nearest exit surface selected by Jolt and distance remains positive. A point on the surface returns approximately zero.
At exact symmetry several surface points may be equally valid, so the selected direction should not be used as a stable gameplay identifier.
Mesh and HeightField normals follow authored triangle winding; inside has a useful meaning only for suitably closed and consistently wound meshes.
Equal world-search distances are resolved deterministically by the lower public body handle within a small numeric tolerance.
These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.
World XYZ m; options max_distance>0 if supplied(otherwise unbounded), motion defaults all, include_sensorstrue, layers/mask/ignore. Hit snapshot or hit:false:position, normal, distance, body/body_handle/body_valid/entity, target_sub_shape_id, candidate_count, exact_body_tests, error_code/message.