Struct nphysics2d::joint::PrismaticConstraint [−][src]
pub struct PrismaticConstraint<N: Real> { /* fields omitted */ }
A constraint that remove all be one translational degrees of freedom.
Methods
impl<N: Real> PrismaticConstraint<N>
[src]
impl<N: Real> PrismaticConstraint<N>
pub fn new(
b1: BodyHandle,
b2: BodyHandle,
anchor1: Point<N>,
axis1: Unit<Vector<N>>,
anchor2: Point<N>
) -> Self
[src]
pub fn new(
b1: BodyHandle,
b2: BodyHandle,
anchor1: Point<N>,
axis1: Unit<Vector<N>>,
anchor2: Point<N>
) -> Self
Create a new prismatic constraint that ensures the relative motion between the two
body parts are restricted to a single translation along the axis1
axis (expressed in
the local coordinates frame of b1
).
pub fn min_offset(&self) -> Option<N>
[src]
pub fn min_offset(&self) -> Option<N>
The lower limit, if any, of the relative translation (along the joint axis) of the body parts attached to this joint.
pub fn max_offset(&self) -> Option<N>
[src]
pub fn max_offset(&self) -> Option<N>
The upper limit, if any, of the relative translation (along the joint axis) of the body parts attached to this joint.
pub fn disable_min_offset(&mut self)
[src]
pub fn disable_min_offset(&mut self)
Disable the lower limit of the relative translational motion along the joint axis.
pub fn disable_max_offset(&mut self)
[src]
pub fn disable_max_offset(&mut self)
Disable the upper limit of the relative translational motion along the joint axis.
pub fn enable_min_offset(&mut self, limit: N)
[src]
pub fn enable_min_offset(&mut self, limit: N)
Enables the lower limit of the relative translational motion along the joint axis.
pub fn enable_max_offset(&mut self, limit: N)
[src]
pub fn enable_max_offset(&mut self, limit: N)
Disable the lower limit of the relative translational motion along the joint axis.
Trait Implementations
impl<N: Real> JointConstraint<N> for PrismaticConstraint<N>
[src]
impl<N: Real> JointConstraint<N> for PrismaticConstraint<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 PrismaticConstraint<N>
[src]
impl<N: Real> NonlinearConstraintGenerator<N> for PrismaticConstraint<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>,
i: usize,
bodies: &mut BodySet<N>,
jacobians: &mut [N]
) -> Option<GenericNonlinearConstraint<N>>
[src]
fn position_constraint(
&self,
params: &IntegrationParameters<N>,
i: 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 PrismaticConstraint<N> where
N: Scalar,
impl<N> Send for PrismaticConstraint<N> where
N: Scalar,
impl<N> Sync for PrismaticConstraint<N> where
N: Scalar,
impl<N> Sync for PrismaticConstraint<N> where
N: Scalar,