Skip to content

Pass the best-so-far distance to project_point's primitive_check - #439

Open
marknefedov wants to merge 1 commit into
dimforge:masterfrom
marknefedov:bvh-project-point-best-so-far
Open

Pass the best-so-far distance to project_point's primitive_check#439
marknefedov wants to merge 1 commit into
dimforge:masterfrom
marknefedov:bvh-project-point-best-so-far

Conversation

@marknefedov

@marknefedov marknefedov commented Aug 14, 2026

Copy link
Copy Markdown

Bvh::project_point and project_point_and_get_feature document the Real argument of primitive_check as the distance to the closest point found so far, but both pass the original max_distance. This disables leaf-level pruning for any callback that follows the documentation.

The best-so-far value from find_best is now passed through. cast_ray in the same module already does this. Conforming callbacks return the same winner; callbacks that prune against the argument prune earlier. Current in-tree callers ignore the argument, so there is no behavior change inside parry.

Bvh::project_point and project_point_and_get_feature document that the
Real argument given to primitive_check is the distance to the closest
point found so far, but both passed the original max_distance instead.
This matches the code to the documented contract, which also lets
expensive primitive checks prune against the current best. Conforming
callbacks return the same winner; cast_ray in the same module already
follows this pattern.
@marknefedov
marknefedov marked this pull request as ready for review August 14, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant