Skip to content

[Feature] Advanced collider-level collision details #206

Description

@vmarcella

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

pubstructColliderCollisionEvent{pubkind:CollisionEventKind,pubcollider_a:Collider2D,pubcollider_b:Collider2D,pubbody_a:RigidBody2D,pubbody_b:RigidBody2D,pubcontact_point:Option<[f32;2]>,pubnormal:Option<[f32;2]>,pubpenetration:Option<f32>,}implPhysicsWorld2D{pubfncollider_collision_events(&self,) -> implIterator<Item = ColliderCollisionEvent>;}

Acceptance Criteria

  • A public advanced event API exists for collider-level detail
  • The default body-oriented event stream remains unchanged
  • Collider handles are stable and documented if newly introduced
  • Compound bodies can be inspected at both body and collider granularity
  • Integration tests cover multiple colliders on one body
  • Docs clearly state when users should prefer body events vs.
    collider events

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.

Metadata

Metadata

Assignees

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