summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-13 10:05:58 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-13 10:05:58 +0000
commit48a5de8943bda62ba5caefe3b64c66a0d9024dff (patch)
treee9b02e83f17bb0c5bd33071cf96401790a4cb35d
parentUpdate point light shaders for instancing (diff)
downloadilt-48a5de8943bda62ba5caefe3b64c66a0d9024dff.tar.bz2
ilt-48a5de8943bda62ba5caefe3b64c66a0d9024dff.tar.xz
ilt-48a5de8943bda62ba5caefe3b64c66a0d9024dff.zip
Add old street lamp model
-rw-r--r--res/lights.xml10
-rw-r--r--test/test-assetFactory.cpp9
2 files changed, 17 insertions, 2 deletions
diff --git a/res/lights.xml b/res/lights.xml
index 6c051c3..8b25599 100644
--- a/res/lights.xml
+++ b/res/lights.xml
@@ -9,6 +9,16 @@
</bodyMesh>
<spotLight position="0,1400,4100" direction="0,0.1,-1" colour=".9,.9,.9" kq="0.3" arc="1.8"/>
</asset>
+ <asset p.typeid="Illuminator" id="old-lamp" name="old-lamp">
+ <bodyMesh id="body">
+ <use type="cylinder" scale="0.13,0.13,.5" colour="#222222"/>
+ <use type="cylinder" scale="0.06,0.06,1.5" position="0,0,.5" colour="#222222"/>
+ <use type="cuboid" scale="0.3,0.02,0.02" position="0,0,1.8" colour="#222222"/>
+ <use type="cuboid" scale="0.2,0.2,0.4" position="0,0,2" colour="#dddddd"/>
+ <use type="cuboid" scale="0.1,0.1,0.1" position="0,0,2.4" colour="#222222"/>
+ </bodyMesh>
+ <pointLight position="0,0,2200" colour=".9,.9,.6" kq="0.3"/>
+ </asset>
<!-- yes I'm hacking some floor to light up as though its a bush -->
<asset p.typeid="Foliage" id="floor" name="floor">
<bodyMesh id="body">
diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp
index 9e278c4..8341fbf 100644
--- a/test/test-assetFactory.cpp
+++ b/test/test-assetFactory.cpp
@@ -133,14 +133,19 @@ BOOST_AUTO_TEST_CASE(lights, *boost::unit_test::timeout(5))
BOOST_REQUIRE(mf);
auto rlight = mf->assets.at("r-light");
BOOST_REQUIRE(rlight);
+ auto oldlamp = mf->assets.at("old-lamp");
+ BOOST_REQUIRE(oldlamp);
auto rlight_f = std::dynamic_pointer_cast<Illuminator>(rlight);
BOOST_REQUIRE(rlight_f);
+ auto oldlamp_f = std::dynamic_pointer_cast<Illuminator>(oldlamp);
+ BOOST_REQUIRE(oldlamp_f);
- auto light1 = std::make_shared<Light>(rlight_f, Location {{0, 0, 0}, {0, 0, 0}});
+ auto light1 = std::make_shared<Light>(oldlamp_f, Location {{0, 0, 0}, {0, 0, 0}});
auto light2 = std::make_shared<Light>(rlight_f, Location {{-4000, 0, 0}, {0, 2, 0}});
auto light3 = std::make_shared<Light>(rlight_f, Location {{-4000, -4000, 0}, {0, 1, 0}});
- auto light4 = std::make_shared<Light>(rlight_f, Location {{3000, 4600, 0}, {0, 3, 0}});
+ auto light4 = std::make_shared<Light>(oldlamp_f, Location {{3000, 4600, 0}, {0, 2, 0}});
objects.objects.push_back(rlight_f);
+ objects.objects.push_back(oldlamp_f);
// yes I'm hacking some floor to light up as though its a bush
auto floorf = std::dynamic_pointer_cast<Foliage>(mf->assets.at("floor"));