Function nphysics2d::resolution::projected_gauss_seidel_solve [] [src]

pub fn projected_gauss_seidel_solve<N: Real>(restitution: &mut [VelocityConstraint<N>],
                                             friction: &mut [VelocityConstraint<N>],
                                             result: &mut [Velocities<N>],
                                             num_bodies: usize,
                                             num_iterations: usize,
                                             is_lambda_zero: bool)

Solve a set of velocity constraints using the projected gauss seidel solver.

Arguments:

  • restitution - constraints to simulate the restitution.
  • friction - constraints to simulate friction.
  • result - vector which will contain the result afterward. Must have the size num_bodies.
  • num_bodies - the size of result.
  • num_iterations - the number of iterations to perform.
  • is_lambda_zero - indicates whether or not the every element of result has been reinitialized. Set this to false if the result comes from a previous execution of projected_gauss_seidel_solve: this will perform warm-starting.