Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Physics: contact enter/exit hysteresis around the 1 cm contact offset

Abierto
#323 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp
Área
game-dev

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

c:engine p:medium size:S t:enhancement

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 BepuEventSink for 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 PhysicsSettings if 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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MASS4ORG/Turian

Todos los issues de MASS4ORG/Turian

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.