=========================== ApplySolution applies the specified solution to the bodies under simulation. The solution is a set of linear and angular velocity deltas for each body. This method alters the solution arrays.
(sol *solver.Solution)
| 320 | // The solution is a set of linear and angular velocity deltas for each body. |
| 321 | // This method alters the solution arrays. |
| 322 | func (s *Simulation) ApplySolution(sol *solver.Solution) { |
| 323 | |
| 324 | // Add results to velocity and angular velocity of bodies |
| 325 | for i := 0; i < len(s.bodies); i++ { |
| 326 | s.bodies[i].ApplyVelocityDeltas(&sol.VelocityDeltas[i], &sol.AngularVelocityDeltas[i]) |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | // Store old collision state info |
| 331 | func (s *Simulation) collisionMatrixTick() { |
no test coverage detected