Overview
Create a 2D physics world that manages rigid bodies, collision detection, and
physics simulation stepping. This is the foundation for all 2D physics.
Current State
No physics support exists in lambda-rs. Games cannot simulate physical
interactions.
Scope
Goals:
PhysicsWorld2D type managing the simulation
- Configurable gravity
- Fixed timestep integration
- Builder pattern for world creation
Non-Goals:
- 3D physics
- Rigid bodies
- Collision shapes
Proposed API
// crates/lambda-rs/src/physics/mod.rs
pub struct PhysicsWorld2D {
// rapier2d pipeline or similar
}
pub struct PhysicsWorld2DBuilder {
gravity: [f32; 2],
timestep: f32,
}
impl PhysicsWorld2DBuilder {
pub fn new() -> Self;
pub fn with_gravity(self, x: f32, y: f32) -> Self;
pub fn with_timestep(self, dt: f32) -> Self;
Acceptance Criteria
Affected Crates
lambda-rs, lambda-rs-platform
Notes
- Fixed timestep typically 1/60 second
- Consider sub-stepping for stability
Overview
Create a 2D physics world that manages rigid bodies, collision detection, and
physics simulation stepping. This is the foundation for all 2D physics.
Current State
No physics support exists in lambda-rs. Games cannot simulate physical
interactions.
Scope
Goals:
PhysicsWorld2Dtype managing the simulationNon-Goals:
Proposed API
Acceptance Criteria
step()advances simulation by fixed timestepAffected Crates
lambda-rs, lambda-rs-platform
Notes