Overview
Add 2D rigid bodies that can be added to the physics world with configurable
mass, velocity, and body type (static, dynamic, kinematic).
Current State
Requires PhysicsWorld2D to be implemented. No rigid body support exists.
Scope
Goals:
- Create static rigid bodies (immovable, infinite mass)
- Create dynamic rigid bodies (affected by forces/gravity)
- Create kinematic rigid bodies (user-controlled movement)
- Set position, rotation, velocity
- Apply forces and impulses
Non-Goals:
- Collision shapes
- Collision response
- Joints/constraints
Proposed API
pubenumRigidBodyType{Static,Dynamic,Kinematic,}pubstructRigidBody2D{// handle to physics world body}pubstructRigidBody2DBuilder{body_type:RigidBodyType,position:[f32;2],rotation:f32,mass:f32,}implRigidBody2DBuilder{pubfnnew(body_type:RigidBodyType) -> Self;pubfnwith_position(self,x:f32,y:f32) -> Self;pubfnwith_rotation(self,radians:f32) -> Self;pubfnwith_mass(self,mass:f32) -> Self;pubfnbuild(self,world:&mutPhysicsWorld2D) -> RigidBody2D;}implRigidBody2D{pubfnposition(&self) -> [f32;2];pubfnrotation(&self) -> f32;pubfnset_position(&mutself,x:f32,y:f32);pubfnset_velocity(&mutself,vx:f32,vy:f32);pubfnapply_force(&mutself,fx:f32,fy:f32);pubfnapply_impulse(&mutself,ix:f32,iy:f32);}Acceptance Criteria
Affected Crates
lambda-rs, lambda-rs-platform
Notes
- Bodies without shapes won't collide but can still move
- Handle system prevents dangling references
Overview
Add 2D rigid bodies that can be added to the physics world with configurable
mass, velocity, and body type (static, dynamic, kinematic).
Current State
Requires PhysicsWorld2D to be implemented. No rigid body support exists.
Scope
Goals:
Non-Goals:
Proposed API
Acceptance Criteria
Affected Crates
lambda-rs, lambda-rs-platform
Notes