# Struct nphysics3d::joint::CartesianConstraint [−][src]

pub struct CartesianConstraint<N: Real> { /* fields omitted */ }

A constraint that removes all relative angular motion between two body parts.

## Methods

`impl<N: Real> CartesianConstraint<N>`

[src]

`impl<N: Real> CartesianConstraint<N>`

`pub fn new(`

b1: BodyHandle,

b2: BodyHandle,

joint_to_b1: Isometry<N>,

joint_to_b2: Isometry<N>

) -> Self

[src]

`pub fn new(`

b1: BodyHandle,

b2: BodyHandle,

joint_to_b1: Isometry<N>,

joint_to_b2: Isometry<N>

) -> Self

Creates a cartesian constaint between two body parts.

This will ensure the rotational parts of the frames given identified by `joint_to_b1`

and
`joint_to_b2`

and attached to the corrisponding bodies will coincide.

`pub fn set_anchor_1(&mut self, local1: Isometry<N>)`

[src]

`pub fn set_anchor_1(&mut self, local1: Isometry<N>)`

Changes the reference frame for the first body part.

`pub fn set_anchor_2(&mut self, local2: Isometry<N>)`

[src]

`pub fn set_anchor_2(&mut self, local2: Isometry<N>)`

Changes the reference frame for the second body part.

## Trait Implementations

`impl<N: Real> JointConstraint<N> for CartesianConstraint<N>`

[src]

`impl<N: Real> JointConstraint<N> for CartesianConstraint<N>`

`fn num_velocity_constraints(&self) -> usize`

[src]

`fn num_velocity_constraints(&self) -> usize`

The maximum number of velocity constraints generated by this joint.

`fn anchors(&self) -> (BodyHandle, BodyHandle)`

[src]

`fn anchors(&self) -> (BodyHandle, BodyHandle)`

The two body parts affected by this joint.

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

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

)

Initialize and retrieve all the constraints appied to the bodies attached to this joint.

`fn cache_impulses(&mut self, constraints: &ConstraintSet<N>)`

[src]

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

`fn is_active(&self, bodies: &BodySet<N>) -> bool`

[src]

`fn is_active(&self, bodies: &BodySet<N>) -> bool`

Return `true`

if the constraint is active. Read more

`impl<N: Real> NonlinearConstraintGenerator<N> for CartesianConstraint<N>`

[src]

`impl<N: Real> NonlinearConstraintGenerator<N> for CartesianConstraint<N>`

`fn num_position_constraints(&self, bodies: &BodySet<N>) -> usize`

[src]

`fn num_position_constraints(&self, bodies: &BodySet<N>) -> usize`

Maximum of non-linear position constraint this generater needs to output.

`fn position_constraint(`

&self,

params: &IntegrationParameters<N>,

_: usize,

bodies: &mut BodySet<N>,

jacobians: &mut [N]

) -> Option<GenericNonlinearConstraint<N>>

[src]

`fn position_constraint(`

&self,

params: &IntegrationParameters<N>,

_: usize,

bodies: &mut BodySet<N>,

jacobians: &mut [N]

) -> Option<GenericNonlinearConstraint<N>>

Generate the `i`

-th position constraint of this generator.

## Auto Trait Implementations

`impl<N> Send for CartesianConstraint<N>`

`impl<N> Send for CartesianConstraint<N>`

`impl<N> Sync for CartesianConstraint<N>`

`impl<N> Sync for CartesianConstraint<N>`