pub enum ForceField {
Show 17 variants
Gravity {
center: Vec3,
strength: f32,
falloff: Falloff,
},
Flow {
direction: Vec3,
strength: f32,
turbulence: f32,
},
Vortex {
center: Vec3,
axis: Vec3,
strength: f32,
radius: f32,
},
Repulsion {
center: Vec3,
strength: f32,
radius: f32,
},
Electromagnetic {
center: Vec3,
charge: f32,
strength: f32,
},
HeatSource {
center: Vec3,
temperature: f32,
radius: f32,
},
MathField {
center: Vec3,
radius: f32,
function: MathFunction,
target: FieldTarget,
},
StrangeAttractor {
attractor_type: AttractorType,
scale: f32,
strength: f32,
center: Vec3,
},
EntropyField {
center: Vec3,
radius: f32,
strength: f32,
},
Damping {
center: Vec3,
radius: f32,
strength: f32,
},
Pulsing {
center: Vec3,
frequency: f32,
amplitude: f32,
radius: f32,
},
Shockwave {
center: Vec3,
speed: f32,
thickness: f32,
strength: f32,
born_at: f32,
},
Wind {
direction: Vec3,
base_strength: f32,
gust_frequency: f32,
gust_amplitude: f32,
},
Warp {
center: Vec3,
exit: Vec3,
radius: f32,
strength: f32,
},
Tidal {
center: Vec3,
axis: Vec3,
strength: f32,
radius: f32,
},
MagneticDipole {
center: Vec3,
axis: Vec3,
moment: f32,
},
Saddle {
center: Vec3,
strength_x: f32,
strength_y: f32,
},
}Expand description
A spatial force that acts on glyphs within its region of influence.
Variants§
Gravity
Pulls glyphs toward a point, proportional to mass.
Flow
Pushes glyphs in a direction.
Vortex
Spins glyphs around an axis.
Repulsion
Pushes glyphs away from a point.
Electromagnetic
Attracts opposite charges, repels same charges.
HeatSource
Increases temperature (and thus motion) of nearby glyphs.
MathField
Applies a math function to a glyph property in a region.
StrangeAttractor
Strange attractor dynamics pulling glyphs along attractor paths.
EntropyField
Increases entropy (chaos) of glyphs in a region.
Damping
Reduces velocity of glyphs (viscosity).
Pulsing
Oscillating push-pull field.
Shockwave
Shockwave expanding outward from an origin.
Wind
Wind with per-layer turbulence (Perlin-driven).
Warp
Portal-style warp field: pulls toward center, ejects on the other side.
Tidal
Tidal force (stretches along one axis, squishes along others).
MagneticDipole
Magnetic dipole (north + south poles).
Saddle
Saddle point field (hyperbolic potential).
Implementations§
Source§impl ForceField
impl ForceField
Sourcepub fn force_at(&self, pos: Vec3, mass: f32, charge: f32, t: f32) -> Vec3
pub fn force_at(&self, pos: Vec3, mass: f32, charge: f32, t: f32) -> Vec3
Compute the force vector applied to a point at pos with mass,
charge, and world time t.
Sourcepub fn temperature_at(&self, pos: Vec3) -> f32
pub fn temperature_at(&self, pos: Vec3) -> f32
Returns the temperature contribution at pos (for heat fields).
Sourcepub fn entropy_at(&self, pos: Vec3) -> f32
pub fn entropy_at(&self, pos: Vec3) -> f32
Returns the entropy contribution at pos.
Sourcepub fn damping_at(&self, pos: Vec3) -> f32
pub fn damping_at(&self, pos: Vec3) -> f32
Returns the damping multiplier at pos (1.0 = no damping, 0.0 = full stop).
Sourcepub fn is_non_positional(&self) -> bool
pub fn is_non_positional(&self) -> bool
True if this field type is purely visual (no position force).
Trait Implementations§
Source§impl Clone for ForceField
impl Clone for ForceField
Source§fn clone(&self) -> ForceField
fn clone(&self) -> ForceField
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more