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§
sourcefn gradient(
&self,
a_world_position: Vec2<f64>,
b_world_position: Vec2<f64>
) -> Vec2<f64>
fn gradient( &self, a_world_position: Vec2<f64>, b_world_position: Vec2<f64> ) -> Vec2<f64>
Direction normalized vector.
sourcefn magnitude(
&self,
a_world_position: Vec2<f64>,
b_world_position: Vec2<f64>
) -> f64
fn magnitude( &self, a_world_position: Vec2<f64>, b_world_position: Vec2<f64> ) -> f64
Magnitude.
sourcefn compliance(&self) -> f64
fn compliance(&self) -> f64
Compliance.
Provided Methods§
sourcefn apply(
&mut self,
a: &mut RigidBodyQuery<'_>,
a_attachment: Vec2<f64>,
b: &mut RigidBodyQuery<'_>,
b_attachment: Vec2<f64>,
apply_on_kinematic: bool,
dt: f64
)
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.