pub struct SolverSet {
pub body_sims: Vec<BodySim>,
pub body_states: Vec<BodyState>,
pub joint_sims: Vec<JointSim>,
pub contact_sims: Vec<ContactSim>,
pub island_sims: Vec<IslandSim>,
pub set_index: i32,
}Expand description
This holds solver set data. The following sets are used:
- static set for all static bodies and joints between static bodies
- active set for all active bodies with body states (no contacts or joints)
- disabled set for disabled bodies and their joints
- all further sets are sleeping island sets along with contacts and joints
The purpose of solver sets is to achieve high memory locality. https://www.youtube.com/watch?v=nZNd5FjSquk (b2SolverSet)
Fields§
§body_sims: Vec<BodySim>Body array. Empty for unused set.
body_states: Vec<BodyState>Body state only exists for active set
joint_sims: Vec<JointSim>This holds sleeping/disabled joints. Empty for static/active set.
contact_sims: Vec<ContactSim>This holds all contacts for sleeping sets. This holds non-touching contacts for the awake set.
island_sims: Vec<IslandSim>The awake set has an array of islands. Sleeping sets normally have a single island; joints created between sleeping sets cause sets to merge, leaving them with multiple islands that merge naturally when woken. The static and disabled sets have no islands.
set_index: i32Aligns with World::solver_set_id_pool. Used to create a stable id for body/contact/joint/islands.