pub trait PositionConstraint: XpbdConstraint<2> {
// Provided methods
fn apply_positional_lagrange_update(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
delta_lagrange: Scalar,
direction: Vector,
r1: Vector,
r2: Vector
) -> Vector { ... }
fn apply_positional_impulse(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
impulse: 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: Matrix3,
r: Vector,
p: Vector
) -> Quaternion { ... }
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_lagrange_update(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
delta_lagrange: Scalar,
direction: Vector,
r1: Vector,
r2: Vector
) -> Vector
fn apply_positional_lagrange_update( &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 apply_positional_impulse(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
impulse: Vector,
r1: Vector,
r2: Vector
) -> Vector
fn apply_positional_impulse( &self, body1: &mut RigidBodyQueryItem<'_>, body2: &mut RigidBodyQueryItem<'_>, impulse: Vector, r1: Vector, r2: Vector ) -> Vector
Applies a positional impulse to two bodies.
Returns the 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
.
sourcefn get_delta_rot(
rot: Rotation,
inverse_inertia: Matrix3,
r: Vector,
p: Vector
) -> Quaternion
fn get_delta_rot( rot: Rotation, inverse_inertia: Matrix3, r: Vector, p: Vector ) -> Quaternion
Computes the update in rotation when applying a positional correction p
at point r
.
Object Safety§
This trait is not object safe.