refactor(lambda-rs-platform): split rapier2d implementation across multiple #202
Merged
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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