From f4d8ec73e709c370520943ebfce94213ba17e0bd Mon Sep 17 00:00:00 2001 From: jacob Date: Fri, 10 Jan 2025 14:32:03 -0600 Subject: [PATCH] skip toi between non-bullets --- src/game.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/game.c b/src/game.c index 657effa3..32193233 100644 --- a/src/game.c +++ b/src/game.c @@ -1597,6 +1597,8 @@ INTERNAL f32 determine_earliest_toi(f32 dt, f32 tolerance, u32 max_iterations) if (!(entity_has_prop(e0, ENTITY_PROP_PHYSICAL_DYNAMIC) || entity_has_prop(e0, ENTITY_PROP_PHYSICAL_KINEMATIC))) continue; if (e0->local_collider.count <= 0) continue; + b32 e0_is_bullet = entity_has_prop(e0, ENTITY_PROP_BULLET); + struct collider_shape e0_collider = e0->local_collider; struct xform e0_xf_t0 = entity_get_xform(e0); struct xform e0_xf_t1 = e0_xf_t0; @@ -1618,6 +1620,11 @@ INTERNAL f32 determine_earliest_toi(f32 dt, f32 tolerance, u32 max_iterations) if (!(entity_has_prop(e1, ENTITY_PROP_PHYSICAL_DYNAMIC) || entity_has_prop(e1, ENTITY_PROP_PHYSICAL_KINEMATIC))) continue; if (e1->local_collider.count <= 0) continue; + b32 e1_is_bullet = entity_has_prop(e1, ENTITY_PROP_BULLET); + + /* Skip check if neither e0 or e1 are bullets */ + if (!e0_is_bullet && !e1_is_bullet) continue; + struct collider_shape e1_collider = e1->local_collider; struct xform e1_xf_t0 = entity_get_xform(e1); struct xform e1_xf_t1 = e1_xf_t0;