pub(crate) struct RstarSpatialQuery {
layers: Vec<LayerIndex>,
indexed_transforms: Vec<Option<SpatialTransform>>,
}Fields§
§layers: Vec<LayerIndex>§indexed_transforms: Vec<Option<SpatialTransform>>Implementations§
Source§impl RstarSpatialQuery
impl RstarSpatialQuery
pub(crate) fn build( scene: &StaticSpatialScene, actors: &[SpatialActor], ) -> Result<Self, SpatialQueryError>
fn layer(&self, layer: SpatialLayerId) -> Option<&LayerIndex>
fn layer_mut(&mut self, layer: SpatialLayerId) -> Option<&mut LayerIndex>
Trait Implementations§
Source§impl Debug for RstarSpatialQuery
impl Debug for RstarSpatialQuery
Source§impl SpatialQuery for RstarSpatialQuery
impl SpatialQuery for RstarSpatialQuery
Source§fn candidates_on_layer(&self, layer: SpatialLayerId) -> Vec<EnemyIdx>
fn candidates_on_layer(&self, layer: SpatialLayerId) -> Vec<EnemyIdx>
Sorted, deduplicated broad-phase actor IDs on one spatial layer.
fn candidates_in_envelope( &self, layer: SpatialLayerId, envelope: SpatialEnvelope, ) -> Vec<EnemyIdx>
fn actors_in_radius( &self, query: RadiusQuery, allowed: Option<&[EnemyIdx]>, ) -> Vec<EnemyIdx>
fn actors_in_cone( &self, query: ConeQuery, allowed: Option<&[EnemyIdx]>, ) -> Vec<EnemyIdx>
Source§fn actors_by_distance(
&self,
layer: SpatialLayerId,
origin: Position2,
allowed: Option<&[EnemyIdx]>,
) -> Vec<EnemyIdx>
fn actors_by_distance( &self, layer: SpatialLayerId, origin: Position2, allowed: Option<&[EnemyIdx]>, ) -> Vec<EnemyIdx>
Active actors ordered by increasing distance, then ascending actor ID.
Source§fn nearest_actor_matching(
&self,
layer: SpatialLayerId,
origin: Position2,
is_eligible: &mut dyn FnMut(EnemyIdx) -> bool,
) -> Option<EnemyIdx>
fn nearest_actor_matching( &self, layer: SpatialLayerId, origin: Position2, is_eligible: &mut dyn FnMut(EnemyIdx) -> bool, ) -> Option<EnemyIdx>
Return the nearest actor accepted by
is_eligible without materializing the layer (increasing-distance then ascending actor-ID order).Source§fn segment_visible(
&self,
layer: SpatialLayerId,
start: Position2,
end: Position2,
) -> bool
fn segment_visible( &self, layer: SpatialLayerId, start: Position2, end: Position2, ) -> bool
Whether a same-layer closed segment is unobstructed by static geometry.
Source§fn validate_transform(
&self,
transform: SpatialTransform,
) -> Result<(), SpatialQueryError>
fn validate_transform( &self, transform: SpatialTransform, ) -> Result<(), SpatialQueryError>
Validates that a transform can be represented by this index. Read more
Source§fn insert_actor(&mut self, actor: SpatialActor) -> Result<(), SpatialQueryError>
fn insert_actor(&mut self, actor: SpatialActor) -> Result<(), SpatialQueryError>
Adds an actor to the index. Read more
Source§fn remove_actor(&mut self, actor: SpatialActor) -> Result<(), SpatialQueryError>
fn remove_actor(&mut self, actor: SpatialActor) -> Result<(), SpatialQueryError>
Removes an actor from the index. Read more
Source§fn relocate_actor(
&mut self,
actor: EnemyIdx,
from: SpatialTransform,
to: SpatialTransform,
) -> Result<(), SpatialQueryError>
fn relocate_actor( &mut self, actor: EnemyIdx, from: SpatialTransform, to: SpatialTransform, ) -> Result<(), SpatialQueryError>
Moves an indexed actor between validated transforms. Read more
Source§impl SpatialQueryDiagnostics for RstarSpatialQuery
impl SpatialQueryDiagnostics for RstarSpatialQuery
Source§fn diagnose_actors_in_radius(
&self,
query: RadiusQuery,
allowed: Option<&[EnemyIdx]>,
) -> SpatialQueryObservation<Vec<EnemyIdx>>
fn diagnose_actors_in_radius( &self, query: RadiusQuery, allowed: Option<&[EnemyIdx]>, ) -> SpatialQueryObservation<Vec<EnemyIdx>>
Run a radius query and report its broad-phase candidate count.
Source§fn diagnose_actors_in_cone(
&self,
query: ConeQuery,
allowed: Option<&[EnemyIdx]>,
) -> SpatialQueryObservation<Vec<EnemyIdx>>
fn diagnose_actors_in_cone( &self, query: ConeQuery, allowed: Option<&[EnemyIdx]>, ) -> SpatialQueryObservation<Vec<EnemyIdx>>
Run a cone query and report its broad-phase candidate count.
Source§fn diagnose_segment_contacts(
&self,
layer: SpatialLayerId,
start: Position2,
end: Position2,
) -> SpatialQueryObservation<Vec<usize>>
fn diagnose_segment_contacts( &self, layer: SpatialLayerId, start: Position2, end: Position2, ) -> SpatialQueryObservation<Vec<usize>>
Return sorted blocker-edge IDs touching a segment and the broad-phase candidate count.
Auto Trait Implementations§
impl Freeze for RstarSpatialQuery
impl RefUnwindSafe for RstarSpatialQuery
impl Send for RstarSpatialQuery
impl Sync for RstarSpatialQuery
impl Unpin for RstarSpatialQuery
impl UnsafeUnpin for RstarSpatialQuery
impl UnwindSafe for RstarSpatialQuery
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