draw debug movement for kinematic objects

This commit is contained in:
jacob 2025-01-03 16:04:32 -06:00
parent 1bbe316b20
commit 9981b600a8
3 changed files with 5 additions and 4 deletions

View File

@ -1812,9 +1812,9 @@ INTERNAL void game_update(struct game_cmd_array game_cmds)
bullet->bullet_src = ent->handle;
bullet->bullet_src_pos = rel_pos;
bullet->bullet_src_dir = rel_dir;
bullet->bullet_impulse = 0.1f;
//bullet->bullet_impulse = 0.1f;
//bullet->bullet_impulse = 0.25f;
//bullet->bullet_impulse = 1.f;
bullet->bullet_impulse = 1.f;
bullet->mass_unscaled = 0.04f;
bullet->inertia_unscaled = 0.00001f;
bullet->sprite_collider_slice = STR("shape");
@ -2075,7 +2075,7 @@ INTERNAL void game_update(struct game_cmd_array game_cmds)
entity_enable_prop(decal, ENTITY_PROP_PHYSICAL_KINEMATIC);
decal->linear_velocity = v2_mul(v2_norm(event->normal), 0.5f);
decal->angular_velocity = ((f32)sys_rand_u32() / (f32)U32_MAX);
decal->angular_velocity = 1 - (((f32)sys_rand_u32() / (f32)U32_MAX) * 2);
}
}
}

View File

@ -462,6 +462,7 @@ struct mixed_pcm_f32 mixer_update(struct arena *arena, u64 frame_count)
/* ========================== *
* Mix into result
* ========================== */
for (u64 i = 0; i < mix_pcm.count; ++i) {
res.samples[i] += mix_pcm.samples[i] * desc.volume;
}

View File

@ -967,7 +967,7 @@ INTERNAL void user_update(void)
}
#endif
if (entity_has_prop(ent, ENTITY_PROP_PHYSICAL_DYNAMIC)) {
if (entity_has_prop(ent, ENTITY_PROP_PHYSICAL_DYNAMIC) || entity_has_prop(ent, ENTITY_PROP_PHYSICAL_KINEMATIC)) {
debug_draw_movement(ent);
}