Repository navigation
feat: add 2D physics subsystem with rapier2d - #18
Merged
Merged
Conversation
- add crate pite-physics implementing 2D physics via pure-Rust rapier2d - support StaticBody2D, CharacterBody2D, RigidBody2D, Area2D, CollisionShape2D - kinematic character controller with move_and_slide(), floor/wall/ceiling detection - dynamic rigid body simulation with forces, impulses, gravity scaling, mass - Area2D trigger zones with body_entered/exited and area_entered/exited signals - pite.raycast spatial queries returning intersection point, normal, distance, collider - fixed 60 Hz physics loop in GameSession with _physics_process dispatch - editor viewport wireframe overlays for box, circle, capsule shapes and inspector support - comprehensive unit and integration test coverage
mkh-user
force-pushed
the
feat/physics
branch
from
November 2, 2026 11:57
073e8bc to
b953ea5
Compare
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.
Description
This PR implements a pure-Rust 2D physics subsystem in Pite powered by
rapier2d 0.23(matching workspace MSRV 1.85), covering all roadmap phases:Phase 1: Core Physics & Nodes
pite-physicswithPhysicsWorld,BodyKind, andShapeConfig(Box, Circle, Capsule).pite-core:StaticBody2D,CharacterBody2D,RigidBody2D,Area2D,CollisionShape2D.GameSession(FIXED_STEP = 1.0 / 60.0), dispatching_physics_process(delta)across active scripts.Phase 2: CharacterBody2D & Area2D Triggers
move_and_slide(), sliding collision resolution (ignoring sensor areas), and surface normal floor/wall/ceiling detection.CharacterBody2D(move_and_slide,is_on_floor,is_on_wall,is_on_ceiling,velocity,up_direction).Area2Doverlap detection withActiveCollisionTypes::all()and wired built-in signals (body_entered,body_exited,area_entered,area_exited).Phase 3: RigidBody2D Dynamics & Spatial Raycasts
pite.raycast(from, to, mask)query returning hit point, normal, distance, collider node id, and body node id.Phase 4: Editor Tooling & Overlays
pite-editorfor box, circle, and capsule collision shapes when not playing.box,circle,capsule) and quick property initializer buttons.ops::add_node.Verification
cargo fmt --all -- --checkcargo build --workspace --lockedcargo test --workspace --locked(all crates passing, including new end-to-end physics tests)cargo run --locked -p pite-cli -- check