pub struct SpatialMessages3D<M> { /* private fields */ }Expand description
3D spatial message list with spatial-hashing neighbor lookup.
Same concept as SpatialMessages2D but for 3D positions.
Mirrors FlameGPU2 MessageSpatial3D and its 3D Partition Boundary Matrix.
Implementations§
Source§impl<M: Clone> SpatialMessages3D<M>
impl<M: Clone> SpatialMessages3D<M>
Sourcepub fn new(radius: f32) -> Result<Self, MessageConfigError>
pub fn new(radius: f32) -> Result<Self, MessageConfigError>
Create a new 3D spatial message list.
Sourcepub fn output(&mut self, message: M, x: f32, y: f32, z: f32)
pub fn output(&mut self, message: M, x: f32, y: f32, z: f32)
Output a message at a 3D position (phase 1).
Sourcepub fn try_output(
&mut self,
message: M,
x: f32,
y: f32,
z: f32,
) -> Result<(), MessagePhaseError>
pub fn try_output( &mut self, message: M, x: f32, y: f32, z: f32, ) -> Result<(), MessagePhaseError>
Try to output a message at a 3D position, returning a typed phase error on misuse.
Sourcepub fn read_nearby(
&self,
x: f32,
y: f32,
z: f32,
radius: f32,
) -> SpatialIter3D<'_, M> ⓘ
pub fn read_nearby( &self, x: f32, y: f32, z: f32, radius: f32, ) -> SpatialIter3D<'_, M> ⓘ
Iterate messages within radius of (x, y, z) (phase 2).
Returns an iterator yielding (message_ref, distance_squared).
§Panics
Panics if called before finalize. Use
try_read_nearby to handle phase errors explicitly.
Sourcepub fn try_read_nearby(
&self,
x: f32,
y: f32,
z: f32,
radius: f32,
) -> Result<SpatialIter3D<'_, M>, MessagePhaseError>
pub fn try_read_nearby( &self, x: f32, y: f32, z: f32, radius: f32, ) -> Result<SpatialIter3D<'_, M>, MessagePhaseError>
Try to iterate messages within radius of (x, y, z) (phase 2).
Sourcepub fn is_finalized(&self) -> bool
pub fn is_finalized(&self) -> bool
Whether the message buffer has been finalized for reading.
Trait Implementations§
Source§impl<M: Clone> Clone for SpatialMessages3D<M>
impl<M: Clone> Clone for SpatialMessages3D<M>
Source§fn clone(&self) -> SpatialMessages3D<M>
fn clone(&self) -> SpatialMessages3D<M>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<M> Freeze for SpatialMessages3D<M>
impl<M> RefUnwindSafe for SpatialMessages3D<M>where
M: RefUnwindSafe,
impl<M> Send for SpatialMessages3D<M>where
M: Send,
impl<M> Sync for SpatialMessages3D<M>where
M: Sync,
impl<M> Unpin for SpatialMessages3D<M>where
M: Unpin,
impl<M> UnsafeUnpin for SpatialMessages3D<M>
impl<M> UnwindSafe for SpatialMessages3D<M>where
M: UnwindSafe,
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