Struct mgf::ContactSolver
[−]
[src]
pub struct ContactSolver<'a, Params = DefaultContactSolverParams> where
Params: ContactSolverParams, { /* fields omitted */ }
A PGE based constraint solver for contacts.
Methods
impl<'a, Params: ContactSolverParams> ContactSolver<'a, Params>
[src]
fn new() -> Self
[src]
Construct a new empty solver
fn with_capacity(cap: usize) -> Self
[src]
Construct a new empty solver with a given capacity
fn add_constraint<'b, 'c>(
&mut self,
obj_a: &'b mut PhysicsObject,
obj_b: &'c mut PhysicsObject,
manifold: Manifold,
dt: f32
) where
'b: 'a,
'c: 'a,
[src]
&mut self,
obj_a: &'b mut PhysicsObject,
obj_b: &'c mut PhysicsObject,
manifold: Manifold,
dt: f32
) where
'b: 'a,
'c: 'a,
Add a constraint to the solver and pre-solve the constraint.
Unfortunately this interface requires taking two mutable references, so it's hard to work with this interface safely.
fn solve(&mut self, iters: usize)
[src]
Solves the added constraints and updates the inserted physics objects with the correct new velocities.