#[non_exhaustive]pub struct RayFilter {
pub layer_mask: u32,
pub exclude_body: Option<usize>,
pub include_sensors: bool,
pub include_static: bool,
pub include_sdf: bool,
pub sdf: SdfCcdConfig,
}Expand description
Which colliders a ray query sees.
The default sees every body on any layer except sensors, every static collider
and every SDF collider. A body is seen when layer_mask & body_filter.layer != 0
(PhysicsWorld::body_filter); an SDF collider attached to a body is seen only
when that body is.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.layer_mask: u32Layers the ray sees (bitmask against CollisionFilter::layer).
exclude_body: Option<usize>A body the ray ignores (typically the one carrying the sensor).
include_sensors: boolWhether sensor bodies are seen.
include_static: boolWhether static colliders are seen.
include_sdf: boolWhether SDF colliders are seen.
sdf: SdfCcdConfigSphere-tracing settings for SDF colliders.
Implementations§
Source§impl RayFilter
impl RayFilter
Sourcepub const fn with_layer_mask(self, mask: u32) -> Self
pub const fn with_layer_mask(self, mask: u32) -> Self
Only bodies on these layers.
Sourcepub const fn excluding_body(self, body: usize) -> Self
pub const fn excluding_body(self, body: usize) -> Self
Ignore this body (and any SDF collider attached to it).
Sourcepub const fn with_sensors(self, include: bool) -> Self
pub const fn with_sensors(self, include: bool) -> Self
Whether sensor bodies are seen.
Sourcepub const fn with_static(self, include: bool) -> Self
pub const fn with_static(self, include: bool) -> Self
Whether static colliders are seen.
Sourcepub const fn with_sdf_config(self, config: SdfCcdConfig) -> Self
pub const fn with_sdf_config(self, config: SdfCcdConfig) -> Self
Sphere-tracing settings for SDF colliders.
Trait Implementations§
impl Copy for RayFilter
impl StructuralPartialEq for RayFilter
Auto Trait Implementations§
impl Freeze for RayFilter
impl RefUnwindSafe for RayFilter
impl Send for RayFilter
impl Sync for RayFilter
impl Unpin for RayFilter
impl UnsafeUnpin for RayFilter
impl UnwindSafe for RayFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more