pub struct ParticleRepulsion {
pub strength: f32,
pub radius: f32,
}Expand description
Simple pairwise repulsion between particles.
Fields§
§strength: f32Repulsion strength.
radius: f32Interaction radius.
Implementations§
Source§impl ParticleRepulsion
impl ParticleRepulsion
Sourcepub fn apply(&self, buffer: &mut ParticleBuffer, dt: f32)
pub fn apply(&self, buffer: &mut ParticleBuffer, dt: f32)
Apply pairwise repulsion between all alive particles.
This is O(n^2) and suitable only for small particle counts.
Auto Trait Implementations§
impl Freeze for ParticleRepulsion
impl RefUnwindSafe for ParticleRepulsion
impl Send for ParticleRepulsion
impl Sync for ParticleRepulsion
impl Unpin for ParticleRepulsion
impl UnsafeUnpin for ParticleRepulsion
impl UnwindSafe for ParticleRepulsion
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