skip toi between non-bullets
This commit is contained in:
parent
1849f1143a
commit
f4d8ec73e7
@ -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 (!(entity_has_prop(e0, ENTITY_PROP_PHYSICAL_DYNAMIC) || entity_has_prop(e0, ENTITY_PROP_PHYSICAL_KINEMATIC))) continue;
|
||||||
if (e0->local_collider.count <= 0) 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 collider_shape e0_collider = e0->local_collider;
|
||||||
struct xform e0_xf_t0 = entity_get_xform(e0);
|
struct xform e0_xf_t0 = entity_get_xform(e0);
|
||||||
struct xform e0_xf_t1 = e0_xf_t0;
|
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 (!(entity_has_prop(e1, ENTITY_PROP_PHYSICAL_DYNAMIC) || entity_has_prop(e1, ENTITY_PROP_PHYSICAL_KINEMATIC))) continue;
|
||||||
if (e1->local_collider.count <= 0) 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 collider_shape e1_collider = e1->local_collider;
|
||||||
struct xform e1_xf_t0 = entity_get_xform(e1);
|
struct xform e1_xf_t0 = entity_get_xform(e1);
|
||||||
struct xform e1_xf_t1 = e1_xf_t0;
|
struct xform e1_xf_t1 = e1_xf_t0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user