Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShapeCastHit has no details on ShapeCastStatus::Converged #511

Open
flash-freezing-lava opened this issue May 17, 2024 · 1 comment
Open
Labels
A-Integration very bevy specific C-Bug Something isn't working D-Medium P-High arbitrary important item S-not-started Work has not started

Comments

@flash-freezing-lava
Copy link

Problem

I have panics in a game, because RapierContext::cast_shape returns an object

ShapeCastHit {
    time_of_impact: 2.4042375,
    details: None,
    status: Converged,
}

According to the docs of ShapeCastHit.details, details should be None if PenetratingOrWithinTargetDist and !compute_impact_geometry_on_penetration, so I expected details to be Some for an object with status Converged.

Solution attempt

The condition in

let details = if !details_always_computed
&& hit.status != ShapeCastStatus::PenetratingOrWithinTargetDist

seems to be the issue.
details_always_computed was given compute_impact_geometry_on_penetration,
so it is not possible to get the details at all if PenetratingOrWithinTargetDist,
and compute_impact_geometry_on_penetration does only influence the behavior if status != PenetratingOrWithinTargetDist.
To have the documented behavior, I think this condition should be

let details = if details_always_computed
    || hit.status != ShapeCastStatus::PenetratingOrWithinTargetDist
@Vrixyz Vrixyz added C-Bug Something isn't working D-Medium P-High arbitrary important item S-not-started Work has not started A-Integration very bevy specific labels May 21, 2024
@kirilllysenko
Copy link
Contributor

I created PR #521 for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Integration very bevy specific C-Bug Something isn't working D-Medium P-High arbitrary important item S-not-started Work has not started
Projects
None yet
Development

No branches or pull requests

3 participants