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 sizenum_bodies
.num_bodies
- the size ofresult
.num_iterations
- the number of iterations to perform.is_lambda_zero
- indicates whether or not the every element ofresult
has been reinitialized. Set this tofalse
if theresult
comes from a previous execution ofprojected_gauss_seidel_solve
: this will perform warm-starting.