pub struct DistanceConstraint {
pub i: usize,
pub j: usize,
pub rest_length: Real,
pub compliance: Real,
/* private fields */
}Expand description
XPBD distance constraint between two particles.
Maintains a rest length with optional compliance (softness).
Fields§
§i: usizeIndex of the first particle.
j: usizeIndex of the second particle.
rest_length: RealRest length.
compliance: RealCompliance (inverse stiffness). 0 = perfectly rigid.
Implementations§
Source§impl DistanceConstraint
impl DistanceConstraint
Sourcepub fn new(i: usize, j: usize, rest_length: Real, compliance: Real) -> Self
pub fn new(i: usize, j: usize, rest_length: Real, compliance: Real) -> Self
Create a new distance constraint.
Sourcepub fn from_particles(
i: usize,
j: usize,
particles: &[SoftParticle],
compliance: Real,
) -> Self
pub fn from_particles( i: usize, j: usize, particles: &[SoftParticle], compliance: Real, ) -> Self
Build a constraint whose rest length is the current distance between the two particles.
Sourcepub fn reset_lambda(&mut self)
pub fn reset_lambda(&mut self)
Reset the Lagrange multiplier (call before a new solver iteration sequence).
Trait Implementations§
Source§impl Clone for DistanceConstraint
impl Clone for DistanceConstraint
Source§fn clone(&self) -> DistanceConstraint
fn clone(&self) -> DistanceConstraint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DistanceConstraint
impl Debug for DistanceConstraint
Source§impl SoftConstraint for DistanceConstraint
impl SoftConstraint for DistanceConstraint
Auto Trait Implementations§
impl Freeze for DistanceConstraint
impl RefUnwindSafe for DistanceConstraint
impl Send for DistanceConstraint
impl Sync for DistanceConstraint
impl Unpin for DistanceConstraint
impl UnsafeUnpin for DistanceConstraint
impl UnwindSafe for DistanceConstraint
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.