pub trait PositionalConstraint: Constraint<2> {
    // Required methods
    fn gradient(
        &self,
        a_world_position: Vec2<f64>,
        b_world_position: Vec2<f64>
    ) -> Vec2<f64>;
    fn magnitude(
        &self,
        a_world_position: Vec2<f64>,
        b_world_position: Vec2<f64>
    ) -> f64;
    fn compliance(&self) -> f64;

    // Provided method
    fn apply(
        &mut self,
        a: &mut RigidBodyQuery<'_>,
        a_attachment: Vec2<f64>,
        b: &mut RigidBodyQuery<'_>,
        b_attachment: Vec2<f64>,
        apply_on_kinematic: bool,
        dt: f64
    ) { ... }
}
Expand description

Constraint specialization for position restrictions.

Required Methods§

source

fn gradient( &self, a_world_position: Vec2<f64>, b_world_position: Vec2<f64> ) -> Vec2<f64>

Direction normalized vector.

source

fn magnitude( &self, a_world_position: Vec2<f64>, b_world_position: Vec2<f64> ) -> f64

Magnitude.

source

fn compliance(&self) -> f64

Compliance.

Provided Methods§

source

fn apply( &mut self, a: &mut RigidBodyQuery<'_>, a_attachment: Vec2<f64>, b: &mut RigidBodyQuery<'_>, b_attachment: Vec2<f64>, apply_on_kinematic: bool, dt: f64 )

Calculate and apply the forces from the implemented methods.

Updates the lambda.

Object Safety§

This trait is not object safe.

Implementors§