[][src]Trait nphysics3d::solver::ContactModel

pub trait ContactModel<N: RealField, 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>
    ); }

The modeling of a contact.

Required methods

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>
)

Generate all constraints for the given contact manifolds.

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

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

Loading content...

Methods

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

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

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

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

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>>

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.

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

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

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

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

Implementors

impl<N: RealField, Handle: BodyHandle, CollHandle: ColliderHandle> ContactModel<N, Handle, CollHandle> for SignoriniCoulombPyramidModel<N>[src]

impl<N: RealField, Handle: BodyHandle, CollHandle: ColliderHandle> ContactModel<N, Handle, CollHandle> for SignoriniModel<N>[src]

Loading content...