Overview
Add an optional persistent-contact event mode for PhysicsWorld2D so
gameplay code can observe pairs that remain in contact across consecutive
steps without reconstructing that state manually from Started and Ended.
Current State
The public API only exposes CollisionEventKind::{Started, Ended} in
crates/lambda-rs/src/physics/mod.rs. Users who need "stay" semantics must
cache active pairs in gameplay code and rebuild that view themselves.
Scope
Goals:
- Add an explicit persistent-contact event shape or access pattern
- Preserve the existing
Started and Ended semantics
- Keep the public API body-oriented by default
- Define whether persistent events fire once per step or once per substep
Non-Goals:
- Trigger volumes
- Per-collider event streams as the default API
- Contact impulse reporting in the first iteration
Proposed API
pub enum CollisionEventKind {
Started,
Stayed,
Ended,
}
impl PhysicsWorld2D {
pub fn collision_events(&self) -> impl Iterator<Item = CollisionEvent>;
}
Acceptance Criteria
Affected Crates
lambda-rs, lambda-rs-platform
Notes
- Adding
Stayed directly to collision_events() increases event volume.
- A separate iterator may be cleaner if most users only need enter/exit.
- Deterministic ordering requirements should be defined before adding a
steady-state event stream.
Overview
Add an optional persistent-contact event mode for
PhysicsWorld2Dsogameplay code can observe pairs that remain in contact across consecutive
steps without reconstructing that state manually from
StartedandEnded.Current State
The public API only exposes
CollisionEventKind::{Started, Ended}incrates/lambda-rs/src/physics/mod.rs. Users who need "stay" semantics mustcache active pairs in gameplay code and rebuild that view themselves.
Scope
Goals:
StartedandEndedsemanticsNon-Goals:
Proposed API
Acceptance Criteria
Startedfires once on contact beginEndedfires once when the pair separatesStarted/EndedAffected Crates
lambda-rs, lambda-rs-platform
Notes
Stayeddirectly tocollision_events()increases event volume.steady-state event stream.