summaryrefslogtreecommitdiff
path: root/c2.cpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-03-10 15:03:05 +1100
committerquou <quou@disroot.org>2025-03-10 15:03:05 +1100
commit37b929e148e5b003f68903eb9ee192d24517e683 (patch)
tree79c39617fa73ddc95f30f0ff2c86b5b81c6de0bc /c2.cpp
parent075e530b9964d1eb000dded329d2e8d80ee277c3 (diff)
point light
Diffstat (limited to 'c2.cpp')
-rw-r--r--c2.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/c2.cpp b/c2.cpp
index 1262241..58e33ff 100644
--- a/c2.cpp
+++ b/c2.cpp
@@ -761,6 +761,24 @@ struct C2 : public App {
light.caster = true;
}
{
+ auto l = world->create_entity();
+ auto [t, light] = world->add<Transform, Point_Light>(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<Transform, Point_Light>(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));
box = world->create_entity();