Physics: contact enter/exit hysteresis around the 1 cm contact offset
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- C#
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 1 h 46 min
- PR fusionados (30 d)
- 41
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MASS4ORG/Turian
-
c:assets p:low size:XS t:task
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
c:engine p:medium sit:waiting size:L t:refactor
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
c:gaya p:medium sit:next t:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
c:graphics p:medium size:L t:enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
Todos los issues de MASS4ORG/Turian
Issues similares
-
[Bug] Dashboard renders attachment links that resolve to 404 when the FILES binding is absentAbiertobug 優先: 低
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
area-ai bug untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
dotnet/extensions#7893 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100