pub struct SimulationConfig {Show 22 fields
pub num_particles: u32,
pub num_types: u32,
pub force_factor: f32,
pub friction: f32,
pub repel_strength: f32,
pub max_velocity: f32,
pub boundary_mode: BoundaryMode,
pub wall_repel_strength: f32,
pub mirror_wrap_count: u32,
pub world_size: Vec2,
pub enable_3d: bool,
pub depth_limit: f32,
pub particle_size: f32,
pub enable_glow: bool,
pub glow_intensity: f32,
pub glow_size: f32,
pub glow_steepness: f32,
pub use_spatial_hash: bool,
pub spatial_hash_cell_size: f32,
pub max_bin_density: f32,
pub neighbor_budget: u32,
pub background_color: [f32; 3],
}Expand description
Configuration for the particle life simulation.
Fields§
§num_particles: u32Number of particles in the simulation (16 - 1,048,576).
num_types: u32Number of particle types/species (1 - 16).
force_factor: f32Force scaling factor (0.1 - 10.0). Higher values reduce force magnitude.
friction: f32Friction coefficient (0.0 - 1.0). Applied each frame to slow particles.
repel_strength: f32Repulsion strength at close range (0.01 - 4.0).
max_velocity: f32Maximum velocity magnitude. Particles are clamped to this speed.
boundary_mode: BoundaryModeBoundary handling mode.
wall_repel_strength: f32Wall repulsion strength for Repel boundary mode (0.0 - 100.0).
mirror_wrap_count: u32Number of mirror copies for MirrorWrap mode (5 or 9).
world_size: Vec2World size in pixels.
enable_3d: boolEnable 3D simulation with depth.
depth_limit: f32Maximum depth for 3D mode.
particle_size: f32Particle render size in pixels.
enable_glow: boolEnable glow effect on particles.
glow_intensity: f32Glow effect intensity (0.0 - 2.0).
glow_size: f32Glow effect size multiplier.
glow_steepness: f32Glow falloff steepness (1.0 - 4.0). Higher = sharper edge.
use_spatial_hash: boolUse spatial hashing for force calculation optimization.
spatial_hash_cell_size: f32Spatial hash cell size. Should be >= max interaction radius.
max_bin_density: f32Maximum number of particles in a single bin before force scaling occurs.
neighbor_budget: u32Maximum neighbors to check per particle (0 = unlimited). Setting a budget prevents slowdown when particles cluster heavily.
background_color: [f32; 3]Background color [r, g, b] in 0.0-1.0 range.
Implementations§
Trait Implementations§
Source§impl Clone for SimulationConfig
impl Clone for SimulationConfig
Source§fn clone(&self) -> SimulationConfig
fn clone(&self) -> SimulationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SimulationConfig
impl Debug for SimulationConfig
Source§impl Default for SimulationConfig
impl Default for SimulationConfig
Source§impl<'de> Deserialize<'de> for SimulationConfig
impl<'de> Deserialize<'de> for SimulationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SimulationConfig
impl RefUnwindSafe for SimulationConfig
impl Send for SimulationConfig
impl Sync for SimulationConfig
impl Unpin for SimulationConfig
impl UnwindSafe for SimulationConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().