Skip to content

Sweep question: Odd behavior and passing through colliders #346

Answered by RossNordby
BlueCyro asked this question in Q&A
Discussion options

You must be logged in to vote

Yup, there is indeed no guarantee of order reported by the hit handler. As an implementation detail, the acceleration structure visits nodes based on which node bounding box is hit first by the ray/sweep, but there's no guarantee that hitting an object's bounding box first will imply that the object's actual geometry will be hit first (or at all).

The hit handler is meant to be a minimal and direct report, so more complex queries like "a sorted list of impacts up until a maximum T value" would require postprocessing of the collected hits. That's not done by default because, while it is cheap, it's still a nonzero cost and not required by many common use cases.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@BlueCyro
Comment options

@RossNordby
Comment options

@BlueCyro
Comment options

Answer selected by BlueCyro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants