Skip to content

Physics: add triggers/sensors (non-solid overlap colliders) #559

Description

@stormmuller

Problem

Every collider in src/physics is solid — there's no way to detect overlap between two shapes without the collision-resolution system also applying an impulse to separate them. Trigger volumes (pickups, checkpoints, damage zones, area-of-effect regions) are a standard building block missing from the engine.

Impact

Any game needing "detect overlap but don't physically resolve it" behavior currently has to hack it (e.g. by manually checking AABB/shape overlap outside the physics module, duplicating narrow-phase logic), or can't build it cleanly at all.

Suggested fix

  • Add an isTrigger (or similarly named) flag to collider components.
  • Narrow phase should still detect overlaps for trigger colliders, but the collision-resolution system should skip impulse/penetration-correction for any contact involving a trigger.
  • Emit enter/stay/exit overlap events (or expose queryable overlap state) so game code can react, consistent with the engine's existing event system (ForgeEvent).

Acceptance criteria

  • A collider can be marked as a trigger and produces overlap detection without physical resolution
  • Trigger-vs-solid and trigger-vs-trigger behave correctly (no impulses applied)
  • Enter/exit overlap is observable by game code
  • Covered by physics unit tests
  • Documented in documentation-site/docs/docs/physics

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions