only draw collider line for circles
This commit is contained in:
parent
59361a60af
commit
c193e31cce
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user