pub struct ParticleStats {
pub active: usize,
pub min_pos: [f32; 3],
pub max_pos: [f32; 3],
pub avg_speed: f32,
pub total_kinetic_energy: f32,
}Expand description
Summary statistics computed from a ParticleBuffer.
Fields§
§active: usizeNumber of alive particles.
min_pos: [f32; 3]Minimum position across all alive particles.
max_pos: [f32; 3]Maximum position across all alive particles.
avg_speed: f32Mean speed of all alive particles.
total_kinetic_energy: f32Total ½mv² kinetic energy.
Implementations§
Source§impl ParticleStats
impl ParticleStats
Sourcepub fn compute(buffer: &ParticleBuffer) -> Self
pub fn compute(buffer: &ParticleBuffer) -> Self
Compute statistics from the given buffer.
Trait Implementations§
Source§impl Clone for ParticleStats
impl Clone for ParticleStats
Source§fn clone(&self) -> ParticleStats
fn clone(&self) -> ParticleStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Freeze for ParticleStats
impl RefUnwindSafe for ParticleStats
impl Send for ParticleStats
impl Sync for ParticleStats
impl Unpin for ParticleStats
impl UnsafeUnpin for ParticleStats
impl UnwindSafe for ParticleStats
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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