draw debug motion arrows

This commit is contained in:
jacob 2024-03-11 19:48:51 -05:00
parent 4f52d24c94
commit c602220707

View File

@ -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);