11---
22title : " 2D Colliders"
33document_id : " colliders-2d-2026-02-17"
4- status : " draft "
4+ status : " living "
55created : " 2026-02-17T23:08:44Z"
6- last_updated : " 2026-02-17T23:37:05Z "
7- version : " 0.1.2 "
6+ last_updated : " 2026-03-14T22:54:24Z "
7+ version : " 0.1.3 "
88engine_workspace_version : " 2023.1.30"
99wgpu_version : " 26.0.1"
1010shader_backend_default : " naga"
1111winit_version : " 0.29.10"
12- repo_commit : " 43c91a76dec71326cc255ebb6fb6c6402e95735c "
12+ repo_commit : " 23dc1cbe0b87e772e92071ad170dfb70ced36f88 "
1313owners : ["lambda-sh"]
1414reviewers : ["engine"]
1515tags : ["spec", "physics", "2d", "lambda-rs", "platform"]
@@ -45,7 +45,7 @@ tags: ["spec", "physics", "2d", "lambda-rs", "platform"]
4545- Provide per-collider material properties (` density ` , ` friction ` ,
4646 ` restitution ` ) that influence contact resolution for participating bodies.
4747- Support a collider-local transform (offset and rotation) to enable oriented
48- shapes without requiring angular dynamics .
48+ shapes and compound-body contact layouts .
4949- Define a backend-agnostic behavior contract while allowing implementation via
5050 ` lambda-rs-platform ` (initially backed by ` rapier2d ` ).
5151
@@ -131,7 +131,7 @@ Module layout (new)
131131
132132### lambda-rs Public API
133133
134- Public entry points (draft )
134+ Public entry points (implemented )
135135
136136``` rust
137137/// Maximum supported vertices for `ColliderShape2D::ConvexPolygon`.
@@ -274,11 +274,13 @@ Collision detection
274274 - other dynamic bodies with colliders
275275
276276Collision response (normative)
277- - Contact resolution MUST update linear velocities for dynamic bodies such that
278- penetrations are resolved and restitution and friction affect motion.
279- - Angular dynamics are out of scope for the initial 2D physics surface.
280- Therefore, collision response MUST NOT introduce angular velocity and MUST
281- NOT change ` RigidBody2D ` rotation during ` step() ` .
277+ - Contact resolution MUST update dynamic-body motion such that penetrations are
278+ resolved and restitution and friction affect motion.
279+ - Collision response MAY change ` RigidBody2D ` rotation for dynamic bodies when
280+ contacts introduce torque through collider shape or local offset.
281+ - The public API does not currently expose explicit angular-velocity controls,
282+ but dynamic-body rotation observed through ` RigidBody2D ` state MUST remain
283+ backend-consistent.
282284
283285Material properties
284286- ` density ` MUST affect mass properties for dynamic bodies when the body mass
@@ -385,46 +387,45 @@ Errors (draft)
385387
386388## Requirements Checklist
387389
388- - [ ] Circle colliders detect collisions correctly.
389- - [ ] Rectangle colliders detect collisions correctly.
390- - [ ] Collider local rotation produces oriented shapes correctly.
391- - [ ] Capsule colliders support character-like shapes.
392- - [ ] Polygon colliders support arbitrary convex shapes.
393- - [ ] Multiple colliders attached to one body work together.
394- - [ ] Friction and restitution affect collision response.
395- - [ ] Density affects dynamic body mass when not explicitly set.
396- - [ ] No public vendor types are exposed from ` lambda-rs ` .
390+ - [x ] Circle colliders detect collisions correctly.
391+ - [x ] Rectangle colliders detect collisions correctly.
392+ - [x ] Collider local rotation produces oriented shapes correctly.
393+ - [x ] Capsule colliders support character-like shapes.
394+ - [x ] Polygon colliders support arbitrary convex shapes.
395+ - [x ] Multiple colliders attached to one body work together.
396+ - [x ] Friction and restitution affect collision response.
397+ - [x ] Density affects dynamic body mass when not explicitly set.
398+ - [x ] No public vendor types are exposed from ` lambda-rs ` .
397399
398400## Verification and Testing
399401
400402Unit tests (crate: ` lambda-rs ` )
401403- Validate ` Collider2DBuilder::build() ` rejects invalid parameters.
402404- Validate world mismatch and stale-handle behavior for ` Collider2D ` .
403405
404- Integration tests (crate: ` lambda-rs ` , ` crates/lambda-rs/tests/runnables.rs ` )
405- - Circle vs. circle:
406- - Two dynamic bodies with circle colliders converge, collide, and separate.
407- - Rectangle vs. rectangle:
408- - A dynamic box falls onto a static box and comes to rest.
409- - Oriented box:
410- - A rotated rectangle collider behaves as expected when colliding with a
411- static ground rectangle.
412- - Capsule character:
413- - A dynamic capsule falls onto a static ground rectangle and does not snag.
414- - Convex polygon:
415- - A dynamic convex polygon collides with a static rectangle.
416- - Compound shape:
417- - A dynamic body with two colliders collides as expected (both colliders
418- generate contacts).
419- - Friction and restitution:
420- - Restitution ` 0.0 ` yields minimal bounce; restitution ` 1.0 ` yields maximal
421- bounce in a controlled scenario.
422- - A slope test demonstrates friction affecting sliding behavior.
423-
424- Manual verification (optional)
425- - A minimal example MAY be added under ` crates/lambda-rs/examples/ ` to render a
426- simple debug visualization and visually verify compound shapes and capsule
427- behavior. This example MUST remain optional and gated behind ` physics-2d ` .
406+ Integration tests (crate: ` lambda-rs ` )
407+ - Integration entrypoint: ` crates/lambda-rs/tests/integration.rs ` .
408+ - Feature-specific physics tests: ` crates/lambda-rs/tests/physics_2d/ ` .
409+ - Shape coverage:
410+ - A dynamic circle collides with a static ground rectangle.
411+ - A dynamic capsule collides with a static ground rectangle.
412+ - A dynamic convex polygon collides with a static ground rectangle.
413+ - A rotated rectangle collider changes motion relative to an unrotated case.
414+ - Compound shape coverage:
415+ - A dynamic body with multiple colliders produces a wider effective collision
416+ extent than a single-collider body.
417+ - Material coverage:
418+ - Restitution affects bounce height.
419+ - Friction affects sliding velocity decay.
420+ - Density affects impulse-driven velocity change.
421+
422+ Manual verification
423+ - Demo binary: ` demos/physics/src/bin/physics_colliders_2d.rs ` .
424+ - The demo SHOULD be used to verify:
425+ - primitive shape rendering and contact behavior
426+ - local rotation and local offset behavior
427+ - compound-collider motion as one rigid body
428+ - density, friction, and restitution behavior
428429
429430## Compatibility and Migration
430431
@@ -440,3 +441,5 @@ Manual verification (optional)
440441- 2026-02-17 0.1.0: Define 2D collider shapes and attachment APIs.
441442- 2026-02-17 0.1.1: Specify defaults and mass recomputation rules.
442443- 2026-02-17 0.1.2: Add local rotation, material struct, and polygon limits.
444+ - 2026-03-14 0.1.3: Align the specification with the implemented rotation,
445+ testing, and demo behavior.
0 commit comments