Struct ark_api::world::SpatialQueryRequestBuilder
source · pub struct SpatialQueryRequestBuilder { /* private fields */ }Expand description
Use to build a SpatialQueryRequest using an ergonomic interface with sensible defaults.
Implementations§
source§impl SpatialQueryRequestBuilder
impl SpatialQueryRequestBuilder
sourcepub fn raycast(ray: Ray3, range: Range<f32>) -> Self
pub fn raycast(ray: Ray3, range: Range<f32>) -> Self
Builds a world space raycast request with the minimum and maximum distance along the ray.
By default only the first hit is returned (can be changed with Self::with_max_hits).
sourcepub fn spherecast(ray: Ray3, range: Range<f32>, radius: f32) -> Self
pub fn spherecast(ray: Ray3, range: Range<f32>, radius: f32) -> Self
Sweep a sphere along a ray. Like a “thick” raycast.
Spherecasts can currently only be performed on the physical world.
sourcepub fn with_max_hits(&mut self, max_hits: usize) -> &mut Self
pub fn with_max_hits(&mut self, max_hits: usize) -> &mut Self
Max number of hits that we want to receive.
sourcepub fn with_layer_mask(&mut self, layer_mask: EntityLayerMask) -> &mut Self
pub fn with_layer_mask(&mut self, layer_mask: EntityLayerMask) -> &mut Self
Which layers we can hit.
sourcepub fn with_ignore_entity(&mut self, entity: Entity) -> &mut Self
pub fn with_ignore_entity(&mut self, entity: Entity) -> &mut Self
Ignore hits with this entity. If you want to ignore several entities you ewill have to use a layer mask instead.
sourcepub fn with_options(&mut self, options: SpatialQueryOptions) -> &mut Self
pub fn with_options(&mut self, options: SpatialQueryOptions) -> &mut Self
Add options to the spatial query.
sourcepub fn build(&self) -> SpatialQueryRequest
pub fn build(&self) -> SpatialQueryRequest
Builds a SpatialQueryRequest.
Methods from Deref<Target = SpatialQueryRequest>§
sourcepub fn as_message(&self, request_id: u64, hits_data_ptr: u32) -> Message
pub fn as_message(&self, request_id: u64, hits_data_ptr: u32) -> Message
Converts this SpatialQueryRequest to the corresponding ffi message struct.
Trait Implementations§
source§impl Clone for SpatialQueryRequestBuilder
impl Clone for SpatialQueryRequestBuilder
source§fn clone(&self) -> SpatialQueryRequestBuilder
fn clone(&self) -> SpatialQueryRequestBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Deref for SpatialQueryRequestBuilder
impl Deref for SpatialQueryRequestBuilder
impl Copy for SpatialQueryRequestBuilder
Auto Trait Implementations§
impl RefUnwindSafe for SpatialQueryRequestBuilder
impl Send for SpatialQueryRequestBuilder
impl Sync for SpatialQueryRequestBuilder
impl Unpin for SpatialQueryRequestBuilder
impl UnwindSafe for SpatialQueryRequestBuilder
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