From 37b929e148e5b003f68903eb9ee192d24517e683 Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 10 Mar 2025 15:03:05 +1100 Subject: point light --- c2.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'c2.cpp') diff --git a/c2.cpp b/c2.cpp index 1262241..58e33ff 100644 --- a/c2.cpp +++ b/c2.cpp @@ -760,6 +760,24 @@ struct C2 : public App { light.brightness = 1.0f; light.caster = true; } + { + auto l = world->create_entity(); + auto [t, light] = world->add(l); + t.mat = m4f::translate(m4f::identity(), v3f(-3.0f, 1.0f, 0.0f)); + light.colour = v3f(1.0f, 0.0f, 0.0f); + light.brightness = 5.0f; + light.caster = true; + light.range = 5.0f; + } + { + auto l = world->create_entity(); + auto [t, light] = world->add(l); + t.mat = m4f::translate(m4f::identity(), v3f(3.0f, 2.0f, 0.0f)); + light.colour = v3f(0.0f, 1.0f, 0.0f); + light.brightness = 5.0f; + light.caster = true; + light.range = 3.0f; + } { 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)); -- cgit v1.2.3-54-g00ecf