Skip to main content

closest_point

Function closest_point 

Source
pub fn closest_point(
    mesh: &Mesh,
    bvh: &Bvh,
    p: [f32; 3],
    opts: &ClosestOptions,
) -> Result<Option<ClosestHit>>
Expand description

The point of the mesh nearest to p within opts.max_distance, or None when the mesh has no triangle that close. Equal distances go to the smallest triangle id. Triangles with zero area take part, as their edges.

ยงErrors

QueryError::InvalidInput for a non-finite p, or a max_distance that is negative or NaN; then QueryError::MeshMismatch or QueryError::StaleBvh when bvh does not match the current mesh.