Skip to main content

ContactModel

Trait ContactModel 

Source
pub trait ContactModel<N, Handle, CollHandle>:
    Downcast
    + Send
    + Sync
where N: RealField + Copy, Handle: BodyHandle, CollHandle: ColliderHandle,
{ // Required methods fn num_velocity_constraints( &self, manifold: &ColliderContactManifold<'_, N, Handle, CollHandle>, ) -> usize; fn constraints( &mut self, parameters: &IntegrationParameters<N>, material_coefficients: &MaterialsCoefficientsTable<N>, bodies: &dyn BodySet<N, Handle = Handle>, ext_vels: &Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>, manifolds: &[ColliderContactManifold<'_, N, Handle, CollHandle>], ground_j_id: &mut usize, j_id: &mut usize, jacobians: &mut [N], constraints: &mut ConstraintSet<N, Handle, CollHandle, ContactId>, ); fn cache_impulses( &mut self, constraints: &ConstraintSet<N, Handle, CollHandle, ContactId>, ); }
Expand description

The modeling of a contact.

Required Methods§

Source

fn num_velocity_constraints( &self, manifold: &ColliderContactManifold<'_, N, Handle, CollHandle>, ) -> usize

Maximum number of velocity constraint to be generated for each contact.

Source

fn constraints( &mut self, parameters: &IntegrationParameters<N>, material_coefficients: &MaterialsCoefficientsTable<N>, bodies: &dyn BodySet<N, Handle = Handle>, ext_vels: &Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>, manifolds: &[ColliderContactManifold<'_, N, Handle, CollHandle>], ground_j_id: &mut usize, j_id: &mut usize, jacobians: &mut [N], constraints: &mut ConstraintSet<N, Handle, CollHandle, ContactId>, )

Generate all constraints for the given contact manifolds.

Source

fn cache_impulses( &mut self, constraints: &ConstraintSet<N, Handle, CollHandle, ContactId>, )

Stores all the impulses found by the solver into a cache for warmstarting.

Implementations§

Source§

impl<N, Handle, CollHandle> dyn ContactModel<N, Handle, CollHandle>
where N: Any + 'static + RealField + Copy, Handle: Any + 'static + BodyHandle, CollHandle: Any + 'static + ColliderHandle,

Source

pub fn is<__T>(&self) -> bool
where __T: ContactModel<N, Handle, CollHandle>,

Returns true if the trait object wraps an object of type __T.

Source

pub fn downcast<__T>( self: Box<dyn ContactModel<N, Handle, CollHandle>>, ) -> Result<Box<__T>, Box<dyn ContactModel<N, Handle, CollHandle>>>
where __T: ContactModel<N, Handle, CollHandle>,

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

Source

pub fn downcast_rc<__T>( self: Rc<dyn ContactModel<N, Handle, CollHandle>>, ) -> Result<Rc<__T>, Rc<dyn ContactModel<N, Handle, CollHandle>>>
where __T: ContactModel<N, Handle, CollHandle>,

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

Source

pub fn downcast_ref<__T>(&self) -> Option<&__T>
where __T: ContactModel<N, Handle, CollHandle>,

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

Source

pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T>
where __T: ContactModel<N, Handle, CollHandle>,

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<N, Handle, CollHandle> ContactModel<N, Handle, CollHandle> for SignoriniCoulombPyramidModel<N>
where N: RealField + Copy, Handle: BodyHandle, CollHandle: ColliderHandle,

Source§

impl<N, Handle, CollHandle> ContactModel<N, Handle, CollHandle> for SignoriniModel<N>
where N: RealField + Copy, Handle: BodyHandle, CollHandle: ColliderHandle,