Trait nphysics3d::solver::ContactModel [−][src]
pub trait ContactModel<N: RealField + Copy, Handle: BodyHandle, CollHandle: ColliderHandle>: Downcast + Send + Sync { 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: &DVector<N>,
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
fn num_velocity_constraints(
&self,
manifold: &ColliderContactManifold<'_, N, Handle, CollHandle>
) -> usize
fn num_velocity_constraints(
&self,
manifold: &ColliderContactManifold<'_, N, Handle, CollHandle>
) -> usize
Maximum number of velocity constraint to be generated for each contact.
fn constraints(
&mut self,
parameters: &IntegrationParameters<N>,
material_coefficients: &MaterialsCoefficientsTable<N>,
bodies: &dyn BodySet<N, Handle = Handle>,
ext_vels: &DVector<N>,
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 constraints(
&mut self,
parameters: &IntegrationParameters<N>,
material_coefficients: &MaterialsCoefficientsTable<N>,
bodies: &dyn BodySet<N, Handle = Handle>,
ext_vels: &DVector<N>,
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.
fn cache_impulses(
&mut self,
constraints: &ConstraintSet<N, Handle, CollHandle, ContactId>
)
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
impl<N, Handle, CollHandle> dyn ContactModel<N, Handle, CollHandle> where
N: Any + 'static,
Handle: Any + 'static,
CollHandle: Any + 'static,
N: RealField + Copy,
Handle: BodyHandle,
CollHandle: ColliderHandle,
impl<N, Handle, CollHandle> dyn ContactModel<N, Handle, CollHandle> where
N: Any + 'static,
Handle: Any + 'static,
CollHandle: Any + 'static,
N: RealField + Copy,
Handle: BodyHandle,
CollHandle: ColliderHandle,
Returns true if the trait object wraps an object of type __T
.
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.
pub fn downcast_rc<__T: ContactModel<N, Handle, CollHandle>>(
self: Rc<Self>
) -> Result<Rc<__T>, Rc<Self>>
pub fn downcast_rc<__T: ContactModel<N, Handle, CollHandle>>(
self: Rc<Self>
) -> Result<Rc<__T>, Rc<Self>>
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.
Returns a reference to the object within the trait object if it is of type __T
, or
None
if it isn’t.
Returns a mutable reference to the object within the trait object if it is of type
__T
, or None
if it isn’t.