pub trait Joint: Component + PositionConstraint + AngularConstraint {
// Required methods
fn new(entity1: Entity, entity2: Entity) -> Self;
fn with_compliance(self, compliance: Scalar) -> Self;
fn with_local_anchor_1(self, anchor: Vector) -> Self;
fn with_local_anchor_2(self, anchor: Vector) -> Self;
fn with_linear_velocity_damping(self, damping: Scalar) -> Self;
fn with_angular_velocity_damping(self, damping: Scalar) -> Self;
fn local_anchor_1(&self) -> Vector;
fn local_anchor_2(&self) -> Vector;
fn damping_linear(&self) -> Scalar;
fn damping_angular(&self) -> Scalar;
// Provided method
fn align_position(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
r1: Vector,
r2: Vector,
lagrange: &mut Scalar,
compliance: Scalar,
dt: Scalar
) -> Vector { ... }
}
Expand description
A trait for joints.
Required Methods§
sourcefn with_compliance(self, compliance: Scalar) -> Self
fn with_compliance(self, compliance: Scalar) -> Self
Sets the joint’s compliance (inverse of stiffness, meters / Newton).
sourcefn with_local_anchor_1(self, anchor: Vector) -> Self
fn with_local_anchor_1(self, anchor: Vector) -> Self
Sets the attachment point on the first body.
sourcefn with_local_anchor_2(self, anchor: Vector) -> Self
fn with_local_anchor_2(self, anchor: Vector) -> Self
Sets the attachment point on the second body.
sourcefn with_linear_velocity_damping(self, damping: Scalar) -> Self
fn with_linear_velocity_damping(self, damping: Scalar) -> Self
Sets the linear velocity damping caused by the joint.
sourcefn with_angular_velocity_damping(self, damping: Scalar) -> Self
fn with_angular_velocity_damping(self, damping: Scalar) -> Self
Sets the angular velocity damping caused by the joint.
sourcefn local_anchor_1(&self) -> Vector
fn local_anchor_1(&self) -> Vector
Returns the local attachment point on the first body.
sourcefn local_anchor_2(&self) -> Vector
fn local_anchor_2(&self) -> Vector
Returns the local attachment point on the second body.
sourcefn damping_linear(&self) -> Scalar
fn damping_linear(&self) -> Scalar
Returns the linear velocity damping of the joint.
sourcefn damping_angular(&self) -> Scalar
fn damping_angular(&self) -> Scalar
Returns the angular velocity damping of the joint.
Provided Methods§
sourcefn align_position(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
r1: Vector,
r2: Vector,
lagrange: &mut Scalar,
compliance: Scalar,
dt: Scalar
) -> Vector
fn align_position( &self, body1: &mut RigidBodyQueryItem<'_>, body2: &mut RigidBodyQueryItem<'_>, r1: Vector, r2: Vector, lagrange: &mut Scalar, compliance: Scalar, dt: Scalar ) -> Vector
Applies a positional correction that aligns the positions of the local attachment points r1
and r2
.
Returns the force exerted by the alignment.
Object Safety§
This trait is not object safe.