pub struct MassConstraintSystem<N>{ /* private fields */ }Expand description
A deformable surface using a mass-LengthConstraint model with triangular elements.
Implementations§
Source§impl<N> MassConstraintSystem<N>
impl<N> MassConstraintSystem<N>
Sourcepub fn from_polyline(
polyline: &Polyline<N>,
mass: N,
stiffness: Option<N>,
) -> MassConstraintSystem<N>
pub fn from_polyline( polyline: &Polyline<N>, mass: N, stiffness: Option<N>, ) -> MassConstraintSystem<N>
Builds a mass-spring system from a polyline.
Sourcepub fn user_data(&self) -> Option<&(dyn Any + Send + Sync + 'static)>
pub fn user_data(&self) -> Option<&(dyn Any + Send + Sync + 'static)>
Retrieves a reference to the user-defined user-data attached to this object.
Sourcepub fn user_data_mut(
&mut self,
) -> Option<&mut (dyn Any + Send + Sync + 'static)>
pub fn user_data_mut( &mut self, ) -> Option<&mut (dyn Any + Send + Sync + 'static)>
Retrieves a mutable reference to the user-defined user-data attached to this object.
Sourcepub fn set_user_data(
&mut self,
data: Option<Box<dyn Any + Send + Sync>>,
) -> Option<Box<dyn Any + Send + Sync>>
pub fn set_user_data( &mut self, data: Option<Box<dyn Any + Send + Sync>>, ) -> Option<Box<dyn Any + Send + Sync>>
Sets the user-defined data attached to this object.
Sourcepub fn take_user_data(&mut self) -> Option<Box<dyn Any + Send + Sync>>
pub fn take_user_data(&mut self) -> Option<Box<dyn Any + Send + Sync>>
Replace by None the user-defined data attached to this object and returns the old value.
Sourcepub fn add_constraint(
&mut self,
node1: usize,
node2: usize,
stiffness: Option<N>,
)
pub fn add_constraint( &mut self, node1: usize, node2: usize, stiffness: Option<N>, )
Add one constraint to this mass-constraint system.
Sourcepub fn generate_neighbor_constraints(&mut self, stiffness: Option<N>)
pub fn generate_neighbor_constraints(&mut self, stiffness: Option<N>)
Generate additional constraints between nodes that are transitively neighbors.
Given three nodes a, b, c, if a constraint exists between a and b, and between b and c,
then a constraint between a and c is created if it does not already exists.
Sourcepub fn set_warmstart_coefficient(&mut self, coeff: N)
pub fn set_warmstart_coefficient(&mut self, coeff: N)
The coefficient used for warm-starting the resolution of internal constraints of this soft body (default: 0.5).
Sourcepub fn warmstart_coefficient(&self) -> N
pub fn warmstart_coefficient(&self) -> N
The coefficient used for warm-starting the resolution of internal constraints of this soft body (default: 0.5).
Sourcepub fn set_node_kinematic(&mut self, i: usize, is_kinematic: bool)
pub fn set_node_kinematic(&mut self, i: usize, is_kinematic: bool)
Restrict the specified node acceleration to always be zero so it can be controlled manually by the user at the velocity level.
Sourcepub fn clear_kinematic_nodes(&mut self)
pub fn clear_kinematic_nodes(&mut self)
Mark all nodes as non-kinematic.
Sourcepub fn set_plasticity(&mut self, strain_threshold: N, creep: N, max_force: N)
pub fn set_plasticity(&mut self, strain_threshold: N, creep: N, max_force: N)
Sets the plastic properties of this mass-constraint system.
Trait Implementations§
Source§impl<N> Body<N> for MassConstraintSystem<N>
impl<N> Body<N> for MassConstraintSystem<N>
Source§fn gravity_enabled(&self) -> bool
fn gravity_enabled(&self) -> bool
Source§fn enable_gravity(&mut self, enabled: bool)
fn enable_gravity(&mut self, enabled: bool)
Source§fn update_kinematics(&mut self)
fn update_kinematics(&mut self)
Source§fn update_dynamics(&mut self, _: N)
fn update_dynamics(&mut self, _: N)
Source§fn update_acceleration(
&mut self,
gravity: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
parameters: &IntegrationParameters<N>,
)
fn update_acceleration( &mut self, gravity: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, parameters: &IntegrationParameters<N>, )
Source§fn clear_forces(&mut self)
fn clear_forces(&mut self)
Source§fn apply_displacement(&mut self, disp: &[N])
fn apply_displacement(&mut self, disp: &[N])
Source§fn status(&self) -> BodyStatus
fn status(&self) -> BodyStatus
Source§fn set_status(&mut self, status: BodyStatus)
fn set_status(&mut self, status: BodyStatus)
Source§fn clear_update_flags(&mut self)
fn clear_update_flags(&mut self)
Source§fn update_status(&self) -> BodyUpdateStatus
fn update_status(&self) -> BodyUpdateStatus
Source§fn activation_status(&self) -> &ActivationStatus<N>
fn activation_status(&self) -> &ActivationStatus<N>
Source§fn set_deactivation_threshold(&mut self, threshold: Option<N>)
fn set_deactivation_threshold(&mut self, threshold: Option<N>)
Source§fn generalized_acceleration(
&self,
) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_acceleration( &self, ) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
Source§fn generalized_velocity(
&self,
) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_velocity( &self, ) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
Source§fn companion_id(&self) -> usize
fn companion_id(&self) -> usize
Source§fn set_companion_id(&mut self, id: usize)
fn set_companion_id(&mut self, id: usize)
Source§fn generalized_velocity_mut(
&mut self,
) -> Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_velocity_mut( &mut self, ) -> Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
Source§fn integrate(&mut self, parameters: &IntegrationParameters<N>)
fn integrate(&mut self, parameters: &IntegrationParameters<N>)
Source§fn activate_with_energy(&mut self, energy: N)
fn activate_with_energy(&mut self, energy: N)
Source§fn deactivate(&mut self)
fn deactivate(&mut self)
Source§fn part(&self, id: usize) -> Option<&(dyn BodyPart<N> + 'static)>
fn part(&self, id: usize) -> Option<&(dyn BodyPart<N> + 'static)>
Source§fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>
fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>
Source§fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>
fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>
Source§fn world_point_at_material_point(
&self,
part: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>,
) -> OPoint<N, Const<2>>
fn world_point_at_material_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>>, ) -> OPoint<N, Const<2>>
Source§fn position_at_material_point(
&self,
part: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>,
) -> Isometry<N, Unit<Complex<N>>, 2>
fn position_at_material_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>>, ) -> Isometry<N, Unit<Complex<N>>, 2>
Source§fn material_point_at_world_point(
&self,
part: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>,
) -> OPoint<N, Const<2>>
fn material_point_at_world_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>>, ) -> OPoint<N, Const<2>>
Source§fn fill_constraint_geometry(
&self,
part: &(dyn BodyPart<N> + 'static),
_: usize,
center: &OPoint<N, Const<2>>,
force_dir: &ForceDirection<N>,
j_id: usize,
wj_id: usize,
jacobians: &mut [N],
inv_r: &mut N,
ext_vels: Option<&Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>>,
out_vel: Option<&mut N>,
)
fn fill_constraint_geometry( &self, part: &(dyn BodyPart<N> + 'static), _: usize, center: &OPoint<N, Const<2>>, force_dir: &ForceDirection<N>, j_id: usize, wj_id: usize, jacobians: &mut [N], inv_r: &mut N, ext_vels: Option<&Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>>, out_vel: Option<&mut N>, )
center (relative to the body part’s center of mass) and
the direction dir. Read moreSource§fn has_active_internal_constraints(&mut self) -> bool
fn has_active_internal_constraints(&mut self) -> bool
true if this bodies contains internal constraints that need to be solved.Source§fn setup_internal_velocity_constraints(
&mut self,
_: &Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>,
_: &IntegrationParameters<N>,
)
fn setup_internal_velocity_constraints( &mut self, _: &Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>, _: &IntegrationParameters<N>, )
Source§fn warmstart_internal_velocity_constraints(
&mut self,
dvels: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>,
)
fn warmstart_internal_velocity_constraints( &mut self, dvels: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>, )
Source§fn step_solve_internal_velocity_constraints(
&mut self,
dvels: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>,
)
fn step_solve_internal_velocity_constraints( &mut self, dvels: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>, )
Source§fn step_solve_internal_position_constraints(
&mut self,
parameters: &IntegrationParameters<N>,
)
fn step_solve_internal_position_constraints( &mut self, parameters: &IntegrationParameters<N>, )
Source§fn velocity_at_point(
&self,
part_id: usize,
point: &OPoint<N, Const<2>>,
) -> Velocity2<N>
fn velocity_at_point( &self, part_id: usize, point: &OPoint<N, Const<2>>, ) -> Velocity2<N>
Source§fn apply_force_at_local_point(
&mut self,
part_id: usize,
force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
point: &OPoint<N, Const<2>>,
force_type: ForceType,
auto_wake_up: bool,
)
fn apply_force_at_local_point( &mut self, part_id: usize, force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>>, force_type: ForceType, auto_wake_up: bool, )
Source§fn apply_force(
&mut self,
part_id: usize,
force: &Force2<N>,
force_type: ForceType,
auto_wake_up: bool,
)
fn apply_force( &mut self, part_id: usize, force: &Force2<N>, force_type: ForceType, auto_wake_up: bool, )
Source§fn apply_local_force(
&mut self,
part_id: usize,
force: &Force2<N>,
force_type: ForceType,
auto_wake_up: bool,
)
fn apply_local_force( &mut self, part_id: usize, force: &Force2<N>, force_type: ForceType, auto_wake_up: bool, )
Source§fn apply_force_at_point(
&mut self,
part_id: usize,
force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
point: &OPoint<N, Const<2>>,
force_type: ForceType,
auto_wake_up: bool,
)
fn apply_force_at_point( &mut self, part_id: usize, force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>>, force_type: ForceType, auto_wake_up: bool, )
Source§fn apply_local_force_at_point(
&mut self,
part_id: usize,
force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
point: &OPoint<N, Const<2>>,
force_type: ForceType,
auto_wake_up: bool,
)
fn apply_local_force_at_point( &mut self, part_id: usize, force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>>, force_type: ForceType, auto_wake_up: bool, )
Source§fn apply_local_force_at_local_point(
&mut self,
part_id: usize,
force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
point: &OPoint<N, Const<2>>,
force_type: ForceType,
auto_wake_up: bool,
)
fn apply_local_force_at_local_point( &mut self, part_id: usize, force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>>, force_type: ForceType, auto_wake_up: bool, )
Source§fn update_activation_status(&mut self)
fn update_activation_status(&mut self)
fn advance(&mut self, _time_ratio: N)
fn validate_advancement(&mut self)
fn clamp_advancement(&mut self)
fn part_motion( &self, _part_id: usize, _time_origin: N, ) -> Option<BodyPartMotion<N>>
fn step_started(&mut self)
Source§fn add_local_inertia_and_com(
&mut self,
_part_index: usize,
_com: OPoint<N, Const<2>>,
_inertia: Inertia2<N>,
)
fn add_local_inertia_and_com( &mut self, _part_index: usize, _com: OPoint<N, Const<2>>, _inertia: Inertia2<N>, )
Source§fn status_dependent_ndofs(&self) -> usize
fn status_dependent_ndofs(&self) -> usize
Source§fn status_dependent_body_part_velocity(
&self,
part: &(dyn BodyPart<N> + 'static),
) -> Velocity2<N>
fn status_dependent_body_part_velocity( &self, part: &(dyn BodyPart<N> + 'static), ) -> Velocity2<N>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§fn is_kinematic(&self) -> bool
fn is_kinematic(&self) -> bool
Auto Trait Implementations§
impl<N> Freeze for MassConstraintSystem<N>where
N: Freeze,
impl<N> !RefUnwindSafe for MassConstraintSystem<N>
impl<N> Send for MassConstraintSystem<N>
impl<N> Sync for MassConstraintSystem<N>
impl<N> Unpin for MassConstraintSystem<N>where
N: Unpin,
impl<N> UnsafeUnpin for MassConstraintSystem<N>where
N: UnsafeUnpin,
impl<N> !UnwindSafe for MassConstraintSystem<N>
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> 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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 moreSource§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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.