pub struct GpuParticleLayout;Expand description
Utilities for converting between the SoA ParticleBuffer and an
interleaved flat f32 slice suitable for GPU upload.
Implementations§
Source§impl GpuParticleLayout
impl GpuParticleLayout
Sourcepub fn stride() -> usize
pub fn stride() -> usize
Number of f32 values per particle in the interleaved layout.
Layout: [x, y, z, vx, vy, vz, mass, lifetime]
Sourcepub fn to_f32_buffer(buffer: &ParticleBuffer) -> Vec<f32>
pub fn to_f32_buffer(buffer: &ParticleBuffer) -> Vec<f32>
Produce an interleaved Vecf32` containing all slots (alive and dead).
Sourcepub fn from_f32_buffer(data: &[f32], count: usize) -> ParticleBuffer
pub fn from_f32_buffer(data: &[f32], count: usize) -> ParticleBuffer
Parse an interleaved buffer back into a ParticleBuffer.
count must equal the number of particle slots encoded in data.
Auto Trait Implementations§
impl Freeze for GpuParticleLayout
impl RefUnwindSafe for GpuParticleLayout
impl Send for GpuParticleLayout
impl Sync for GpuParticleLayout
impl Unpin for GpuParticleLayout
impl UnsafeUnpin for GpuParticleLayout
impl UnwindSafe for GpuParticleLayout
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> 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