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

time_of_impact query no longer has threshold distance #26

Open
rishflab opened this issue Apr 18, 2021 · 1 comment
Open

time_of_impact query no longer has threshold distance #26

rishflab opened this issue Apr 18, 2021 · 1 comment

Comments

@rishflab
Copy link

rishflab commented Apr 18, 2021

The comment for the time_of_impact query suggests the existence of a threshold distance but this has been removed since release 0.3. The old API was useful to me but I guess I can just shift pos2 by the threshold distance? Is there any chance of getting the old API back?

/// Computes the smallest time when two shapes under translational movement are separated by a
/// distance smaller or equal to `distance`.
///
/// Returns `0.0` if the objects are touching or penetrating.
pub fn time_of_impact(
    pos1: &Isometry<Real>,
    vel1: &Vector<Real>,
    g1: &dyn Shape,
    pos2: &Isometry<Real>,
    vel2: &Vector<Real>,
    g2: &dyn Shape,
    max_toi: Real,
) -> Result<Option<TOI>, Unsupported> {
    let pos12 = pos1.inv_mul(pos2);
    let vel12 = pos1.inverse_transform_vector(&(vel2 - vel1));
    DefaultQueryDispatcher.time_of_impact(&pos12, &vel12, g1, g2, max_toi)
}
@sebcrozet
Copy link
Member

Hi! There is no immediate plane to re-add the threshold distance because its implementation was actually buggy and computationally expensive.

But let's keep this issue open so that we revisit this in the future if this becomes more feasible after some of the upcoming algorithmic change.

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

No branches or pull requests

2 participants