Trait avian3d::dynamics::solver::xpbd::AngularConstraint

source ·
pub trait AngularConstraint: XpbdConstraint<2> {
    // Provided methods
    fn apply_angular_lagrange_update(
        &self,
        body1: &mut RigidBodyQueryItem<'_>,
        body2: &mut RigidBodyQueryItem<'_>,
        delta_lagrange: Scalar,
        axis: Vector
    ) -> Vector { ... }
    fn apply_angular_impulse(
        &self,
        body1: &mut RigidBodyQueryItem<'_>,
        body2: &mut RigidBodyQueryItem<'_>,
        impulse: Vector
    ) -> Vector { ... }
    fn align_orientation(
        &self,
        body1: &mut RigidBodyQueryItem<'_>,
        body2: &mut RigidBodyQueryItem<'_>,
        rotation_difference: Vector,
        lagrange: &mut Scalar,
        compliance: Scalar,
        dt: Scalar
    ) -> Vector { ... }
    fn apply_angular_correction(
        &self,
        body1: &mut RigidBodyQueryItem<'_>,
        body2: &mut RigidBodyQueryItem<'_>,
        delta_lagrange: Scalar,
        axis: Vector
    ) -> Vector { ... }
    fn compute_generalized_inverse_mass(
        &self,
        body: &RigidBodyQueryItem<'_>,
        axis: Vector
    ) -> Scalar { ... }
    fn get_delta_rot(
        rot: Rotation,
        inverse_inertia: Matrix3,
        p: Vector
    ) -> Quaternion { ... }
    fn compute_torque(
        &self,
        lagrange: Scalar,
        axis: Vector,
        dt: Scalar
    ) -> Vector { ... }
}
Expand description

An angular constraint applies an angular correction around a given axis.

Provided Methods§

source

fn apply_angular_lagrange_update( &self, body1: &mut RigidBodyQueryItem<'_>, body2: &mut RigidBodyQueryItem<'_>, delta_lagrange: Scalar, axis: Vector ) -> Vector

Applies an angular correction to two bodies.

Returns the angular impulse that is applied proportional to the inverse moments of inertia of the bodies.

source

fn apply_angular_impulse( &self, body1: &mut RigidBodyQueryItem<'_>, body2: &mut RigidBodyQueryItem<'_>, impulse: Vector ) -> Vector

Applies an angular impulse to two bodies.

Returns the impulse that is applied proportional to the inverse moments of inertia of the bodies.

source

fn align_orientation( &self, body1: &mut RigidBodyQueryItem<'_>, body2: &mut RigidBodyQueryItem<'_>, rotation_difference: Vector, lagrange: &mut Scalar, compliance: Scalar, dt: Scalar ) -> Vector

Applies an angular correction that aligns the orientation of the bodies.

Returns the torque exerted by the alignment.

source

fn apply_angular_correction( &self, body1: &mut RigidBodyQueryItem<'_>, body2: &mut RigidBodyQueryItem<'_>, delta_lagrange: Scalar, axis: Vector ) -> Vector

Applies angular constraints for interactions between two bodies.

Returns the angular impulse that is applied proportional to the inverse masses of the bodies.

source

fn compute_generalized_inverse_mass( &self, body: &RigidBodyQueryItem<'_>, axis: Vector ) -> Scalar

Computes the generalized inverse mass of a body when applying an angular correction around axis.

source

fn get_delta_rot( rot: Rotation, inverse_inertia: Matrix3, p: Vector ) -> Quaternion

Computes the update in rotation when applying an angular correction p.

source

fn compute_torque(&self, lagrange: Scalar, axis: Vector, dt: Scalar) -> Vector

Computes the torque acting along the constraint using the equation tau = lambda * n / h^2

Object Safety§

This trait is not object safe.

Implementors§