Constructor
new Solver(timeStep, iterationPerFrame, constraintIteration, particles, constraints, walls)
Instantiates new Solver
Name | Type | Description |
---|---|---|
timeStep | Number | the change in time per frame (smaller is more accurate) |
iterationPerFrame | Number | the amount of time the solver is called per frame (not substepping, timeStep remains constant) |
constraintIteration | Number | the amount of times the constraints are solved per frame |
particles | SpatialHashGrid | SpatialHashGrid of particles |
constraints | Array.<Constraint> | list of constraints |
walls | Array.<Wall> | list of walls |
- Source
Methods
nextFrame()
Computes next frame or "world-state"
- Source
solve()
Solves one iteration of the current physics world
- Source
update()
Optional function that can be defined to exhibit certain behavior in the solve loop.
- Source
updateSolverParticles()
Update the particle positions in the SpatialHashGrid
- Source