Overview
Add an advanced API that exposes collider-level contact information for users
who need per-shape detail, while keeping the default public event system
body-oriented.
Current State
The public event stream aggregates collider pairs into one RigidBody2D pair.
That is the correct default for gameplay code, but it hides which attached
shape on a compound body actually participated in contact.
Scope
Goals:
- Add an opt-in advanced collision view for per-collider detail
- Preserve the current body-oriented event stream as the default API
- Avoid leaking backend vendor types into the public surface
- Define stable handle types for colliders if needed
Non-Goals:
- Replacing the body-oriented API
- Per-substep callbacks
- Full backend manifold exposure
Proposed API
pub struct ColliderCollisionEvent {
pub kind: CollisionEventKind,
pub collider_a: Collider2D,
pub collider_b: Collider2D,
pub body_a: RigidBody2D,
pub body_b: RigidBody2D,
pub contact_point: Option<[f32; 2]>,
pub normal: Option<[f32; 2]>,
pub penetration: Option<f32>,
}
impl PhysicsWorld2D {
pub fn collider_collision_events(
&self,
) -> impl Iterator<Item = ColliderCollisionEvent>;
}
Acceptance Criteria
Affected Crates
lambda-rs, lambda-rs-platform
Notes
- This should not be treated as the primary gameplay API.
- The design is stronger if the same backend data can feed both views.
Overview
Add an advanced API that exposes collider-level contact information for users
who need per-shape detail, while keeping the default public event system
body-oriented.
Current State
The public event stream aggregates collider pairs into one
RigidBody2Dpair.That is the correct default for gameplay code, but it hides which attached
shape on a compound body actually participated in contact.
Scope
Goals:
Non-Goals:
Proposed API
Acceptance Criteria
collider events
Affected Crates
lambda-rs, lambda-rs-platform
Notes