Skip to content

[Feature] 2D physics world and configuration #118

Description

@vmarcella

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

  • PhysicsWorld2D can be constructed with builder
  • Gravity is configurable (default 0, -9.81)
  • step() advances simulation by fixed timestep
  • World can exist without any bodies
  • Unit tests for world creation and stepping

Affected Crates

lambda-rs, lambda-rs-platform

Notes

  • Fixed timestep typically 1/60 second
  • Consider sub-stepping for stability

Activity

  1. added
    enhancementNew feature or request
    lambda-rsIssues pertaining to the core framework
    lambda-rs-platformIssues pertaining to the dependency & platform wrappers
    physicsAll things related to physics
    on Jan 25, 2026
  2. added a commit that references this issue on Feb 9, 2026
    1c624de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlambda-rsIssues pertaining to the core frameworklambda-rs-platformIssues pertaining to the dependency & platform wrappersphysicsAll things related to physics

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions