MCPcopy
hub / github.com/g3n/engine / ApplySolution

Method ApplySolution

experimental/physics/simulation.go:322–328  ·  view source on GitHub ↗

=========================== 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)

Source from the content-addressed store, hash-verified

320// The solution is a set of linear and angular velocity deltas for each body.
321// This method alters the solution arrays.
322func (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
331func (s *Simulation) collisionMatrixTick() {

Callers 1

internalStepMethod · 0.95

Calls 1

ApplyVelocityDeltasMethod · 0.80

Tested by

no test coverage detected