Trait bevy_xpbd_2d::constraints::PositionConstraint
source · pub trait PositionConstraint: XpbdConstraint<2> {
// Provided methods
fn apply_positional_correction(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
delta_lagrange: Scalar,
direction: Vector,
r1: Vector,
r2: Vector
) -> Vector { ... }
fn compute_generalized_inverse_mass(
&self,
body: &RigidBodyQueryItem<'_>,
r: Vector,
n: Vector
) -> Scalar { ... }
fn get_delta_rot(
_rot: Rotation,
inverse_inertia: Scalar,
r: Vector,
p: Vector
) -> Rotation { ... }
fn compute_force(
&self,
lagrange: Scalar,
direction: Vector,
dt: Scalar
) -> Vector { ... }
}
Expand description
A positional constraint applies a positional correction
with a given direction and magnitude at the local contact points r1
and r2
.
Provided Methods§
sourcefn apply_positional_correction(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
delta_lagrange: Scalar,
direction: Vector,
r1: Vector,
r2: Vector
) -> Vector
fn apply_positional_correction( &self, body1: &mut RigidBodyQueryItem<'_>, body2: &mut RigidBodyQueryItem<'_>, delta_lagrange: Scalar, direction: Vector, r1: Vector, r2: Vector ) -> Vector
Applies a positional correction to two bodies.
Returns the positional impulse that is applied proportional to the inverse masses of the bodies.
sourcefn compute_generalized_inverse_mass(
&self,
body: &RigidBodyQueryItem<'_>,
r: Vector,
n: Vector
) -> Scalar
fn compute_generalized_inverse_mass( &self, body: &RigidBodyQueryItem<'_>, r: Vector, n: Vector ) -> Scalar
Computes the generalized inverse mass of a body when applying a positional correction
at point r
along the vector n
.
Object Safety§
This trait is not object safe.