- Backend: Box2D 2.4.2 (MIT) vendored and compiled with a small C shim (
crates/physics2d). Unity's Physics2D runs Box2D v2 with its tuning constants exposed as settings; ours are patched into runtime values (velocity threshold, Baumgarte scales, correction limits, sleep tolerances, contact offset as the polygon skin). - Matched to Unity by recording (
physics2d_basic, 409 checks, worst at 5% of tolerance). Behaviors found and reproduced, each with aTassix:patch or code comment:- maxTranslationSpeed and maxRotationSpeed are per step;
- only Continuous bodies use time of impact, so Discrete bodies tunnel;
- triggers report overlaps as of the end of the step, while solid contacts keep Box2D's start-of-step timing;
- contact data and relative velocities are captured when the contact begins, as point velocities at that moment;
- contacts are created and reported oldest first (pairs sorted by proxy, as in Box2D 2.3), and so are exits when fixtures go;
- Unity's capsules are true capsules (exact caps, one contact point), with an inertia formula fitted to Unity's to 5e-8, plus Unity's minimum half-length;
- polygon raycasts hit edgeRadius rounding but not the contact skin;
- casts are time-of-impact sweeps (3 linear slops deep, hit point midway);
- an infinite ray's fraction is its distance;
- teleports wake bodies;
- exits are sent immediately on disable, deactivate and Destroy;
- trigger messages go to the other collider first.
- Scripting API:
Rigidbody2D(body types, forces and impulses, MovePosition/MoveRotation, constraints, sleep modes, auto mass, Unity 6 and older property names), Box/Circle/Capsule/Polygon (concave paths decomposed)/EdgeCollider2D,PhysicsMaterial2Dwith combine modes,Physics2Dsettings, layer matrix, IgnoreCollision, Raycast/Linecast/Circle/Box/CapsuleCast (All/NonAlloc/ContactFilter2D), Overlap Point/Circle/Box/Area/Capsule, IsTouching(Layers),Collision2D/ContactPoint2D/RaycastHit2D(implicit bool), and the OnCollision*2D/OnTrigger*2D messages. - MCP:
scene_open/scene_savelet an agent load and play sample scenes. - Milestone (2D half):
platformer2d_physics.jsonwith tutorial-style scripts: a Rigidbody2D player with OverlapCircle ground checks, coins, spikes, a raycasting walker you can stomp, a smoothed follow camera, and tile-map colliders merged per row. An MCP e2e test opens the scene, runs with D held and jumps with Space onto a platform, collecting coins. Both halves of the Phase 3 milestone now run.
Phase 3 · Slice 3 ·