Trait nphysics3d::joint::JointConstraint [−][src]
pub trait JointConstraint<N: Real>: NonlinearConstraintGenerator<N> + Any + Send + Sync { fn num_velocity_constraints(&self) -> usize; fn anchors(&self) -> (BodyHandle, BodyHandle); fn velocity_constraints(
&mut self,
params: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
velocity_constraints: &mut ConstraintSet<N>
); fn cache_impulses(&mut self, constraints: &ConstraintSet<N>); fn is_active(&self, bodies: &BodySet<N>) -> bool { ... } }
Trait implemented by joint that operate by generating constraints to restrict the relative motion of two body parts.
Required Methods
fn num_velocity_constraints(&self) -> usize
The maximum number of velocity constraints generated by this joint.
fn anchors(&self) -> (BodyHandle, BodyHandle)
The two body parts affected by this joint.
fn velocity_constraints(
&mut self,
params: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
velocity_constraints: &mut ConstraintSet<N>
)
&mut self,
params: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
velocity_constraints: &mut ConstraintSet<N>
)
Initialize and retrieve all the constraints appied to the bodies attached to this joint.
fn cache_impulses(&mut self, constraints: &ConstraintSet<N>)
Called after velocity constraint resolution, allows the joint to keep a cache of impulses generated for each constraint.
Provided Methods
fn is_active(&self, bodies: &BodySet<N>) -> bool
Return true
if the constraint is active.
Typically, a constraint is disable if it is between two sleeping bodies, or, between bodies without any degrees of freedom.
Methods
impl<N> JointConstraint<N> where
N: Real,
impl<N> JointConstraint<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 JointConstraint<N> where
_T: Any,
N: 'static,
N: Real,
impl<_T: Any, N> Downcast<_T> for JointConstraint<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> JointConstraint<N> for CartesianConstraint<N>
impl<N: Real> JointConstraint<N> for FixedConstraint<N>
impl<N: Real> JointConstraint<N> for MouseConstraint<N>
impl<N: Real> JointConstraint<N> for PrismaticConstraint<N>
impl<N: Real> JointConstraint<N> for RevoluteConstraint<N>
impl<N: Real> JointConstraint<N> for BallConstraint<N>
impl<N: Real> JointConstraint<N> for CylindricalConstraint<N>
impl<N: Real> JointConstraint<N> for PinSlotConstraint<N>
impl<N: Real> JointConstraint<N> for PlanarConstraint<N>
impl<N: Real> JointConstraint<N> for RectangularConstraint<N>
impl<N: Real> JointConstraint<N> for UniversalConstraint<N>