Trait nphysics2d::solver::ContactModel [−][src]
pub trait ContactModel<N: Real>: Any + Send + Sync { fn num_velocity_constraints(
&self,
manifold: &ColliderContactManifold<N>
) -> usize; fn constraints(
&mut self,
params: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
manifolds: &[ColliderContactManifold<N>],
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
); fn cache_impulses(&mut self, constraints: &ConstraintSet<N>); }
The modeling of a contact.
Required Methods
fn num_velocity_constraints(
&self,
manifold: &ColliderContactManifold<N>
) -> usize
&self,
manifold: &ColliderContactManifold<N>
) -> usize
Maximum number of velocity constraint to be generated for each contact.
fn constraints(
&mut self,
params: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
manifolds: &[ColliderContactManifold<N>],
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
&mut self,
params: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
manifolds: &[ColliderContactManifold<N>],
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
Generate all constraints for the given contact manifolds.
fn cache_impulses(&mut self, constraints: &ConstraintSet<N>)
Stores all the impulses found by the solver into a cache for warmstarting.
Methods
impl<N> ContactModel<N> where
N: Real,
impl<N> ContactModel<N> where
N: Real,
pub fn is<_T>(&self) -> bool where
_T: Any,
Self: Downcast<_T>,
pub fn is<_T>(&self) -> bool where
_T: Any,
Self: Downcast<_T>,
ⓘImportant traits for &'a mut Rpub unsafe fn downcast_ref_unchecked<_T>(&self) -> &_T where
_T: Any,
Self: Downcast<_T>,
ⓘImportant traits for &'a mut R
pub unsafe fn downcast_ref_unchecked<_T>(&self) -> &_T where
_T: Any,
Self: Downcast<_T>,
pub fn downcast_ref<_T>(&self) -> Result<&_T, TypeMismatch> where
_T: Any,
Self: Downcast<_T>,
pub fn downcast_ref<_T>(&self) -> Result<&_T, TypeMismatch> where
_T: Any,
Self: Downcast<_T>,
ⓘImportant traits for &'a mut Rpub unsafe fn downcast_mut_unchecked<_T>(&mut self) -> &mut _T where
_T: Any,
Self: Downcast<_T>,
ⓘImportant traits for &'a mut R
pub unsafe fn downcast_mut_unchecked<_T>(&mut self) -> &mut _T where
_T: Any,
Self: Downcast<_T>,
pub fn downcast_mut<_T>(&mut self) -> Result<&mut _T, TypeMismatch> where
_T: Any,
Self: Downcast<_T>,
pub fn downcast_mut<_T>(&mut self) -> Result<&mut _T, TypeMismatch> where
_T: Any,
Self: Downcast<_T>,
ⓘImportant traits for Box<R>pub unsafe fn downcast_unchecked<_T>(self: Box<Self>) -> Box<_T> where
_T: Any,
Self: Downcast<_T>,
ⓘImportant traits for Box<R>
pub unsafe fn downcast_unchecked<_T>(self: Box<Self>) -> Box<_T> where
_T: Any,
Self: Downcast<_T>,
pub fn downcast<_T>(
self: Box<Self>
) -> Result<Box<_T>, DowncastError<Box<Self>>> where
_T: Any,
Self: Downcast<_T>,
pub fn downcast<_T>(
self: Box<Self>
) -> Result<Box<_T>, DowncastError<Box<Self>>> where
_T: Any,
Self: Downcast<_T>,
Trait Implementations
impl<_T: Any, N> Downcast<_T> for ContactModel<N> where
_T: Any,
N: 'static,
N: Real,
impl<_T: Any, N> Downcast<_T> for ContactModel<N> where
_T: Any,
N: 'static,
N: Real,
fn is_type(&self) -> bool
[src]
fn is_type(&self) -> bool
ⓘImportant traits for &'a mut Runsafe fn downcast_ref_unchecked(&self) -> &T
[src]
ⓘImportant traits for &'a mut R
unsafe fn downcast_ref_unchecked(&self) -> &T
fn downcast_ref(&self) -> Result<&T, TypeMismatch>
[src]
fn downcast_ref(&self) -> Result<&T, TypeMismatch>
ⓘImportant traits for &'a mut Runsafe fn downcast_mut_unchecked(&mut self) -> &mut T
[src]
ⓘImportant traits for &'a mut R
unsafe fn downcast_mut_unchecked(&mut self) -> &mut T
fn downcast_mut(&mut self) -> Result<&mut T, TypeMismatch>
[src]
fn downcast_mut(&mut self) -> Result<&mut T, TypeMismatch>
ⓘImportant traits for Box<R>unsafe fn downcast_unchecked(self: Box<Self>) -> Box<T>
[src]
ⓘImportant traits for Box<R>
unsafe fn downcast_unchecked(self: Box<Self>) -> Box<T>
fn downcast(self: Box<Self>) -> Result<Box<T>, DowncastError<Box<Self>>>
[src]
fn downcast(self: Box<Self>) -> Result<Box<T>, DowncastError<Box<Self>>>
Implementors
impl<N: Real> ContactModel<N> for SignoriniCoulombPyramidModel<N>
impl<N: Real> ContactModel<N> for SignoriniModel<N>