feat: migrate physics to Rapier via a ports & adapters boundary #122
No reviewers
Labels
No labels
atmosphere
clouds
debug
enhancement
foundation
high-priority
integration
low-priority
medium-priority
optimization
pbr
weather
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
akadmin/NemesisEngine!122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/rapier-physics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces ADR-0028's hand-rolled AABB-only physics with real Rapier dynamics,
reached through an engine-owned
PhysicsBackendport(
src/physics/mod.rs) with a singleRapierBackendadapter(
src/physics/rapier_backend.rs) — the only file in the codebase thatimports
rapier3d/nalgebra.Collider/RigidBodystay plain,serializable ECS data rather than becoming Rapier handles, so
EntityFileserialization, the Play/Stop snapshot, undo commands, andthe inspector all keep working with zero structural changes.
raycasts (
world.raycast), triggers (reuse existingon_collision_*hooks, no new API), collision filtering (layer/mask), CCD opt-in.
report-only behavior — an intentional gameplay improvement, called
out in ADR-0063.
Is Trigger checkbox, Layer/Mask fields, and CCD Enabled checkbox, all
through the existing Add/Set/undo command pattern.
docs/physics.mdreference doc;docs/adr/adr-0063-rapier-physics.mddocuments the port/adapter decision (supersedes ADR-0028).
.nmsscnchange:Collider'shalf_extentsfield becamea
shapeenum (pre-1.0 engine, no migration shim — existing scenesneed
Colliderre-added by hand after loading).Test plan
cargo test --all-targets— 530 tests pass (20 new/ported physicstests, incl. a genuine CCD tunneling-prevention proof)
cargo clippy --all-targets -- -D warningscleancargo fmt -- --checkcleangrep -rn "rapier3d\|nalgebra" src/outsidesrc/physics/rapier_backend.rsreturns nothingtrigger/layer/mask/CCD fields) — not done in this session, no
interactive display available
🤖 Generated with Claude Code
https://claude.ai/code/session_01MiL3vun3afMGxun4WoDDMa