pub enum ForceField {
Directional {
direction: Vec3Fix,
strength: Fix128,
},
Point {
center: Vec3Fix,
strength: Fix128,
repulsive: bool,
max_force: Fix128,
},
Drag {
coefficient: Fix128,
},
Buoyancy {
surface_y: Fix128,
density: Fix128,
drag: Fix128,
},
Vortex {
center: Vec3Fix,
axis: Vec3Fix,
strength: Fix128,
falloff_radius: Fix128,
},
Explosion {
center: Vec3Fix,
strength: Fix128,
radius: Fix128,
falloff_power: Fix128,
},
Magnetic {
position: Vec3Fix,
moment: Vec3Fix,
strength: Fix128,
},
}Expand description
Force field type
Variants§
Directional
Constant directional force (e.g., wind)
Point
Point attractor/repulsor (gravity well)
Fields
Drag
Linear drag (velocity-proportional resistance)
Buoyancy
Buoyancy (upward force below a surface level)
Fields
Vortex
Vortex (rotational force around an axis)
Fields
Explosion
Explosion (radial impulse with distance falloff)
Force: strength * (1 - dist/radius)^falloff_power directed away
from center. Zero force beyond radius.
Fields
Magnetic
Magnetic dipole field approximation
Simplified dipole model: F = -strength / r^3 * (r_hat . m_hat) * m_hat,
with r_hat pointing from position to the body. The force lies along
the dipole axis (moment); for a positive strength a body on the axis
is pulled toward the dipole from either side, and the force vanishes in
the equatorial plane. Only the direction of moment is used.
Trait Implementations§
Source§impl Clone for ForceField
impl Clone for ForceField
impl Copy for ForceField
Source§impl Debug for ForceField
impl Debug for ForceField
impl Eq for ForceField
Source§impl PartialEq for ForceField
impl PartialEq for ForceField
impl StructuralPartialEq for ForceField
Auto 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> 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 more