pub trait Constraint: Debug {
// Required methods
fn apply(&mut self, step: &mut Step);
fn priority(&self) -> isize;
fn body_idxs(&self) -> Vec<usize>;
fn init(&mut self, get_or_insert: impl FnMut(RigidBodyHandle) -> usize);
}Required Methods§
Sourcefn body_idxs(&self) -> Vec<usize>
fn body_idxs(&self) -> Vec<usize>
Indexes in the body buffer that this constraint will mutate. This is used to group mutually exclusive constraints to be evaluated in parallel.
Sourcefn init(&mut self, get_or_insert: impl FnMut(RigidBodyHandle) -> usize)
fn init(&mut self, get_or_insert: impl FnMut(RigidBodyHandle) -> usize)
Initialize the constraint with the ability to map rigid body handles
to indices in the bodies buffer passed to apply.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.