Trait avian3d::dynamics::solver::xpbd::PositionConstraint

source ·
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§

source

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.

source

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.

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: Matrix3, r: Vector, p: Vector ) -> Quaternion

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§