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

Rename raycasting and shapecasting methods in SpatialQuery #269

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/plugins/spatial_query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
//! in the [`RayHits`] component every frame. It uses local coordinates, so it will automatically follow the entity
//! it's attached to or its parent.
//! 2. When you need more control or don't want to cast every frame, use the raycasting methods provided by
//! [`SpatialQuery`], like [`cast_ray`](SpatialQuery::cast_ray), [`ray_hits`](SpatialQuery::ray_hits) or
//! [`ray_hits_callback`](SpatialQuery::ray_hits_callback).
//! [`SpatialQuery`], like [`raycast`](SpatialQuery::raycast), [`raycast_many`](SpatialQuery::raycast_many) or
//! [`raycast_callback`](SpatialQuery::raycast_callback).
//!
//! See the documentation of the components and methods for more information.
//!
Expand Down Expand Up @@ -80,8 +80,8 @@
//! in the [`ShapeHits`] component every frame. It uses local coordinates, so it will automatically follow the entity
//! it's attached to or its parent.
//! 2. When you need more control or don't want to cast every frame, use the shapecasting methods provided by
//! [`SpatialQuery`], like [`cast_shape`](SpatialQuery::cast_shape), [`shape_hits`](SpatialQuery::shape_hits) or
//! [`shape_hits_callback`](SpatialQuery::shape_hits_callback).
//! [`SpatialQuery`], like [`shapecast`](SpatialQuery::shapecast), [`shapecast_many`](SpatialQuery::shapecast_many) or
//! [`shapecast_callback`](SpatialQuery::shapecast_callback).
//!
//! See the documentation of the components and methods for more information.
//!
Expand Down
28 changes: 14 additions & 14 deletions src/plugins/spatial_query/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ impl SpatialQueryPipeline {
/// Otherwise, the collider will be treated as hollow, and the hit point will be at the collider's boundary.
/// - `query_filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
///
/// See also: [`SpatialQuery::cast_ray`]
pub fn cast_ray(
/// See also: [`SpatialQuery::raycast`]
pub fn raycast(
&self,
origin: Vector,
direction: Vector,
Expand Down Expand Up @@ -187,8 +187,8 @@ impl SpatialQueryPipeline {
/// Otherwise, the collider will be treated as hollow, and the hit point will be at the collider's boundary.
/// - `query_filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
///
/// See also: [`SpatialQuery::ray_hits`]
pub fn ray_hits(
/// See also: [`SpatialQuery::raycast_many`]
pub fn raycast_many(
&self,
origin: Vector,
direction: Vector,
Expand All @@ -198,7 +198,7 @@ impl SpatialQueryPipeline {
query_filter: SpatialQueryFilter,
) -> Vec<RayHitData> {
let mut hits = Vec::with_capacity(10);
self.ray_hits_callback(
self.raycast_callback(
origin,
direction,
max_time_of_impact,
Expand Down Expand Up @@ -227,8 +227,8 @@ impl SpatialQueryPipeline {
/// - `query_filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
/// - `callback`: A callback function called for each hit.
///
/// See also: [`SpatialQuery::ray_hits_callback`]
pub fn ray_hits_callback(
/// See also: [`SpatialQuery::raycast_callback`]
pub fn raycast_callback(
&self,
origin: Vector,
direction: Vector,
Expand Down Expand Up @@ -286,9 +286,9 @@ impl SpatialQueryPipeline {
/// hit will be returned.
/// - `query_filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
///
/// See also: [`SpatialQuery::cast_shape`]
/// See also: [`SpatialQuery::shapecast`]
#[allow(clippy::too_many_arguments)]
pub fn cast_shape(
pub fn shapecast(
&self,
shape: &Collider,
origin: Vector,
Expand Down Expand Up @@ -350,9 +350,9 @@ impl SpatialQueryPipeline {
/// - `query_filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
/// - `callback`: A callback function called for each hit.
///
/// See also: [`SpatialQuery::shape_hits`]
/// See also: [`SpatialQuery::shapecast_many`]
#[allow(clippy::too_many_arguments)]
pub fn shape_hits(
pub fn shapecast_many(
&self,
shape: &Collider,
origin: Vector,
Expand All @@ -364,7 +364,7 @@ impl SpatialQueryPipeline {
query_filter: SpatialQueryFilter,
) -> Vec<ShapeHitData> {
let mut hits = Vec::with_capacity(10);
self.shape_hits_callback(
self.shapecast_callback(
shape,
origin,
shape_rotation,
Expand Down Expand Up @@ -397,9 +397,9 @@ impl SpatialQueryPipeline {
/// - `query_filter`: A [`SpatialQueryFilter`] that determines which colliders are taken into account in the query.
/// - `callback`: A callback function called for each hit.
///
/// See also: [`SpatialQuery::shape_hits_callback`]
/// See also: [`SpatialQuery::shapecast_callback`]
#[allow(clippy::too_many_arguments)]
pub fn shape_hits_callback(
pub fn shapecast_callback(
&self,
shape: &Collider,
origin: Vector,
Expand Down
Loading