From c6022207078755278a537450d0498f2796568996 Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 11 Mar 2024 19:48:51 -0500 Subject: [PATCH] draw debug motion arrows --- src/user.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/user.c b/src/user.c index 2ad296ac..074bf484 100644 --- a/src/user.c +++ b/src/user.c @@ -276,6 +276,7 @@ INTERNAL void debug_draw_xform(struct xform xf) INTERNAL void debug_draw_movement(struct entity *ent) { f32 thickness = 2.f / PIXELS_PER_UNIT / L.world_view.zoom; + f32 arrow_len = 15.f / PIXELS_PER_UNIT / L.world_view.zoom; u32 color_vel = RGBA_F(1, 0.5, 0, 1); u32 color_acc = RGBA_F(1, 1, 0.5, 1); @@ -284,8 +285,8 @@ INTERNAL void debug_draw_movement(struct entity *ent) struct v2 vel_ray = ent->velocity; struct v2 acc_ray = ent->acceleration; - draw_solid_ray(L.world_canvas, pos, vel_ray, thickness, color_vel); - draw_solid_ray(L.world_canvas, pos, acc_ray, thickness, color_acc); + draw_solid_arrow_ray(L.world_canvas, pos, vel_ray, thickness, arrow_len, color_vel); + draw_solid_arrow_ray(L.world_canvas, pos, acc_ray, thickness, arrow_len, color_acc); } INTERNAL void user_update(void) @@ -714,14 +715,10 @@ INTERNAL void user_update(void) draw_text(L.screen_canvas, disp_font, pos, text); } +#endif debug_draw_xform(ent->world_xform); debug_draw_movement(ent); -#else - (UNUSED)view_xform_point; - (UNUSED)debug_draw_xform; - (UNUSED)debug_draw_movement; -#endif /* Draw hierarchy */ struct entity *parent = world_entity_from_handle(&L.world, ent->parent);