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

query::contact false-negative between 2d Ball and Cuboid? #34

Closed
acshi opened this issue Jun 2, 2021 · 1 comment · Fixed by #35
Closed

query::contact false-negative between 2d Ball and Cuboid? #34

acshi opened this issue Jun 2, 2021 · 1 comment · Fixed by #35
Labels
bug Something isn't working

Comments

@acshi
Copy link

acshi commented Jun 2, 2021

Since parry2d doesn't have much documentation yet, I found this example from ncollide: https://www.ncollide.org/geometric_queries/#contact

However, in parry, it doesn't find any collision, and we get Ok(None). Am I misunderstanding some difference between ncollide and parry here?

#[test]
fn test_contact_example() {
    let contact = query::contact(
        &Isometry::translation(1.0, 1.0),
        &Ball::new(1.0),
        &Isometry::identity(),
        &Cuboid::new(Vector2::new(1.0, 1.0)),
        1.0,
    )
    .unwrap()
    .unwrap();

    assert!(contact.dist < 0.0);
}
@sebcrozet sebcrozet added the bug Something isn't working label Jun 4, 2021
@sebcrozet
Copy link
Member

Hi! This looks like a bug with the special case where one of the cuboid's corner lies exactly on the ball's center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants