pub struct ContactMaterial {
pub stiffness: f64,
pub damping: f64,
pub friction: f64,
pub bounce: f64,
pub soft_cfm: f64,
pub soft_erp: f64,
}Expand description
Material properties for contact interactions.
Fields§
§stiffness: f64Contact stiffness (N/m).
damping: f64Contact damping (N·s/m).
friction: f64Coefficient of friction (dimensionless).
bounce: f64Coefficient of restitution (0 = inelastic, 1 = elastic).
soft_cfm: f64Constraint force mixing (for numerical stability).
soft_erp: f64Error reduction parameter (for constraint drift correction).
Implementations§
Source§impl ContactMaterial
impl ContactMaterial
Sourcepub fn new(
stiffness: f64,
damping: f64,
friction: f64,
bounce: f64,
) -> ContactMaterial
pub fn new( stiffness: f64, damping: f64, friction: f64, bounce: f64, ) -> ContactMaterial
Create a new contact material with custom parameters.
Sourcepub fn bouncy() -> ContactMaterial
pub fn bouncy() -> ContactMaterial
Create a bouncy material (high restitution).
Sourcepub fn soft() -> ContactMaterial
pub fn soft() -> ContactMaterial
Create a soft material (low stiffness).
Sourcepub fn rigid() -> ContactMaterial
pub fn rigid() -> ContactMaterial
Create a rigid material (high stiffness).
Trait Implementations§
Source§impl Clone for ContactMaterial
impl Clone for ContactMaterial
Source§fn clone(&self) -> ContactMaterial
fn clone(&self) -> ContactMaterial
Returns a duplicate of the value. Read more
1.0.0 · 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 ContactMaterial
impl Debug for ContactMaterial
Source§impl Default for ContactMaterial
impl Default for ContactMaterial
Source§fn default() -> ContactMaterial
fn default() -> ContactMaterial
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContactMaterial
impl RefUnwindSafe for ContactMaterial
impl Send for ContactMaterial
impl Sync for ContactMaterial
impl Unpin for ContactMaterial
impl UnsafeUnpin for ContactMaterial
impl UnwindSafe for ContactMaterial
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.