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 moreAuto Trait Implementations§
impl Freeze for ForceField
impl RefUnwindSafe for ForceField
impl Send for ForceField
impl Sync for ForceField
impl Unpin for ForceField
impl UnsafeUnpin for ForceField
impl UnwindSafe for ForceField
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.