Skip to main content

RstarSpatialQuery

Struct RstarSpatialQuery 

Source
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

Source

pub(crate) fn build( scene: &StaticSpatialScene, actors: &[SpatialActor], ) -> Result<Self, SpatialQueryError>

Source

fn layer(&self, layer: SpatialLayerId) -> Option<&LayerIndex>

Source

fn layer_mut(&mut self, layer: SpatialLayerId) -> Option<&mut LayerIndex>

Trait Implementations§

Source§

impl Debug for RstarSpatialQuery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SpatialQuery for RstarSpatialQuery

Source§

fn candidates_on_layer(&self, layer: SpatialLayerId) -> Vec<EnemyIdx>

Sorted, deduplicated broad-phase actor IDs on one spatial layer.
Source§

fn candidates_in_envelope( &self, layer: SpatialLayerId, envelope: SpatialEnvelope, ) -> Vec<EnemyIdx>

Source§

fn actors_in_radius( &self, query: RadiusQuery, allowed: Option<&[EnemyIdx]>, ) -> Vec<EnemyIdx>

Source§

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>

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>

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

Whether a same-layer closed segment is unobstructed by static geometry.
Source§

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>

Adds an actor to the index. Read more
Source§

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>

Moves an indexed actor between validated transforms. Read more
Source§

impl SpatialQueryDiagnostics for RstarSpatialQuery

Source§

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>>

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>>

Return sorted blocker-edge IDs touching a segment and the broad-phase candidate count.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SpecConfig for T
where T: Any + Debug + Send,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<T> ResolverSyncBound for T
where T: Sync + ?Sized,