From 73d7f8325aeb00cbaec89a1c15602b9bd85ff04e Mon Sep 17 00:00:00 2001 From: quou Date: Fri, 7 Feb 2025 00:34:44 +1100 Subject: collision yes/no --- c2.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'c2.cpp') diff --git a/c2.cpp b/c2.cpp index db9239b..73927ad 100644 --- a/c2.cpp +++ b/c2.cpp @@ -742,10 +742,14 @@ struct C2 : public App { box_col = make_box(&asset_arena, v3f(1.0f, 1.0f, 1.0f)); floor_col = make_box(&asset_arena, v3f(10.0f, 0.1f, 10.0f)); box = world->create_entity(); - auto [trans, rb] = world->add(box); + auto [trans, rb, mod] = world->add(box); trans.mat = m4f::identity(); rb.init(box_col, v3f(0.0f, 5.0f, 0.0f), quat::identity(), 1.0f); rb.add_force(v3f(0.4f, -1.0f, 0.0f), v3f(0.0f, 0.1f, 0.0f)); + mod.i = scene.instantiate( + dev, + (Model*)assets.load("cube.mdl") + ); floor = world->create_entity(); auto [transf, rbf] = world->add(floor); @@ -781,7 +785,12 @@ struct C2 : public App { if (es.pause_physics) phys_dt = 0.0f; - physics_update(*world, &frame_arena, phys_dt); + physics_update( + *world, + &frame_arena, + phys_dt, + editor_physics_debughook() + ); dev->begin_frame(); lr.begin(w, h); -- cgit v1.2.3-54-g00ecf