Skip to content

Commit

Permalink
Replaced all function bindings in SLRaytracer and SLPathtracer with l…
Browse files Browse the repository at this point in the history
…ambdas
  • Loading branch information
hsm4 committed Jul 2, 2024
1 parent f7d3fe6 commit a0ea520
Show file tree
Hide file tree
Showing 11 changed files with 193 additions and 181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ void AppDemoSceneErlebARAventicumAmphitheater::registerAssetsToLoad(SLAssetLoade
AppCommon::dataPath +
"erleb-AR/models/avenches/avenches-amphitheater.gltf");

// initialize sensor stuff before loading the geotiff
AppCommon::devLoc.useOriginAltitude(false);
AppCommon::devLoc.nameLocations().push_back(SLLocation("Arena Centre, Origin", 46, 52, 51.685, 7, 2, 33.458, 461.4));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Entrance East, Manhole Cover", 46, 52, 52.344, 7, 2, 37.600, 461.4 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Arena, Sewer Cover West", 46, 52, 51.484, 7, 2, 32.307, 461.3 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Arena, Sewer Cover East", 46, 52, 51.870, 7, 2, 34.595, 461.1 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Stand South, Sewer Cover", 46, 52, 50.635, 7, 2, 34.099, 471.7 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Stand West, Sewer Cover", 46, 52, 51.889, 7, 2, 31.567, 471.7 + 1.7));
AppCommon::devLoc.originLatLonAlt(AppCommon::devLoc.nameLocations()[0].posWGS84LatLonAlt);
AppCommon::devLoc.activeNamedLocation(1); // This sets the location 1 as defaultENU
AppCommon::devLoc.locMaxDistanceM(1000.0f); // Max. Distanz. zum Nullpunkt
AppCommon::devLoc.improveOrigin(false); // Keine autom. Verbesserung vom Origin
AppCommon::devLoc.hasOrigin(true);
AppCommon::devLoc.offsetMode(LOM_twoFingerY);
AppCommon::devRot.zeroYawAtStart(false);
AppCommon::devRot.offsetMode(ROM_oneFingerX);

