The SolverBodies for a set of particles.
Each IslandGroup owns a SolverBodyContainer containing the data required for solving the constraints in the group's islands. Constraints will hold pointers to SolverBodies in the Island's SolverBodyContainer. ConstraintSolvers read and write to their SolverBodies and do not access particles directly.
SolverBodies are created at the start of the constraint solving phase, and destroyed at the end. They are stored in a semi-contiguous (chunked) array in roughly the order that they are accessed for cache efficiency. Pointers to SolverBodies are persistent for the duration of the tick, but no longer.
- Note
- This container holds all the state of bodies in an island. Dynamics will only appear in one island, but kinematics are in multiple and so their state will be duplicated in each island. This is ok - we do not write to the state of any kinematic bodies in the constraint solvers. We also assume that the number of kinematics is small compared to the number of dynamics. If this is commonly untrue we may want to consider having a separate (global) container of kinematic solver bodies.