Flock::Collision::RigidBody2D
2D rigid body dynamics for an entity that also has a Collider2D.
Inverse mass/inertia are stored (0 == infinite) so the solver never divides.
Constructors
Solid box with half-extents (half_width, half_height).
I = 1/12 m ((2hw)^2 + (2hh)^2).
Solid disc of radius. I = 1/2 m r^2.
A movable body. A mass <= 0 is clamped to a tiny positive value (1e-6),
making the body effectively immovable-but-heavy yet still a valid Dynamic
body (it keeps feeling gravity/impulses) rather than an infinite-mass body
that silently skips gravity. inertia <= 0 still locks rotation.
Driven purely by its own velocity (moving platforms, elevators): it pushes dynamic bodies but is itself unaffected by gravity or impulses.
Class methods
Instance methods
Sleeping state (managed by the physics step): a body at rest is put to sleep and skipped by the solver until something wakes it.
Sleeping state (managed by the physics step): a body at rest is put to sleep and skipped by the solver until something wakes it.