// This loads the DEM file and overwrites the altitude of originLatLonAlt and defaultLatLonAlt
al.addGeoTiffToLoad(AppCommon::devLoc,
AppCommon::dataPath +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ void AppDemoSceneErlebARAventicumCigognier::registerAssetsToLoad(SLAssetLoader&
AppCommon::dataPath +
"erleb-AR/models/avenches/avenches-cigognier.gltf");

// initialize sensor stuff before loading the geotiff
AppCommon::devLoc.useOriginAltitude(false);
AppCommon::devLoc.nameLocations().push_back(SLLocation("Center of place, Origin", 46, 52, 53.245, 7, 2, 47.198, 450.9));
AppCommon::devLoc.nameLocations().push_back(SLLocation("At the altar", 46, 52, 53.107, 7, 2, 47.498, 450.9 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Old AR viewer", 46, 52, 53.666, 7, 2, 48.316, 451.0 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Temple Entrance in hall", 46, 52, 54.007, 7, 2, 45.702, 453.0 + 1.7));
AppCommon::devLoc.originLatLonAlt(AppCommon::devLoc.nameLocations()[0].posWGS84LatLonAlt);
AppCommon::devLoc.activeNamedLocation(1); // This sets the location 1 as defaultENU
AppCommon::devLoc.locMaxDistanceM(1000.0f); // Max. allowed distance from origin
AppCommon::devLoc.improveOrigin(false); // No auto improvement from
AppCommon::devLoc.hasOrigin(true);
AppCommon::devLoc.offsetMode(LOM_twoFingerY);
AppCommon::devRot.zeroYawAtStart(false);
AppCommon::devRot.offsetMode(ROM_oneFingerX);

// This loads the DEM file and overwrites the altitude of originLatLonAlt and defaultLatLonAlt
al.addGeoTiffToLoad(AppCommon::devLoc,
AppCommon::dataPath +
Expand Down Expand Up @@ -115,21 +130,6 @@ void AppDemoSceneErlebARAventicumCigognier::assemble(SLAssetManager* am,
scene->addChild(_cigognier);
scene->addChild(cam1);

// initialize sensor stuff
AppCommon::devLoc.useOriginAltitude(false);
AppCommon::devLoc.nameLocations().push_back(SLLocation("Center of place, Origin", 46, 52, 53.245, 7, 2, 47.198, 450.9));
AppCommon::devLoc.nameLocations().push_back(SLLocation("At the altar", 46, 52, 53.107, 7, 2, 47.498, 450.9 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Old AR viewer", 46, 52, 53.666, 7, 2, 48.316, 451.0 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Temple Entrance in hall", 46, 52, 54.007, 7, 2, 45.702, 453.0 + 1.7));
AppCommon::devLoc.originLatLonAlt(AppCommon::devLoc.nameLocations()[0].posWGS84LatLonAlt);
AppCommon::devLoc.activeNamedLocation(1); // This sets the location 1 as defaultENU
AppCommon::devLoc.locMaxDistanceM(1000.0f); // Max. allowed distance from origin
AppCommon::devLoc.improveOrigin(false); // No auto improvement from
AppCommon::devLoc.hasOrigin(true);
AppCommon::devLoc.offsetMode(LOM_twoFingerY);
AppCommon::devRot.zeroYawAtStart(false);
AppCommon::devRot.offsetMode(ROM_oneFingerX);

#if defined(SL_OS_MACIOS) || defined(SL_OS_ANDROID)
AppCommon::devLoc.isUsed(true);
AppCommon::devRot.isUsed(true);
Expand Down
34 changes: 17 additions & 17 deletions apps/app_demo/source/scenes/AppDemoSceneErlebARAventicumTheater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ void AppDemoSceneErlebARAventicumTheater::registerAssetsToLoad(SLAssetLoader& al
AppCommon::dataPath +
"erleb-AR/models/avenches/avenches-theater.gltf");

// initialize sensor stuff before loading the geotiff
// https://map.geo.admin.ch/?lang=de&topic=ech&bgLayer=ch.swisstopo.swissimage&layers=ch.swisstopo.zeitreihen,ch.bfs.gebaeude_wohnungs_register,ch.bav.haltestellen-oev,ch.swisstopo.swisstlm3d-wanderwege&layers_opacity=1,1,1,0.8&layers_visibility=false,false,false,false&layers_timestamp=18641231,,,&E=2570281&N=1192204&zoom=13&crosshair=marker
AppCommon::devLoc.useOriginAltitude(false);
AppCommon::devLoc.nameLocations().push_back(SLLocation("Center of theatre, Origin", 46, 52, 49.041, 7, 2, 55.543, 454.9));
AppCommon::devLoc.nameLocations().push_back(SLLocation("On the stage", 46, 52, 49.221, 7, 2, 55.206, 455.5 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("At the tree (N-E)", 46, 52, 50.791, 7, 2, 55.960, 455.5 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Over the entrance (S)", 46, 52, 48.162, 7, 2, 56.097, 464.0 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("At the 3rd tree (S-W)", 46, 52, 48.140, 7, 2, 51.506, 455.0 + 1.7));
AppCommon::devLoc.originLatLonAlt(AppCommon::devLoc.nameLocations()[0].posWGS84LatLonAlt);
AppCommon::devLoc.activeNamedLocation(1); // This sets the location 1 as defaultENU
AppCommon::devLoc.locMaxDistanceM(1000.0f); // Max. Distanz. zum Nullpunkt
AppCommon::devLoc.improveOrigin(false); // Keine autom. Verbesserung vom Origin
AppCommon::devLoc.hasOrigin(true);
AppCommon::devLoc.offsetMode(LOM_twoFingerY);
AppCommon::devRot.zeroYawAtStart(false);
AppCommon::devRot.offsetMode(ROM_oneFingerX);

// This loads the DEM file and overwrites the altitude of originLatLonAlt and defaultLatLonAlt
al.addGeoTiffToLoad(AppCommon::devLoc,
AppCommon::dataPath +
Expand Down Expand Up @@ -117,23 +134,6 @@ void AppDemoSceneErlebARAventicumTheater::assemble(SLAssetManager* am,
scene->addChild(_theater);
scene->addChild(cam1);

// initialize sensor stuff
// https://map.geo.admin.ch/?lang=de&topic=ech&bgLayer=ch.swisstopo.swissimage&layers=ch.swisstopo.zeitreihen,ch.bfs.gebaeude_wohnungs_register,ch.bav.haltestellen-oev,ch.swisstopo.swisstlm3d-wanderwege&layers_opacity=1,1,1,0.8&layers_visibility=false,false,false,false&layers_timestamp=18641231,,,&E=2570281&N=1192204&zoom=13&crosshair=marker
AppCommon::devLoc.useOriginAltitude(false);
AppCommon::devLoc.nameLocations().push_back(SLLocation("Center of theatre, Origin", 46, 52, 49.041, 7, 2, 55.543, 454.9));
AppCommon::devLoc.nameLocations().push_back(SLLocation("On the stage", 46, 52, 49.221, 7, 2, 55.206, 455.5 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("At the tree (N-E)", 46, 52, 50.791, 7, 2, 55.960, 455.5 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("Over the entrance (S)", 46, 52, 48.162, 7, 2, 56.097, 464.0 + 1.7));
AppCommon::devLoc.nameLocations().push_back(SLLocation("At the 3rd tree (S-W)", 46, 52, 48.140, 7, 2, 51.506, 455.0 + 1.7));
AppCommon::devLoc.originLatLonAlt(AppCommon::devLoc.nameLocations()[0].posWGS84LatLonAlt);
AppCommon::devLoc.activeNamedLocation(1); // This sets the location 1 as defaultENU
AppCommon::devLoc.locMaxDistanceM(1000.0f); // Max. Distanz. zum Nullpunkt
AppCommon::devLoc.improveOrigin(false); // Keine autom. Verbesserung vom Origin
AppCommon::devLoc.hasOrigin(true);
AppCommon::devLoc.offsetMode(LOM_twoFingerY);
AppCommon::devRot.zeroYawAtStart(false);
AppCommon::devRot.offsetMode(ROM_oneFingerX);

#if defined(SL_OS_MACIOS) || defined(SL_OS_ANDROID)
AppCommon::devLoc.isUsed(true);
AppCommon::devRot.isUsed(true);
Expand Down
22 changes: 11 additions & 11 deletions apps/app_demo/source/scenes/AppDemoSceneErlebARBielBFH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ void AppDemoSceneErlebARBielBFH::registerAssetsToLoad(SLAssetLoader& al)
AppCommon::shaderPath + "PerPixTmBackground.vert",
AppCommon::shaderPath + "PerPixTmBackground.frag");

// initialize sensor stuff before loading the geotiff
AppCommon::devLoc.originLatLonAlt(47.14271, 7.24337, 488.2); // Ecke Giosa
AppCommon::devLoc.defaultLatLonAlt(47.14260, 7.24310, 488.7 + 1.7); // auf Parkplatz
AppCommon::devLoc.locMaxDistanceM(1000.0f);
AppCommon::devLoc.improveOrigin(false);
AppCommon::devLoc.useOriginAltitude(true);
AppCommon::devLoc.hasOrigin(true);
AppCommon::devLoc.offsetMode(LOM_twoFingerY);
AppCommon::devRot.zeroYawAtStart(false);
AppCommon::devRot.offsetMode(ROM_oneFingerX);

// This loads the DEM file and overwrites the altitude of originLatLonAlt and defaultLatLonAlt
al.addGeoTiffToLoad(AppCommon::devLoc,
AppCommon::dataPath +
Expand Down Expand Up @@ -117,17 +128,6 @@ void AppDemoSceneErlebARBielBFH::assemble(SLAssetManager* am, SLSceneView* sv)
scene->addChild(_bfh);
scene->addChild(cam1);

// initialize sensor stuff
AppCommon::devLoc.originLatLonAlt(47.14271, 7.24337, 488.2); // Ecke Giosa
AppCommon::devLoc.defaultLatLonAlt(47.14260, 7.24310, 488.7 + 1.7); // auf Parkplatz
AppCommon::devLoc.locMaxDistanceM(1000.0f);
AppCommon::devLoc.improveOrigin(false);
AppCommon::devLoc.useOriginAltitude(true);
AppCommon::devLoc.hasOrigin(true);
AppCommon::devLoc.offsetMode(LOM_twoFingerY);
AppCommon::devRot.zeroYawAtStart(false);
AppCommon::devRot.offsetMode(ROM_oneFingerX);

#if defined(SL_OS_MACIOS) || defined(SL_OS_ANDROID)
AppCommon::devLoc.isUsed(true);
AppCommon::devRot.isUsed(true);
Expand Down
Loading

0 comments on commit a0ea520

Please sign in to comment.