pub struct ForceFieldInstance {
pub field: ForceField,
pub affected_bodies: Option<Vec<usize>>,
pub enabled: bool,
}Expand description
A force field with optional body filter
Fields§
§field: ForceFieldThe force field definition
affected_bodies: Option<Vec<usize>>If Some, only affects bodies in this list. If None, affects all bodies.
enabled: boolWhether this field is active
Implementations§
Source§impl ForceFieldInstance
impl ForceFieldInstance
Sourcepub const fn new(field: ForceField) -> Self
pub const fn new(field: ForceField) -> Self
Create a new force field instance affecting all bodies
Sourcepub fn with_affected_bodies(self, bodies: Vec<usize>) -> Self
pub fn with_affected_bodies(self, bodies: Vec<usize>) -> Self
Restrict this field to only affect specific bodies
Trait Implementations§
Source§impl Clone for ForceFieldInstance
impl Clone for ForceFieldInstance
Auto Trait Implementations§
impl Freeze for ForceFieldInstance
impl RefUnwindSafe for ForceFieldInstance
impl Send for ForceFieldInstance
impl Sync for ForceFieldInstance
impl Unpin for ForceFieldInstance
impl UnsafeUnpin for ForceFieldInstance
impl UnwindSafe for ForceFieldInstance
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> 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> ⓘ
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