Skip to content

Commit aae44f7

Browse files
committed
[update] documentation
1 parent 23dc1cb commit aae44f7

File tree

2 files changed

+58
-52
lines changed

2 files changed

+58
-52
lines changed

docs/features.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: "Cargo Features Overview"
33
document_id: "features-2025-11-17"
44
status: "living"
55
created: "2025-11-17T23:59:00Z"
6-
last_updated: "2026-02-13T20:47:25Z"
7-
version: "0.1.16"
6+
last_updated: "2026-03-14T22:54:24Z"
7+
version: "0.1.17"
88
engine_workspace_version: "2023.1.30"
99
wgpu_version: "26.0.1"
1010
shader_backend_default: "naga"
1111
winit_version: "0.29.10"
12-
repo_commit: "c66de56f04d6d3f9866eb8d7e48847f3882aad28"
12+
repo_commit: "23dc1cbe0b87e772e92071ad170dfb70ced36f88"
1313
owners: ["lambda-sh"]
1414
reviewers: ["engine", "rendering"]
1515
tags: ["guide", "features", "validation", "cargo", "audio", "physics"]
@@ -89,11 +89,13 @@ Audio
8989

9090
Physics
9191
- `physics-2d` (umbrella, disabled by default): enables the 2D physics world
92-
APIs (for example, `lambda::physics::PhysicsWorld2D` and
93-
`lambda::physics::RigidBody2D`). This feature enables the platform physics
94-
backend via `lambda-rs-platform/physics-2d` (currently backed by `rapier2d`).
95-
Expected runtime cost depends on simulation workload; no runtime cost is
96-
incurred unless a physics world is constructed, populated, and stepped.
92+
APIs (for example, `lambda::physics::PhysicsWorld2D`,
93+
`lambda::physics::RigidBody2D`, `lambda::physics::Collider2D`, and
94+
`lambda::physics::Collider2DBuilder`). This feature enables the platform
95+
physics backend via `lambda-rs-platform/physics-2d` (currently backed by
96+
`rapier2d`). Expected runtime cost depends on simulation workload, collider
97+
count, and contact density; no runtime cost is incurred unless a physics
98+
world is constructed, populated, and stepped.
9799

98100
Render validation
99101

@@ -173,6 +175,7 @@ Physics
173175
`rapier2d` directly via this crate.
174176

175177
## Changelog
178+
- 0.1.17 (2026-03-14): Update `physics-2d` coverage to include 2D colliders.
176179
- 0.1.16 (2026-02-13): Document 2D rigid bodies under `physics-2d` and update
177180
metadata.
178181
- 0.1.15 (2026-02-10): Document `audio-playback` in `lambda-rs` and update

docs/specs/physics/colliders-2d.md

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
title: "2D Colliders"
33
document_id: "colliders-2d-2026-02-17"
4-
status: "draft"
4+
status: "living"
55
created: "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"
88
engine_workspace_version: "2023.1.30"
99
wgpu_version: "26.0.1"
1010
shader_backend_default: "naga"
1111
winit_version: "0.29.10"
12-
repo_commit: "43c91a76dec71326cc255ebb6fb6c6402e95735c"
12+
repo_commit: "23dc1cbe0b87e772e92071ad170dfb70ced36f88"
1313
owners: ["lambda-sh"]
1414
reviewers: ["engine"]
1515
tags: ["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

276276
Collision 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

283285
Material 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

400402
Unit 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

Comments
 (0)