|
group2 0.1.0
CSE 125 Group 2
|
Body sleeping + constraint-island detection. More...
Go to the source code of this file.
Classes | |
| struct | physics::SleepConfig |
Namespaces | |
| namespace | physics |
| Pure physics math — no ECS types, no registry. | |
Functions | |
| void | physics::updateSleep (Registry ®istry, const SleepConfig &cfg) |
| Update each body's sleep state from its current velocities. | |
| void | physics::wakeIslandOf (Registry ®istry, const ContactCache &cache, entt::entity e) |
| Wake every body that's currently in the same contact island as e. | |
| void | physics::wakeBody (Registry ®istry, entt::entity e) |
| Wake a single body (e.g. | |
Body sleeping + constraint-island detection.
Bodies whose energy stays below threshold for sleepTimerThreshold frames are flagged asleep (RigidBody::isAsleep) and skipped by the solver / integrator until something wakes them — usually a new contact from an awake body or an applied force/impulse.
Islands group contacts and joints into connected components of the constraint graph: an island sleeps only when all its bodies sleep, so e.g. a stack of boxes wakes all at once when the bottom one is kicked. Phase 12 ships per-body sleep — island-level sleep is set up via the wakeIslandsOf(...) helper that walks the contact graph.