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

GJK infinite loop #111

Open
not-fl3 opened this issue Mar 22, 2019 · 0 comments
Open

GJK infinite loop #111

not-fl3 opened this issue Mar 22, 2019 · 0 comments
Assignees
Labels

Comments

@not-fl3
Copy link
Contributor

not-fl3 commented Mar 22, 2019

Following test is always leading to infinite loop on my machine. Something with max_iterationsin intersection_time_of_impact went wrong I guess?

#[test()]
fn gjk_infinite_loop() {
    use cgmath::*;
    use collision::primitive::{Circle, Primitive2, Rectangle};
    use collision::{algorithm::broad_phase::DbvtBroadPhase, algorithm::minkowski::GJK2};

    let gjk: GJK2<f32> = GJK2::new();

    let rect_transform: Decomposed<Vector2<f32>, Basis2<f32>> = Decomposed {
        disp: Vector2::new(164.1754, -13.967552),
        rot: Rotation2::from_angle(Rad(std::f32::consts::PI / 2.)),
        ..Decomposed::one()
    };

    let start_transform: Decomposed<Vector2<f32>, Basis2<f32>> = Decomposed {
        disp: Vector2::new(158.0754, -5.287695),
        ..Decomposed::one()
    };
    let end_transform: Decomposed<Vector2<f32>, Basis2<f32>> = Decomposed {
        disp: Vector2::new(159.39767, -6.6099815),
        ..Decomposed::one()
    };

    let circle = Circle::new(1.);
    let rect = Rectangle::new(50., 10.);

    let contact = gjk.intersection_time_of_impact(
        &circle,
        &start_transform..&end_transform,
        &rect,
        &rect_transform..&rect_transform,
    );
}
@kvark kvark added the bug label Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants