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§

source

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.

source

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.

source

fn get_delta_rot( _rot: Rotation, inverse_inertia: Scalar, r: Vector, p: Vector ) -> Rotation

Computes the update in rotation when applying a positional correction p at point r.

source

fn compute_force( &self, lagrange: Scalar, direction: Vector, dt: Scalar ) -> Vector

Computes the force acting along the constraint using the equation f = lambda * n / h^2

Object Safety§

This trait is not object safe.

Implementors§