Physics: contact enter/exit hysteresis around the 1 cm contact offset
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start in BepuEventSink (org.mass4.turian.physics.bepu) where solid contacts are reported, and read PhysicsSettings for configuration. Run the Example 12 box rain bench (headless Release) to measure exit rate, and review WakingASleepingBody_KeepsItsRestingContacts test. Done means a jittering pair gives one Enter and no Exit, exits per second fall well below tracked contacts, and new tests pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Current State
The Bepu backend (org.mass4.turian.physics.bepu, BepuEventSink) reports a solid contact once the deepest manifold point is within Unity's default 1 cm contact offset, and reports an exit on the first step a tracked pair is tested without reaching it. There is no hysteresis, so pairs whose separation hovers around -1 cm alternate Enter and Exit every few steps.
Measured in Example 12's box rain (headless, Release, 2026-10-24): about 12,000 exits per second against about 6,000 tracked contacts at 6k boxes. Every exit was between two awake bodies, so they come from this boundary flicker rather than sleeping or waking. That rate makes OnCollisionEnter/OnCollisionExit unusable for gameplay wiring such as damage, sounds or "is grounded" state.
Tasks
- Choose the policy: an exit grace period (keep a pair touching for N steps or T seconds after it was last found within the offset) or a dual threshold (enter within 1 cm, exit only beyond a larger distance, for example 2–3 cm). Compare against Unity/PhysX contact persistence where documented.
- Implement it in
BepuEventSinkfor solid contacts; decide whether triggers need the same treatment (they use depth ≥ 0 today). - Keep the contact points and impulse of a pair held through the grace period consistent (last real manifold or none).
- Make the threshold or grace configurable through
PhysicsSettingsif the choice is not obvious. - Add tests: a box resting on the ground with tiny vertical jitter gets one enter and no exit; a box lifted clearly away still exits within the configured bound.
- Re-measure the rain bench's exit rate; update the physics README and changelog.
Acceptance Criteria
- A resting or gently jittering pair produces a single Enter, Stays, and no spurious Exit.
- Real separations still exit within the configured grace period or distance.
- In the 6k-box rain bench, exits per second fall well below the tracked-contact count (target: an order of magnitude fewer than today).
- Island sleep/wake keeps resting contacts without exits, as covered by
WakingASleepingBody_KeepsItsRestingContacts.
Related
- #64 (physics backend, rigid bodies and collision)
- Lingua principale
- C#
- Stelle
- 1
- Fork
- 1
- Merge medio
- 2h
- PR unite (30g)
- 35
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MASS4ORG/Turian
-
c:assets p:low size:XS t:task
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
I maintainer di solito rispondono entro 1 giorno
-
c:engine p:medium sit:waiting size:L t:refactor
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
c:gaya p:medium sit:next t:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
c:graphics p:medium size:L t:enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MASS4ORG/Turian
Issue simili
-
[Bug] Dashboard renders attachment links that resolve to 404 when the FILES binding is absentApertabug 優先: 低
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
.NET area: storage bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Larson-Logan/medal-sync#61 ·
I maintainer di solito rispondono entro 1 giorno
-
area-ai bug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
dotnet/extensions#7893 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100