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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.