Uh oh!
There was an error while loading. Please reload this page.
refactor(lambda-rs-platform): split rapier2d implementation across multiple - #202
Conversation
✅ Coverage Report📊 View Full HTML Report (download artifact) Overall Coverage
Changed Files in This PR
PR Files Coverage: 91.84% (890/969 lines) Generated by cargo-llvm-cov · Latest main coverage Last updated: 2026-04-03 20:50:34 UTC · Commit: |
There was a problem hiding this comment.
Pull request overview
Refactors the lambda-rs-platform Rapier-backed 2D physics backend by splitting the former single rapier2d.rs implementation into a folder-backed physics::rapier2d module, keeping the module path and public exports stable while improving navigability and maintainability.
Changes:
- Replaced
crates/lambda-rs-platform/src/physics/rapier2d.rswithcrates/lambda-rs-platform/src/physics/rapier2d/and amod.rsentrypoint. - Split backend implementation across focused submodules (
rigid_bodies,colliders,queries,simulation,helpers). - Moved existing unit tests into
rapier2d/tests.rswithout changing assertions/semantics.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/lambda-rs-platform/src/physics/rapier2d/mod.rs | New module entrypoint preserving public types/exports and wiring submodules. |
| crates/lambda-rs-platform/src/physics/rapier2d/rigid_bodies.rs | Rigid body creation/state/force APIs extracted into a dedicated module. |
| crates/lambda-rs-platform/src/physics/rapier2d/colliders.rs | Collider creation/attachment and debug slot validation extracted. |
| crates/lambda-rs-platform/src/physics/rapier2d/queries.rs | Point/AABB/raycast query helpers extracted. |
| crates/lambda-rs-platform/src/physics/rapier2d/simulation.rs | Stepping and collision event aggregation extracted. |
| crates/lambda-rs-platform/src/physics/rapier2d/helpers.rs | Shared helper functions extracted (validation, friction encoding, contact selection, etc.). |
| crates/lambda-rs-platform/src/physics/rapier2d/tests.rs | Unit tests moved from the old monolithic file into a module test file. |
| crates/lambda-rs-platform/src/physics/rapier2d.rs | Removed monolithic backend source file (superseded by folder-backed module). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Refactor the internal
lambda-rs-platform2D Rapier backend from a singlelarge source file into a
rapier2dmodule. This keeps theexisting backend behavior and public exports unchanged while making the code
easier to navigate and maintain.
Related Issues
N/A
Changes
crates/lambda-rs-platform/src/physics/rapier2d.rswith afolder-backed module at
crates/lambda-rs-platform/src/physics/rapier2d/.physics::rapier2dmodule path andPhysicsBackend2Dexports stable through
rapier2d/mod.rs.rigid_bodies.rscolliders.rsqueries.rssimulation.rshelpers.rstests.rstests.rswithout changing theirassertions or backend semantics.
Type of Change
Affected Crates
lambda-rslambda-rs-platformlambda-rs-argslambda-rs-loggingChecklist
cargo +nightly fmt --all)cargo clippy --workspace --all-targets -- -D warnings)cargo test --workspace)Testing
Commands run:
Manual verification steps (if applicable):
Screenshots/Recordings
N/A
Platform Testing
Additional Notes