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§
sourcefn apply_angular_lagrange_update(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
delta_lagrange: Scalar,
axis: Vector
) -> Vector
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.
sourcefn apply_angular_impulse(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
impulse: Vector
) -> Vector
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.
sourcefn align_orientation(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
rotation_difference: Vector,
lagrange: &mut Scalar,
compliance: Scalar,
dt: Scalar
) -> Vector
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.
sourcefn apply_angular_correction(
&self,
body1: &mut RigidBodyQueryItem<'_>,
body2: &mut RigidBodyQueryItem<'_>,
delta_lagrange: Scalar,
axis: Vector
) -> Vector
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.
sourcefn compute_generalized_inverse_mass(
&self,
body: &RigidBodyQueryItem<'_>,
axis: Vector
) -> Scalar
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
.
sourcefn get_delta_rot(
rot: Rotation,
inverse_inertia: Matrix3,
p: Vector
) -> Quaternion
fn get_delta_rot( rot: Rotation, inverse_inertia: Matrix3, p: Vector ) -> Quaternion
Computes the update in rotation when applying an angular correction p
.