diff options
author | quou <quou@disroot.org> | 2025-02-07 00:34:44 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-02-07 00:34:44 +1100 |
commit | 73d7f8325aeb00cbaec89a1c15602b9bd85ff04e (patch) | |
tree | fbef9f89fad53a86882aab0b17a2ff2d7290ad41 /c2.cpp | |
parent | 5d09e4f0880b182a2f4c89508744c27823ed554e (diff) |
collision yes/no
Diffstat (limited to 'c2.cpp')
-rw-r--r-- | c2.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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<Transform, Rigidbody>(box); + auto [trans, rb, mod] = world->add<Transform, Rigidbody, C_Model>(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<Transform, Rigidbody>(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); |