group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
Sleep.hpp
Go to the documentation of this file.
1
14
15#pragma once
16
19
20namespace physics
21{
22
24{
26 float linearThresh = 0.5f;
27
29 float angularThresh = 0.1f;
30
32 uint16_t framesToSleep = 64;
33};
34
37void updateSleep(Registry& registry, const SleepConfig& cfg);
38
41void wakeIslandOf(Registry& registry, const ContactCache& cache, entt::entity e);
42
45void wakeBody(Registry& registry, entt::entity e);
46
47} // namespace physics
Per-pair contact manifold cache for warm-starting the solver.
Shared ECS registry type alias for the game engine.
entt::registry Registry
Shared ECS registry type alias.
Definition Registry.hpp:11
Definition ContactCache.hpp:26
Pure physics math — no ECS types, no registry.
Definition BroadphaseTree.cpp:11
void wakeIslandOf(Registry &registry, const ContactCache &cache, entt::entity start)
Wake every body that's currently in the same contact island as e.
Definition Sleep.cpp:54
void wakeBody(Registry &registry, entt::entity e)
Wake a single body (e.g.
Definition Sleep.cpp:46
void updateSleep(Registry &registry, const SleepConfig &cfg)
Update each body's sleep state from its current velocities.
Definition Sleep.cpp:17
Definition Sleep.hpp:24
float linearThresh
Linear velocity below which a body counts as "still".
Definition Sleep.hpp:26
float angularThresh
Angular velocity below which a body counts as "still".
Definition Sleep.hpp:29
uint16_t framesToSleep
Frames of stillness before a body sleeps (default ~0.5 s at 128 Hz).
Definition Sleep.hpp:32