pub struct SoAPositions {
pub x: Vec<f32>,
pub y: Vec<f32>,
pub z: Vec<f32>,
pub capacity: usize,
}Expand description
Struct-of-Arrays pattern for better cache locality
Fields§
§x: Vec<f32>X coordinates
y: Vec<f32>Y coordinates
z: Vec<f32>Z coordinates
capacity: usizeCapacity
Implementations§
Source§impl SoAPositions
impl SoAPositions
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create new SoA position array
Sourcepub fn push(&mut self, pos: Position3D)
pub fn push(&mut self, pos: Position3D)
Add position
Sourcepub fn get(&self, index: usize) -> Option<Position3D>
pub fn get(&self, index: usize) -> Option<Position3D>
Get position by index
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SoAPositions
impl RefUnwindSafe for SoAPositions
impl Send for SoAPositions
impl Sync for SoAPositions
impl Unpin for SoAPositions
impl UnsafeUnpin for SoAPositions
impl UnwindSafe for SoAPositions
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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