Vendor Box2D v3.1.1 (erincatto/box2d) as a submodule; wired into
mk/vendor.mk (CMake static archive, samples/tests/benchmarks off) and
CPPFLAGS_BASE (-Ivendor/box2d/include). libkryon.a now depends on it.
Runtime:
- include/scene_tree.h: KryScene carries an opaque b2WorldId + physics_enabled;
KryScenePhysicsCreate/Destroy build/tear down the world; KryScenePhysicsTick
steps it via a function pointer installed by physics_world.c (keeps
scene_tree.c free of a box2d.h dependency)
- src/scene/physics_world.c: owns the only #include <box2d/box2d.h>; world
creation/step, body+shape creation helpers, transform sync
- src/scene/node_body2d.c: static/kinematic/dynamic body; creates b2Body on
ready, syncs transform on physics_process, debug-draws an outline
- src/scene/node_collision_shape2d.c: box/circle shape attached to the nearest
Body2D ancestor on ready
- src/scene/node_area2d.c: trigger volume (sensor) node
- include/node2d_props.h: Body2DProps/CollisionShape2DProps/Area2DProps +
allocators
- src/scene/scene_physics_internal.h: private bridge for Box2D-typed helpers
Example: examples/22_physics.kry (a dynamic box falling onto a static ground).