From c193e31ccee5d28d2961bf5a56f79a6414cefe73 Mon Sep 17 00:00:00 2001 From: jacob Date: Thu, 10 Oct 2024 13:24:08 -0500 Subject: [PATCH] only draw collider line for circles --- src/game.c | 4 ++-- src/user.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/game.c b/src/game.c index ef6ec6a7..72029cd8 100644 --- a/src/game.c +++ b/src/game.c @@ -1054,11 +1054,11 @@ INTERNAL void game_update(struct game_cmd_array game_cmds) #if 1 if (entity_has_prop(ent, ENTITY_PROP_PLAYER_CONTROLLED)) { //if ((true)) { -#if 1 +#if 0 ent->local_collider.points[0] = V2(0, 0); ent->local_collider.count = 1; ent->local_collider.radius = 0.5; -#elif 0 +#elif 1 ent->local_collider.points[0] = V2(0, 0.5); ent->local_collider.points[1] = V2(0, -0.5); ent->local_collider.count = 2; diff --git a/src/user.c b/src/user.c index e3318ff5..e895b8f6 100644 --- a/src/user.c +++ b/src/user.c @@ -1001,13 +1001,12 @@ INTERNAL void user_update(void) //u32 detail = 32; u32 detail = 512; draw_solid_collider_line(G.viewport_canvas, G.world_view, collider, xf, thickness, color, detail); - { + if (collider.count == 1 && collider.radius > 0) { + /* Draw upwards line for circle */ struct v2 start = xf.og; struct v2 end = collider_support_point(&collider, xf, v2_neg(xf.by)); start = xform_mul_v2(G.world_view, start); end = xform_mul_v2(G.world_view, end); - - /* Draw upwards line */ draw_solid_line(G.viewport_canvas, start, end, thickness, color); } }