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

Refactor spatial query APIs to accept config over a struct #442

Open
janhohenheim opened this issue Jul 17, 2024 · 0 comments
Open

Refactor spatial query APIs to accept config over a struct #442

janhohenheim opened this issue Jul 17, 2024 · 0 comments
Labels
A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Usability A quality-of-life improvement that makes Avian easier to use X-Contentious There are nontrivial implications that should be thought through

Comments

@janhohenheim
Copy link
Sponsor Contributor

Context

Quoting @Jondolf:

It could just be something like

pub struct RayCastConfig {
    pub max_time_of_impact: Scalar,
    pub solid: bool,
    // We could split this I guess
    pub filter: SpatialQueryFilter,
}

and people wouldn't need to worry about configuring everything manually since it'd derive Default. In the ideal case, spatial queries can become more concise, like

spatial.cast_ray(origin, direction, default());

instead of

spatial.cast_ray(
    origin,
    direction,
    f32::MAX,
    true,
    default(),
);
@Jondolf Jondolf added A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Usability A quality-of-life improvement that makes Avian easier to use D-Medium A moderate level of difficulty: suitable for simple features or challenging fixes. X-Contentious There are nontrivial implications that should be thought through and removed D-Medium A moderate level of difficulty: suitable for simple features or challenging fixes. labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Spatial-Query Relates to spatial queries, such as ray casting, shape casting, and intersection tests C-Usability A quality-of-life improvement that makes Avian easier to use X-Contentious There are nontrivial implications that should be thought through
Projects
None yet
Development

No branches or pull requests

2 participants