[−][src]Trait nphysics3d::joint::JointConstraint
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) -> (BodyPartHandle, BodyPartHandle)
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> dyn JointConstraint<N> where
N: Any + 'static,
N: RealField,
N: Any + 'static,
N: RealField,
pub fn is<__T: JointConstraint<N>>(&self) -> bool
Returns true if the trait object wraps an object of type __T
.
pub fn downcast<__T: JointConstraint<N>>(
self: Box<Self>
) -> Result<Box<__T>, Box<Self>>
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_ref<__T: JointConstraint<N>>(&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: JointConstraint<N>>(&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> JointConstraint<N> for BallConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for CartesianConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for CylindricalConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for FixedConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for MouseConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
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],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
params: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
fn cache_impulses(&mut self, _: &ConstraintSet<N>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for PinSlotConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for PlanarConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for PrismaticConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for RectangularConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for RevoluteConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<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>)
[src]
fn is_active(&self, bodies: &BodySet<N>) -> bool
[src]
impl<N: RealField> JointConstraint<N> for UniversalConstraint<N>
[src]
fn num_velocity_constraints(&self) -> usize
[src]
fn anchors(&self) -> (BodyPartHandle, BodyPartHandle)
[src]
fn velocity_constraints(
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>,
bodies: &BodySet<N>,
ext_vels: &DVector<N>,
ground_j_id: &mut usize,
j_id: &mut usize,
jacobians: &mut [N],
constraints: &mut ConstraintSet<N>
)