mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 02:29:49 -06:00
Merge with master branch
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
#include <openspace/engine/configuration.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/wrapper/sgctwindowwrapper.h>
|
||||
#include <openspace/util/keys.h>
|
||||
@@ -74,6 +74,8 @@ namespace {
|
||||
constexpr const char* _loggerCat = "main";
|
||||
sgct::Engine* SgctEngine;
|
||||
|
||||
openspace::interaction::JoystickInputStates joystickInputStates;
|
||||
|
||||
constexpr const char* OpenVRTag = "OpenVR";
|
||||
constexpr const char* SpoutTag = "Spout";
|
||||
|
||||
@@ -311,10 +313,10 @@ void mainInitFunc() {
|
||||
#endif // OPENSPACE_HAS_SPOUT
|
||||
}
|
||||
|
||||
std::string k = openspace::ConfigurationManager::KeyScreenshotUseDate;
|
||||
std::string screenshotPath = "${SCREENSHOTS}";
|
||||
std::string screenshotNames = "OpenSpace";
|
||||
if (OsEng.configurationManager().hasKey(k)) {
|
||||
|
||||
if (OsEng.configuration().shouldUseScreenshotDate) {
|
||||
std::time_t now = std::time(nullptr);
|
||||
std::tm* nowTime = std::localtime(&now);
|
||||
char mbstr[100];
|
||||
@@ -345,12 +347,99 @@ void mainInitFunc() {
|
||||
}
|
||||
}
|
||||
|
||||
OsEng.setJoystickInputStates(joystickInputStates);
|
||||
|
||||
LTRACE("main::mainInitFunc(end)");
|
||||
}
|
||||
|
||||
void mainPreSyncFunc() {
|
||||
LTRACE("main::mainPreSyncFunc(begin)");
|
||||
OsEng.preSynchronization();
|
||||
|
||||
// Query joystick status
|
||||
using namespace openspace::interaction;
|
||||
|
||||
for (int i = GLFW_JOYSTICK_1; i <= GLFW_JOYSTICK_LAST; ++i) {
|
||||
JoystickInputState& state = joystickInputStates[i];
|
||||
|
||||
int present = glfwJoystickPresent(i);
|
||||
if (present == GLFW_TRUE) {
|
||||
if (!state.isConnected) {
|
||||
// Joystick was added
|
||||
state.isConnected = true;
|
||||
state.name = SgctEngine->getJoystickName(i);
|
||||
|
||||
std::fill(state.axes.begin(), state.axes.end(), 0.f);
|
||||
std::fill(
|
||||
state.buttons.begin(),
|
||||
state.buttons.end(),
|
||||
JoystickAction::Idle
|
||||
);
|
||||
}
|
||||
|
||||
const float* axes = SgctEngine->getJoystickAxes(i, &state.nAxes);
|
||||
if (state.nAxes > JoystickInputState::MaxAxes) {
|
||||
LWARNING(fmt::format(
|
||||
"Joystick/Gamepad {} has {} axes, but only {} axes are supported. "
|
||||
"All excess axes are ignored",
|
||||
state.name,
|
||||
state.nAxes,
|
||||
JoystickInputState::MaxAxes
|
||||
));
|
||||
state.nAxes = JoystickInputState::MaxAxes;
|
||||
}
|
||||
std::memcpy(state.axes.data(), axes, state.nAxes * sizeof(float));
|
||||
|
||||
const unsigned char* buttons = SgctEngine->getJoystickButtons(
|
||||
i,
|
||||
&state.nButtons
|
||||
);
|
||||
|
||||
if (state.nButtons > JoystickInputState::MaxButtons) {
|
||||
LWARNING(fmt::format(
|
||||
"Joystick/Gamepad {} has {} buttons, but only {} buttons are "
|
||||
"supported. All excess buttons are ignored",
|
||||
state.name,
|
||||
state.nButtons,
|
||||
JoystickInputState::MaxButtons
|
||||
));
|
||||
state.nButtons = JoystickInputState::MaxButtons;
|
||||
}
|
||||
|
||||
for (int j = 0; j < state.nButtons; ++j) {
|
||||
bool currentlyPressed = buttons[j] == GLFW_PRESS;
|
||||
|
||||
if (currentlyPressed) {
|
||||
switch (state.buttons[j]) {
|
||||
case JoystickAction::Idle:
|
||||
case JoystickAction::Release:
|
||||
state.buttons[j] = JoystickAction::Press;
|
||||
break;
|
||||
case JoystickAction::Press:
|
||||
case JoystickAction::Repeat:
|
||||
state.buttons[j] = JoystickAction::Repeat;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (state.buttons[j]) {
|
||||
case JoystickAction::Idle:
|
||||
case JoystickAction::Release:
|
||||
state.buttons[j] = JoystickAction::Idle;
|
||||
break;
|
||||
case JoystickAction::Press:
|
||||
case JoystickAction::Repeat:
|
||||
state.buttons[j] = JoystickAction::Release;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
state.isConnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
LTRACE("main::mainPreSyncFunc(end)");
|
||||
}
|
||||
|
||||
@@ -542,7 +631,6 @@ int main_main(int argc, char** argv) {
|
||||
std::pair<int, int> glVersion = supportedOpenGLVersion();
|
||||
|
||||
// Create the OpenSpace engine and get arguments for the SGCT engine
|
||||
// @CLEANUP: Replace the return valua with throwing an exception --abock
|
||||
std::vector<std::string> sgctArguments;
|
||||
bool requestQuit = false;
|
||||
try {
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
#include <openspace/engine/moduleengine.h>
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include <openspace/rendering/dashboarditem.h>
|
||||
#include <openspace/util/progressbar.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
#include <openspace/util/taskloader.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
#include <openspace/util/resourcesynchronization.h>
|
||||
@@ -62,12 +61,12 @@ namespace {
|
||||
void initTextureReaders() {
|
||||
#ifdef GHOUL_USE_DEVIL
|
||||
ghoul::io::TextureReader::ref().addReader(
|
||||
std::make_shared<ghoul::io::TextureReaderDevIL>()
|
||||
std::make_unique<ghoul::io::TextureReaderDevIL>()
|
||||
);
|
||||
#endif // GHOUL_USE_DEVIL
|
||||
#ifdef GHOUL_USE_FREEIMAGE
|
||||
ghoul::io::TextureReader::ref().addReader(
|
||||
std::make_shared<ghoul::io::TextureReaderFreeImage>()
|
||||
std::make_unique<ghoul::io::TextureReaderFreeImage>()
|
||||
);
|
||||
#endif // GHOUL_USE_FREEIMAGE
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ int main(int argc, char** argv) {
|
||||
);
|
||||
|
||||
std::stringstream defaultPassword;
|
||||
defaultPassword << std::hex << std::setfill('0') << std::setw(6) <<
|
||||
defaultPassword << std::hex << std::setfill('0') << std::setw(6) <<
|
||||
(std::hash<size_t>{}(
|
||||
std::chrono::system_clock::now().time_since_epoch().count()
|
||||
) % 0xffffff);
|
||||
|
||||
@@ -12,6 +12,7 @@ assetHelper.requestAll(asset, 'scene/digitaluniverse')
|
||||
-- Load default key bindings applicable to most scenes
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_dashboard')
|
||||
asset.require('util/default_joystick')
|
||||
|
||||
asset.request('customization/globebrowsing')
|
||||
|
||||
|
||||
22
data/assets/examples/toyvolume.asset
Normal file
22
data/assets/examples/toyvolume.asset
Normal file
@@ -0,0 +1,22 @@
|
||||
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_TOYVOLUME enabled
|
||||
|
||||
local assetHelper = asset.require("util/asset_helper")
|
||||
local transforms = asset.require("scene/solarsystem/sun/transforms")
|
||||
|
||||
local ToyVolume = {
|
||||
Identifier = "RenderableToyVolume",
|
||||
Parent = transforms.SolarSystemBarycenter.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableToyVolume",
|
||||
Size = {5, 5, 5},
|
||||
ScalingExponent = 11,
|
||||
StepSize = 0.01,
|
||||
Color = {1, 0, 0, 1}
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Examples"
|
||||
}
|
||||
}
|
||||
|
||||
local objects = { ToyVolume }
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, objects)
|
||||
@@ -40,3 +40,11 @@ asset.syncedResource({
|
||||
Type = "UrlSynchronization",
|
||||
Url = "http://ipv4.download.thinkbroadband.com/5MB.zip"
|
||||
})
|
||||
|
||||
asset.syncedResource({
|
||||
Name = "Example No Hash",
|
||||
Type = "UrlSynchronization",
|
||||
Identifier = "no_hash",
|
||||
Url = "http://wms.itn.liu.se/Mercury/Messenger_Mosaic/Messenger_Mosaic.wms",
|
||||
UseHash = false
|
||||
})
|
||||
|
||||
@@ -29,6 +29,8 @@ local object = {
|
||||
ColorOption = { "redshift", "prox5Mpc" },
|
||||
ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } },
|
||||
Unit = "Mpc",
|
||||
CorrectionSizeEndDistance = 20.6,
|
||||
CorrectionSizeFactor = 15.0,
|
||||
ScaleFactor = 508.0
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -30,6 +30,8 @@ local object = {
|
||||
TextSize = 14.6,
|
||||
TextMinSize = 10.0,
|
||||
ScaleFactor = 360,
|
||||
CorrectionSizeEndDistance = 16.1,
|
||||
CorrectionSizeFactor = 7.75,
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -32,6 +32,8 @@ local object = {
|
||||
TextSize = 14.8,
|
||||
TextMaxSize = 200.0,
|
||||
TextMinSize = 10.0,
|
||||
CorrectionSizeEndDistance = 15.23,
|
||||
CorrectionSizeFactor = 13.3,
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -26,6 +26,8 @@ local object = {
|
||||
ScaleFactor = 395.0,
|
||||
File = speck .. "/kepler.speck",
|
||||
Texture = textures .. "/halo.png",
|
||||
CorrectionSizeEndDistance = 15.86,
|
||||
CorrectionSizeFactor = 8.59,
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -34,6 +34,8 @@ local object = {
|
||||
FadeInDistances = { 220.0, 650.0 },
|
||||
BillboardMaxSize = 50.0,
|
||||
BillboardMinSize = 0.0,
|
||||
CorrectionSizeEndDistance = 20.65,
|
||||
CorrectionSizeFactor = 10.41,
|
||||
TextSize = 14.8,
|
||||
TextMinSize = 10.0,
|
||||
TextMaxSize = 50.0
|
||||
|
||||
@@ -38,4 +38,4 @@ local object = {
|
||||
|
||||
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { object })
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { object })
|
||||
@@ -31,6 +31,8 @@ local object = {
|
||||
ScaleFactor = 440.08,
|
||||
TextSize = 17.5,
|
||||
TextMinSize = 8.0,
|
||||
CorrectionSizeEndDistance = 17.5,
|
||||
CorrectionSizeFactor = 13.96,
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -45,6 +45,8 @@ local tullyPoints = {
|
||||
-- Max size in pixels
|
||||
BillboardMaxSize = 50.0,
|
||||
BillboardMinSize = 0.0,
|
||||
CorrectionSizeEndDistance = 20.55,
|
||||
CorrectionSizeFactor = 10.45,
|
||||
},
|
||||
GUI = {
|
||||
Name = "Tully Galaxies",
|
||||
|
||||
@@ -110,9 +110,15 @@ local Earth = {
|
||||
)
|
||||
},
|
||||
{
|
||||
Identifier = "BMNG",
|
||||
Name = "BMNH [Utah]",
|
||||
Identifier = "BMNG_Utah",
|
||||
FilePath = mapServiceConfigsPath .. "/Utah/Bmng.wms"
|
||||
},
|
||||
{
|
||||
Name = "BMNH [Sweden]",
|
||||
Identifier = "BMNG_Sweden",
|
||||
FilePath = mapServiceConfigsPath .. "/LiU/Bmng.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "AMSR2_GCOM_W1_Sea_Ice_Concentration_Temporal",
|
||||
Name = "AMSR2 GCOM W1 Sea Ice Concentration (Temporal)",
|
||||
@@ -188,9 +194,15 @@ local Earth = {
|
||||
Enabled = true
|
||||
},
|
||||
{
|
||||
Identifier = "GEBCO",
|
||||
Name = "Gebco [Utah]",
|
||||
Identifier = "Gebco_Utah",
|
||||
FilePath = mapServiceConfigsPath .. "/Utah/Gebco.wms"
|
||||
}
|
||||
},
|
||||
{
|
||||
Name = "Gebco [Sweden]",
|
||||
Identifier = "Gebco_Sweden",
|
||||
FilePath = mapServiceConfigsPath .. "/LiU/Gebco.wms"
|
||||
},
|
||||
},
|
||||
Overlays = {
|
||||
{
|
||||
@@ -233,7 +245,21 @@ local Earth = {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
ShadowGroup = {
|
||||
Source1 = {
|
||||
Name = "Sun",
|
||||
-- All radius in meters
|
||||
Radius = 696.3E6
|
||||
},
|
||||
--Source2 = { Name = "Monolith", Radius = 0.01E6, },
|
||||
Caster1 = {
|
||||
Name = "Moon",
|
||||
-- All radius in meters
|
||||
Radius = 1.737E6
|
||||
}
|
||||
--Caster2 = { Name = "Independency Day Ship", Radius = 0.0, }
|
||||
}
|
||||
},
|
||||
Tag = { "planet_solarSystem", "planet_terrestrial" },
|
||||
GUI = {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Earth/Bmng/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>86400</SizeX>
|
||||
<SizeY>43200</SizeY>
|
||||
<TileLevel>8</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>EPSG:4326</Projection>
|
||||
<BlockSizeX>240</BlockSizeX>
|
||||
<BlockSizeY>240</BlockSizeY>
|
||||
<BandsCount>3</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Earth/Gebco/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>43200</SizeX>
|
||||
<SizeY>21600</SizeY>
|
||||
<TileLevel>6</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>EPSG:4326</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Moon/Clem_Uvvis/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>92160</SizeX>
|
||||
<SizeY>46080</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Moon/Kaguya/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>1474560</SizeX>
|
||||
<SizeY>737280</SizeY>
|
||||
<TileLevel>11</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Moon/Lola_Clr_Shade/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>92160</SizeX>
|
||||
<SizeY>46080</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>3</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,21 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Moon/Lola_DEM/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>92160</SizeX>
|
||||
<SizeY>46080</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<DataType>Int16</DataType>
|
||||
<Projection>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Moon/Lola_Shade/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>92160</SizeX>
|
||||
<SizeY>46080</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Moon/Uvvis_Hybrid/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>184320</SizeX>
|
||||
<SizeY>92160</SizeY>
|
||||
<TileLevel>8</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Moon/WAC/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>109164</SizeX>
|
||||
<SizeY>54582</SizeY>
|
||||
<TileLevel>8</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -1,68 +0,0 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TiledWMS">
|
||||
<ServerUrl>http://onmoon.lmmp.nasa.gov/wms.cgi?</ServerUrl>
|
||||
<TiledGroupName>LRO WAC Mosaic, LMMP</TiledGroupName>
|
||||
|
||||
<!--
|
||||
Clementine LO Hybrid, LMMP
|
||||
Clementine Mosaic, LMMP
|
||||
LRO WAC Mosaic, LMMP
|
||||
LOLA v2, LMMP
|
||||
LOLA Shade v2, LMMP
|
||||
LOLA ClrShade v2, LMMP
|
||||
LOLA v4, LMMP
|
||||
LOLA v4 Coverage, LMMP
|
||||
LOLA v4 NoData Mask, LMMP
|
||||
LOLA Shade v4, LMMP
|
||||
LOLA ClrShade v4, LMMP
|
||||
Apollo 15, LMMP
|
||||
Apollo 15 DEM Grayscale, LMMP
|
||||
Apollo 15 HillShade, LMMP
|
||||
Apollo 15 Colorized HillShade, LMMP
|
||||
Apollo 15 Colorized Confidence, LMMP
|
||||
Apollo 16 image, LMMP
|
||||
Apollo 16 DEM Grayscale, LMMP
|
||||
Apollo 16 HillShade, LMMP
|
||||
Apollo 16 Colorized HillShade, LMMP
|
||||
Apollo 16 Colorized Confidence, LMMP
|
||||
Apollo 17 image Old, LMMP
|
||||
Apollo 17 image, LMMP
|
||||
Apollo 17 DEM Grayscale, LMMP
|
||||
Apollo 17 HillShade, LMMP
|
||||
Apollo 17 Colorized HillShade, LMMP
|
||||
Apollo 17 Colorized Confidence, LMMP
|
||||
Apollo Zone image, LMMP
|
||||
Apollo Zone image 3033, LMMP
|
||||
Apollo Zone DEM Grayscale, LMMP
|
||||
Apollo Zone HillShade, LMMP
|
||||
Apollo Zone Colorized HillShade, LMMP
|
||||
Apollo Zone Colorized Confidence, LMMP
|
||||
LRO Diviner CF Filled, LMMP
|
||||
LRO Diviner CF, LMMP
|
||||
Clementine Color Ratio, LMMP
|
||||
Clementine Optical Maturity, LMMP
|
||||
Clementine FeO abundance, LMMP
|
||||
Clementine TiO2 abundance, LMMP
|
||||
LP Fe Abundance, colorized, LMMP
|
||||
LP K Abundance, colorized, LMMP
|
||||
LP Th Abundance, colorized, LMMP
|
||||
LP H Abundance, colorized, LMMP
|
||||
-->
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90</LowerRightY>
|
||||
<TileLevel>20</TileLevel>
|
||||
<TileCountX>2</TileCountX>
|
||||
<TileCountY>1</TileCountY>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<BlockSizeX>512</BlockSizeX>
|
||||
<BlockSizeY>512</BlockSizeY>
|
||||
<UnsafeSSL>true</UnsafeSSL>
|
||||
<ZeroBlockHttpCodes>400</ZeroBlockHttpCodes>
|
||||
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
|
||||
<Timeout>5</Timeout>
|
||||
</GDAL_WMS>
|
||||
@@ -30,38 +30,85 @@ local Moon = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {
|
||||
ColorLayers = {
|
||||
-- Utah based servers
|
||||
{
|
||||
Identifier = "ClemUvvis",
|
||||
Name = "Clem Uvvis",
|
||||
FilePath = mapServiceConfigs .. "/Utah/ClemUvvis.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Kaguya",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Kaguya.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "WAC_Utah",
|
||||
Name = "WAC Utah",
|
||||
Name = "WAC [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Wac.wms",
|
||||
Enabled = true
|
||||
},
|
||||
-- LMMP based servers
|
||||
{
|
||||
Identifier = "OnMoon",
|
||||
FilePath = mapServiceConfigs .. "/OnMoonColor.wms"
|
||||
}
|
||||
Identifier = "WAC_Sweden",
|
||||
Name = "WAC [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/WAC.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "ClemUvvis_Utah",
|
||||
Name = "Clem Uvvis [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/ClemUvvis.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "ClemUvvis_Sweden",
|
||||
Name = "Clem Uvvis [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Clem_Uvvis.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "UvvisHybrid_Utah",
|
||||
Name = "Uvvis Hybrid [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/UvvisHybrid.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "UvvisHybrid_Sweden",
|
||||
Name = "Uvvis Hybrid [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Uvvis_Hybrid.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Kaguya_Utah",
|
||||
Name = "Kaguya [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Kaguya.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Kaguya_Sweden",
|
||||
Name = "Kaguya [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Kaguya.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Lola_Clr_Shade_Utah",
|
||||
Name = "Lola Clear Shade [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/LolaClrShade.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Lola_Clr_Shade_Sweden",
|
||||
Name = "Lola Clear Shade [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Lola_Clr_Shade.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Lola_Shade_Utah",
|
||||
Name = "Lola Shade [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/LolaShade.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Lola_Shade_Sweden",
|
||||
Name = "Lola Shade [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Lola_Shade.wms"
|
||||
},
|
||||
},
|
||||
HeightLayers = {
|
||||
-- Utah based servers
|
||||
{
|
||||
Identifier = "LolaDem",
|
||||
Name = "WAC [Utah]",
|
||||
Identifier = "LolaDem_Utah",
|
||||
Name = "Lola DEM [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/LolaDem.wms",
|
||||
Enabled = true,
|
||||
TilePixelSize = 64,
|
||||
Settings = { Multiplier = 0.5 }
|
||||
},
|
||||
{
|
||||
Identifier = "LolaDem_Sweden",
|
||||
Name = "Lola DEM [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Lola_DEM.wms",
|
||||
TilePixelSize = 64,
|
||||
Settings = { Multiplier = 0.5 }
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
ShadowGroup = {
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TiledWMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/OnMars/wms.cgi?</ServerUrl>
|
||||
<TiledGroupName>CTX Mosaic</TiledGroupName>
|
||||
<Transparent>TRUE</Transparent>
|
||||
<Service name="TMS">
|
||||
<ServerURL>http://wms.itn.liu.se/Mars/CTX/tile/${z}/${y}/${x}</ServerURL>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<SizeX>4194304</SizeX>
|
||||
<SizeY>2097152</SizeY>
|
||||
<TileLevel>13</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<ZeroBlockHttpCodes>400,204,404</ZeroBlockHttpCodes>
|
||||
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
|
||||
<Projection>GEOGCS["Mars 2000", DATUM["D_Mars_2000", SPHEROID["MARS_2000_IAU_IAG",3396190.0,169.894447222361179]],PRIMEM["Greenwich"0], UNIT["Decimal_Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<BandsCount>2</BandsCount>
|
||||
<OfflineMode>false</OfflineMode>
|
||||
<Path>./gdal-cache/ctx</Path>
|
||||
<Timeout>5</Timeout>
|
||||
</GDAL_WMS>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mars/Color/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>92160</SizeX>
|
||||
<SizeY>46080</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["Mars2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190,169.8944472236118]],PRIMEM["Greenwich",0],UNIT["Decimal_Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>512</BlockSizeX>
|
||||
<BlockSizeY>512</BlockSizeY>
|
||||
<BandsCount>3</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mars/MDIM/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>92160</SizeX>
|
||||
<SizeY>46080</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>3</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mars/Mola_CTX/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>46080</SizeX>
|
||||
<SizeY>23040</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>PROJCS["Mars2000_ECylindrical_clon0",GEOGCS["GCS_Mars_2000_Sphere",DATUM["Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere",3396190,0]],PRIMEM["Reference_Meridian",0],UNIT["degree",0.0174532925199433]],PROJECTION["Equirectangular"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",0],PARAMETER["standard_parallel_1",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]</Projection>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -1,15 +1,23 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TiledWMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/OnMars/wms.cgi?</ServerUrl>
|
||||
<TiledGroupName>Mola Elevation</TiledGroupName>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mars/Mola_Elevation/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>46080</SizeX>
|
||||
<SizeY>23040</SizeY>
|
||||
<TileLevel>6</TileLevel>
|
||||
<YOrigin>bottom</YOrigin>
|
||||
</DataWindow>
|
||||
<DataType>Int16</DataType>
|
||||
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<OfflineMode>false</OfflineMode>
|
||||
<Path>./gdal-cache/mola_elevation</Path>
|
||||
<Timeout>5</Timeout>
|
||||
</GDAL_WMS>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mars/Mola_HRSC/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>106694</SizeX>
|
||||
<SizeY>53347</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>512</BlockSizeX>
|
||||
<BlockSizeY>512</BlockSizeY>
|
||||
<BandsCount>3</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mars/Mola_PseudoColor/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>46080</SizeX>
|
||||
<SizeY>23040</SizeY>
|
||||
<TileLevel>6</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>360</BlockSizeX>
|
||||
<BlockSizeY>360</BlockSizeY>
|
||||
<BandsCount>3</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http:/wms.itn.liu.se/Mars/Themis_IR_Day/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>213390</SizeX>
|
||||
<SizeY>106695</SizeY>
|
||||
<TileLevel>9</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mars/Themis_IR_Night/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>213388</SizeX>
|
||||
<SizeY>71130</SizeY>
|
||||
<TileLevel>9</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -12,7 +12,7 @@
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin> <!-- fail: bottom -->
|
||||
</DataWindow>
|
||||
<!-- <Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection> -->
|
||||
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>512</BlockSizeX>
|
||||
<BlockSizeY>512</BlockSizeY>
|
||||
<BandsCount>3</BandsCount>
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>213390</SizeX>
|
||||
<SizeY>106695</SizeY>
|
||||
<SizeX>213388</SizeX>
|
||||
<SizeY>71130</SizeY>
|
||||
<TileLevel>9</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
|
||||
@@ -19,8 +19,8 @@ local mapServiceConfigs = asset.localResource("map_service_configs")
|
||||
|
||||
local color_layers = {
|
||||
{
|
||||
Identifier = "MOC_WA_AMNH_Color",
|
||||
Name = "MOC WA AMNH Color",
|
||||
Identifier = "MOC_WA_Color_Utah",
|
||||
Name = "MOC WA Color [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Mars_Color.wms",
|
||||
Enabled = true,
|
||||
Fallback = {
|
||||
@@ -30,40 +30,54 @@ local color_layers = {
|
||||
}
|
||||
},
|
||||
{
|
||||
Identifier = "Viking_MDIM",
|
||||
Name = "Viking MDIM",
|
||||
FilePath = mapServiceConfigs .. "/MARS_Viking_MDIM21.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "MOLA_Pseudo_Color",
|
||||
Name = "MOLA Pseudo Color",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Mola_PseudoColor.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "MOLA_HRSC",
|
||||
Name = "MOLA HRSC",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Mola_HRSC.wms"
|
||||
Identifier = "MOC_WA_Color_LiU",
|
||||
Name = "MOC WA Color [LiU]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Color.wms",
|
||||
Fallback = {
|
||||
Name = "Mars Texture",
|
||||
FilePath = textures .. "/mars.jpg",
|
||||
Enabled = true
|
||||
}
|
||||
},
|
||||
{
|
||||
Identifier = "Viking_MDIM_Utah",
|
||||
Name = "Viking MDIM [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Mdim.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Viking_MDIM_Sweden",
|
||||
Name = "Viking MDIM [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/MDIM.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Viking_MDIM_AWS",
|
||||
Name = "Viking MDIM [AWS]",
|
||||
FilePath = mapServiceConfigs .. "/AWS/Mdim.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "MOLA_Pseudo_Color_Utah",
|
||||
Name = "MOLA Pseudo Color [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Mola_PseudoColor.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "MOLA_Pseudo_Color_Sweden",
|
||||
Name = "MOLA Pseudo Color [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Mola_PseudoColor.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "MOLA_Pseudo_Color_AWS",
|
||||
Name = "MOLA Pseudo Color [AWS]",
|
||||
FilePath = mapServiceConfigs .. "/AWS/Mola_PseudoColor.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "CTX_Mosaic_LiU",
|
||||
Name = "CTX Mosaic [LiU]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/CTX.wms",
|
||||
BlendMode = "Color"
|
||||
Identifier = "MOLA_HRSC_Utah",
|
||||
Name = "MOLA HRSC [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Mola_HRSC.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "MOLA_HRSC_Sweden",
|
||||
Name = "MOLA HRSC [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Mola_HRSC.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "CTX_Mosaic_Utah",
|
||||
@@ -71,6 +85,12 @@ local color_layers = {
|
||||
FilePath = mapServiceConfigs .. "/Utah/CTX.wms",
|
||||
BlendMode = "Color"
|
||||
},
|
||||
{
|
||||
Identifier = "CTX_Mosaic_Sweden",
|
||||
Name = "CTX Mosaic [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/CTX.wms",
|
||||
BlendMode = "Color"
|
||||
},
|
||||
{
|
||||
Identifier = "CTX_Mosaic_AWS",
|
||||
Name = "CTX Mosaic [AWS]",
|
||||
@@ -83,6 +103,18 @@ local color_layers = {
|
||||
FilePath = mapServiceConfigs .. "/Utah/Themis_IR_Day.wms",
|
||||
BlendMode = "Color"
|
||||
},
|
||||
{
|
||||
Identifier = "Themis_IR_Day_Sweden",
|
||||
Name = "Themis IR Day [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Themis_IR_Day.wms",
|
||||
BlendMode = "Color"
|
||||
},
|
||||
{
|
||||
Identifier = "Themis_IR_Day_AWS",
|
||||
Name = "Themis IR Day [AWS]",
|
||||
FilePath = mapServiceConfigs .. "/AWS/Themis_IR_Day.wms",
|
||||
BlendMode = "Color"
|
||||
},
|
||||
{
|
||||
Identifier = "Themis_IR_Night_Utah",
|
||||
Name = "Themis IR Night [Utah]",
|
||||
@@ -90,9 +122,9 @@ local color_layers = {
|
||||
BlendMode = "Color"
|
||||
},
|
||||
{
|
||||
Identifier = "Themis_IR_Day_AWS_",
|
||||
Name = "Themis IR Day [AWS]",
|
||||
FilePath = mapServiceConfigs .. "/AWS/Themis_IR_Day.wms",
|
||||
Identifier = "Themis_IR_Night_Sweden",
|
||||
Name = "Themis IR Night [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Themis_IR_Night.wms",
|
||||
BlendMode = "Color"
|
||||
},
|
||||
{
|
||||
@@ -127,13 +159,13 @@ local height_layers = {
|
||||
Identifier = "Mola_Europe",
|
||||
Name = "Mola Elevation [Europe]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Mola_Elevation.wms",
|
||||
Enabled = true,
|
||||
TilePixelSize = 90
|
||||
},
|
||||
{
|
||||
Identifier = "Mola_Utah",
|
||||
Name = "Mola Elevation [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/Mola_Elevation.wms",
|
||||
Enabled = true,
|
||||
TilePixelSize = 90
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mercury/Messenger_MDIS/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>61324</SizeX>
|
||||
<SizeY>30662</SizeY>
|
||||
<TileLevel>7</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<BandsCount>1</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -0,0 +1,20 @@
|
||||
<GDAL_WMS>
|
||||
<Service name="TMS">
|
||||
<ServerUrl>http://wms.itn.liu.se/Mercury/Messenger_Mosaic/tile/${z}/${y}/${x}</ServerUrl>
|
||||
</Service>
|
||||
<DataWindow>
|
||||
<UpperLeftX>-180.0</UpperLeftX>
|
||||
<UpperLeftY>90.0</UpperLeftY>
|
||||
<LowerRightX>180.0</LowerRightX>
|
||||
<LowerRightY>-90.0</LowerRightY>
|
||||
<SizeX>23054</SizeX>
|
||||
<SizeY>11527</SizeY>
|
||||
<TileLevel>6</TileLevel>
|
||||
<YOrigin>top</YOrigin>
|
||||
</DataWindow>
|
||||
<Projection>GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]</Projection>
|
||||
<BlockSizeX>256</BlockSizeX>
|
||||
<BlockSizeY>256</BlockSizeY>
|
||||
<BandsCount>3</BandsCount>
|
||||
<MaxConnections>10</MaxConnections>
|
||||
</GDAL_WMS>
|
||||
@@ -8,7 +8,6 @@ asset.request('./trail')
|
||||
local mapServiceConfigs = asset.localResource("map_service_configs")
|
||||
|
||||
local color_layers = {
|
||||
-- Utah based servers
|
||||
{
|
||||
Identifier = "Messenger_MDIS_Utah",
|
||||
Name = "Messenger MDIS [Utah]",
|
||||
@@ -16,16 +15,25 @@ local color_layers = {
|
||||
Enabled = true
|
||||
},
|
||||
{
|
||||
Identifier = "Messenger_Mosaic_Utah",
|
||||
Name = "Messenger Mosaic [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/MessengerMosaic.wms"
|
||||
Identifier = "Messenger_MDIS_Sweden",
|
||||
Name = "Messenger MDIS [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Messenger_MDIS.wms",
|
||||
},
|
||||
-- AWS based servers
|
||||
{
|
||||
Identifier = "Messenger_MDIS_AWS",
|
||||
Name = "Messenger MDIS [AWS]",
|
||||
FilePath = mapServiceConfigs .. "/AWS/MessengerMdis.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Messenger_Mosaic_Utah",
|
||||
Name = "Messenger Mosaic [Utah]",
|
||||
FilePath = mapServiceConfigs .. "/Utah/MessengerMosaic.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Messenger_Mosaic_Sweden",
|
||||
Name = "Messenger Mosaic [Sweden]",
|
||||
FilePath = mapServiceConfigs .. "/LiU/Messenger_Mosaic.wms"
|
||||
},
|
||||
{
|
||||
Identifier = "Messenger_Mosaic_AWS",
|
||||
Name = "Messenger Mosaic [AWS]",
|
||||
|
||||
@@ -16,7 +16,7 @@ local MercuryTrail = {
|
||||
},
|
||||
Color = { 0.6, 0.5, 0.5 },
|
||||
Period = 87.968,
|
||||
Resolution = 100
|
||||
Resolution = 1000
|
||||
},
|
||||
Tag = { "planetTrail_solarSystem", "planetTrail_terrestrial" },
|
||||
GUI = {
|
||||
|
||||
@@ -9,7 +9,7 @@ local textures = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Name = "Saturn textures",
|
||||
Identifier = "saturn_textures",
|
||||
Version = 2
|
||||
Version = 3
|
||||
})
|
||||
|
||||
local Saturn = {
|
||||
@@ -48,14 +48,14 @@ local SaturnRings = {
|
||||
Renderable = {
|
||||
Type = "RenderableRings",
|
||||
Texture = textures .. "/saturn_rings.png",
|
||||
Size = 140220000,
|
||||
Size = 140445000,
|
||||
Offset = { 74500 / 140445.100671159, 1.0 } -- min / max extend
|
||||
},
|
||||
GUI = {
|
||||
Name = "Saturn Rings",
|
||||
Path = "/Solar System/Planets/Saturn"
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
136
data/assets/util/default_joystick.asset
Normal file
136
data/assets/util/default_joystick.asset
Normal file
@@ -0,0 +1,136 @@
|
||||
local propertyHelper = asset.require('./property_helper')
|
||||
|
||||
-- Allowed values for the second parameter of bindJoystickAxis:
|
||||
-- "None"
|
||||
-- "Orbit X"
|
||||
-- "Orbit Y"
|
||||
-- "Zoom In"
|
||||
-- "Zoom Out"
|
||||
-- "LocalRoll X"
|
||||
-- "LocalRoll Y"
|
||||
-- "GlobalRoll X"
|
||||
-- "GlobalRoll Y"
|
||||
-- "Pan X"
|
||||
-- "Pan Y"
|
||||
-- Third parameter determines whether the axis should be inverted
|
||||
-- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1]
|
||||
|
||||
|
||||
local XBoxController = {
|
||||
LeftThumbStick = { 0 , 1 },
|
||||
RightThumbStick = { 2, 3 },
|
||||
LeftTrigger = 4,
|
||||
RightTrigger = 5,
|
||||
A = 0,
|
||||
B = 1,
|
||||
X = 2,
|
||||
Y = 3,
|
||||
LB = 4,
|
||||
RB = 5,
|
||||
Select = 6,
|
||||
Start = 7,
|
||||
LeftStick = 8,
|
||||
RightStick = 9,
|
||||
DPad = {
|
||||
Up = 10,
|
||||
Right = 11,
|
||||
Down = 12,
|
||||
Left = 13
|
||||
}
|
||||
}
|
||||
|
||||
local PS4Controller = {
|
||||
LeftThumbStick = { 0 , 1 },
|
||||
RightThumbStick = { 2, 5 },
|
||||
LeftTrigger = 3,
|
||||
RightTrigger = 4,
|
||||
A = 3, -- Triangle
|
||||
B = 0, -- Square
|
||||
X = 2, -- Circle
|
||||
Y = 1, -- Cross
|
||||
LB = 4,
|
||||
RB = 5,
|
||||
Select = 9, -- options
|
||||
Start = 12, -- PS button
|
||||
LeftStick = 10,
|
||||
RightStick = 11,
|
||||
DPad = {
|
||||
Up = 14,
|
||||
Right = 15,
|
||||
Down = 16,
|
||||
Left = 17
|
||||
}
|
||||
}
|
||||
|
||||
-- Variables to store the state of the joystick between frames
|
||||
Joystick = {}
|
||||
Joystick.State = {}
|
||||
Joystick.State.IsInRollMode = false
|
||||
Joystick.State.Axis = {}
|
||||
|
||||
local bindLocalRoll = function(axis)
|
||||
return [[
|
||||
-- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup
|
||||
if not Joystick.State.IsInRollMode then
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
end
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "LocalRoll X", true);
|
||||
Joystick.State.IsInRollMode = true
|
||||
]]
|
||||
end
|
||||
|
||||
local bindGlobalRoll = function(axis)
|
||||
return [[
|
||||
-- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup
|
||||
if not Joystick.State.IsInRollMode then
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
end
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "GlobalRoll X", true);
|
||||
Joystick.State.IsInRollMode = true
|
||||
]]
|
||||
end
|
||||
|
||||
local unbindRoll = function(axis)
|
||||
return [[
|
||||
-- Reset previous state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized);
|
||||
]]
|
||||
end
|
||||
|
||||
asset.onInitialize(function()
|
||||
-- Set the controller to the connected controller
|
||||
-- Currently: XBoxController or PS4Controller
|
||||
local controller = XBoxController;
|
||||
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[1], 0.05)
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[2], 0.05)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightThumbStick[1], 0.05)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.05)
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftTrigger, 0.05)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightTrigger, 0.05)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[2], "Orbit Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[1], "Pan X", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[2], "Pan Y");
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftTrigger, "Zoom Out", false, true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightTrigger, "Zoom In", false, true);
|
||||
|
||||
openspace.navigation.bindJoystickButton(controller.LB, bindLocalRoll(controller.RightThumbStick[1]))
|
||||
openspace.navigation.bindJoystickButton(controller.LB, unbindRoll(controller.RightThumbStick[1]), "Release")
|
||||
openspace.navigation.bindJoystickButton(controller.RB, bindGlobalRoll(controller.RightThumbStick[1]))
|
||||
openspace.navigation.bindJoystickButton(controller.RB, unbindRoll(controller.RightThumbStick[1]), "Release")
|
||||
|
||||
openspace.navigation.bindJoystickButton(controller.A, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'))
|
||||
openspace.navigation.bindJoystickButton(controller.B, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'))
|
||||
openspace.navigation.bindJoystickButton(controller.DPad.Left, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'))
|
||||
|
||||
openspace.navigation.bindJoystickButton(controller.X, "openspace.setPropertyValue('NavigationHandler.Origin', 'Earth')")
|
||||
openspace.navigation.bindJoystickButton(controller.Y, "openspace.setPropertyValue('NavigationHandler.Origin', 'Mars')")
|
||||
end)
|
||||
@@ -22,6 +22,27 @@ asset.require('util/default_dashboard')
|
||||
|
||||
local VoyagerAsset = asset.require('scene/solarsystem/missions/voyager/voyager1')
|
||||
|
||||
assetHelper.registerDashboardItems(asset, {
|
||||
{
|
||||
Type = "DashboardItemDistance",
|
||||
Identifier = "Voyager1Distance",
|
||||
GuiName = "Voyager 1 - Earth Distance",
|
||||
SourceType = "Node",
|
||||
SourceNodeName = "Voyager_1",
|
||||
DestinationType = "Node",
|
||||
DestinationNodeName = "Earth"
|
||||
},
|
||||
{
|
||||
Type = "DashboardItemDistance",
|
||||
Identifier = "Voyager2Distance",
|
||||
GuiName = "Voyager 2 - Earth Distance",
|
||||
SourceType = "Node",
|
||||
SourceNodeName = "Voyager_2",
|
||||
DestinationType = "Node",
|
||||
DestinationNodeName = "Earth"
|
||||
}
|
||||
})
|
||||
|
||||
asset.onInitialize(function ()
|
||||
openspace.time.setTime("1977 SEP 10 12:00:00")
|
||||
|
||||
|
||||
Submodule ext/ghoul updated: fd1187437c...c25721693b
2
ext/sgct
2
ext/sgct
Submodule ext/sgct updated: 52e2943cd7...03a8cd877e
138
include/openspace/engine/configuration.h
Normal file
138
include/openspace/engine/configuration.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___CONFIGURATION___H__
|
||||
#define __OPENSPACE_CORE___CONFIGURATION___H__
|
||||
|
||||
#include <ghoul/lua/luastate.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace documentation { struct Documentation; }
|
||||
|
||||
struct Configuration {
|
||||
std::string windowConfiguration = "${CONFIG}/single.xml";
|
||||
std::string asset = "default";
|
||||
std::vector<std::string> globalCustomizationScripts;
|
||||
std::map<std::string, std::string> pathTokens = {
|
||||
{ "CACHE" , "CACHE = \"${BASE}/cache\"" }
|
||||
};
|
||||
std::map<std::string, std::string> fonts;
|
||||
|
||||
struct Logging {
|
||||
std::string level = "Info";
|
||||
std::string directory = "${BASE}";
|
||||
std::string performancePrefix = "PM-";
|
||||
bool forceImmediateFlush = false;
|
||||
std::string capabilitiesVerbosity = "Default";
|
||||
std::vector<ghoul::Dictionary> logs;
|
||||
};
|
||||
Logging logging;
|
||||
|
||||
std::string scriptLog = "";
|
||||
|
||||
struct DocumentationInfo {
|
||||
std::string lua = "";
|
||||
std::string property = "";
|
||||
std::string sceneProperty = "";
|
||||
std::string keyboard = "";
|
||||
std::string documentation = "";
|
||||
std::string factory = "";
|
||||
std::string license = "";
|
||||
};
|
||||
DocumentationInfo documentation;
|
||||
|
||||
bool useMultithreadedInitialization = false;
|
||||
|
||||
struct LoadingScreen {
|
||||
bool isShowingMessages = true;
|
||||
bool isShowingNodeNames = true;
|
||||
bool isShowingProgressbar = true;
|
||||
};
|
||||
LoadingScreen loadingScreen;
|
||||
|
||||
bool isCheckingOpenGLState = false;
|
||||
bool isLoggingOpenGLCalls = false;
|
||||
|
||||
float shutdownCountdown = 0.f;
|
||||
|
||||
bool shouldUseScreenshotDate = false;
|
||||
|
||||
std::string onScreenTextScaling = "window";
|
||||
bool usePerSceneCache = false;
|
||||
|
||||
bool isRenderingOnMasterDisabled = false;
|
||||
bool isSceneTranslationOnMasterDisabled = false;
|
||||
|
||||
std::map<std::string, ghoul::Dictionary> moduleConfigurations;
|
||||
|
||||
std::string renderingMethod = "Framebuffer";
|
||||
|
||||
struct OpenGLDebugContext {
|
||||
bool isActive = false;
|
||||
bool isSynchronous = true;
|
||||
struct IdentifierFilter {
|
||||
std::string type = "";
|
||||
std::string source = "";
|
||||
unsigned int identifier = 0;
|
||||
};
|
||||
std::vector<IdentifierFilter> identifierFilters;
|
||||
std::vector<std::string> severityFilters;
|
||||
};
|
||||
OpenGLDebugContext openGLDebugContext;
|
||||
|
||||
std::string serverPasskey = "17308";
|
||||
bool doesRequireSocketAuthentication = true;
|
||||
std::vector<std::string> clientAddressWhitelist = {};
|
||||
std::string webHelperLocation = "";
|
||||
std::string cefWebGuiUrl = "";
|
||||
|
||||
struct HTTPProxy {
|
||||
bool usingHttpProxy = false;
|
||||
std::string address;
|
||||
unsigned int port = 0;
|
||||
std::string authentication = "BASIC";
|
||||
std::string user;
|
||||
std::string password;
|
||||
};
|
||||
HTTPProxy httpProxy;
|
||||
|
||||
|
||||
static documentation::Documentation Documentation;
|
||||
ghoul::lua::LuaState state;
|
||||
};
|
||||
|
||||
std::string findConfiguration(const std::string& filename = "openspace.cfg");
|
||||
|
||||
Configuration loadConfigurationFromFile(const std::string& filename);
|
||||
|
||||
void parseLuaState(Configuration& configuration);
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___CONFIGURATION___H__
|
||||
@@ -1,281 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___CONFIGURATIONMANAGER___H__
|
||||
#define __OPENSPACE_CORE___CONFIGURATIONMANAGER___H__
|
||||
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace documentation { struct Documentation; }
|
||||
|
||||
/**
|
||||
* The ConfigurationManager takes care of loading the major configuration file
|
||||
* <code>openspace.cfg</code> and making it available to the rest of the application. The
|
||||
* exposed keys in the ghoul::Dictionary are declared in this class as static constants.
|
||||
* The findConfiguration method walks the filesystem from a provided starting point until
|
||||
* it found the requested file or throws a ghoul::RuntimeError if it could not find the
|
||||
* file. The loadFromFile method then loads the file into a ghoul::Dictionary format.
|
||||
*/
|
||||
class ConfigurationManager : public ghoul::Dictionary {
|
||||
public:
|
||||
/// The key that stores the subdirectory containing all predefined path tokens
|
||||
static constexpr const char* KeyPaths = "Paths";
|
||||
|
||||
/// The key that stores the location to the cache directory used to store all the
|
||||
/// permanent and non-permanent cached files
|
||||
static constexpr const char* KeyCachePath = "Paths.CACHE";
|
||||
|
||||
/// The key that stores the main directory for fonts
|
||||
static constexpr const char* KeyFonts = "Fonts";
|
||||
|
||||
/// The key that stores the location of the SGCT configuration file that is used on
|
||||
/// application launch
|
||||
static constexpr const char* KeyConfigSgct = "SGCTConfig";
|
||||
|
||||
/// The key that defines a list of scripts for global customization that get executed
|
||||
/// regardless of which scene is loaded
|
||||
static constexpr const char* KeyGlobalCustomizationScripts =
|
||||
"GlobalCustomizationScripts";
|
||||
|
||||
/// The part of the key that defines the type
|
||||
// static constexpr const char* PartType = "Type";
|
||||
/// The part of the key that defines the file
|
||||
// static constexpr const char* PartFile = "File";
|
||||
|
||||
/// The key that stores the Lua documentation
|
||||
static constexpr const char* KeyLuaDocumentation = "LuaDocumentation";
|
||||
|
||||
/// The key that stores the scripting log
|
||||
static constexpr const char* KeyScriptLog = "ScriptLog";
|
||||
|
||||
/// The key that stores the Scene Property documentation
|
||||
static constexpr const char* KeyScenePropertyDocumentation =
|
||||
"ScenePropertyDocumentation";
|
||||
|
||||
/// The key that stores the Root Property documentation
|
||||
static constexpr const char* KeyPropertyDocumentation = "PropertyDocumentation";
|
||||
|
||||
/// The key that stores the keyboard bindings that should be stored
|
||||
static constexpr const char* KeyKeyboardShortcuts = "KeyboardShortcuts";
|
||||
|
||||
/// The key that stores the main documentation
|
||||
static constexpr const char* KeyDocumentation = "Documentation";
|
||||
|
||||
/// The key that stores the factory documentation values
|
||||
static constexpr const char* KeyFactoryDocumentation = "FactoryDocumentation";
|
||||
/// The key that decides whether or not we should require incoming web socket connections
|
||||
/// to authorize or not
|
||||
static constexpr const char* KeyRequireSocketAuthentication = "RequireSocketAuthentication";
|
||||
|
||||
/// The key that stores the location of the asset file that is initially loaded
|
||||
static constexpr const char* KeyConfigAsset = "Asset";
|
||||
|
||||
/// The key that stores the scene license documentation values
|
||||
static constexpr const char* KeySceneLicenseDocumentation = "LicenseDocumentation";
|
||||
|
||||
/// The key that stores the settings for determining log-related settings
|
||||
static constexpr const char* KeyLogging = "Logging";
|
||||
|
||||
/// The key that stores the directory for Logging
|
||||
static constexpr const char* LoggingDirectory = "Logging.LogDir";
|
||||
static constexpr const char* PartLogDir = "LogDir";
|
||||
|
||||
/// The key that stores the desired LogLevel for the whole application
|
||||
/// \sa ghoul::logging::LogManager
|
||||
static constexpr const char* KeyLoggingLogLevel = "Logging.LogLevel";
|
||||
static constexpr const char* PartLogLevel = "LogLevel";
|
||||
|
||||
/// The key that stores whether the log should be immediately flushed after a n
|
||||
/// \sa ghoul::logging::LogManager
|
||||
static constexpr const char* KeyLoggingImmediateFlush = "Logging.ImmediateFlush";
|
||||
static constexpr const char* PartImmediateFlush = "ImmediateFlush";
|
||||
|
||||
/// The key for prefixing PerformanceMeasurement logfiles
|
||||
static constexpr const char* LoggingPerformancePrefix = "Logging.PerformancePrefix";
|
||||
static constexpr const char* PartLogPerformancePrefix = "PerformancePrefix";
|
||||
/// The key that stores a subdirectory with a description for additional
|
||||
/// ghoul::logging::Log%s to be created
|
||||
/// \sa LogFactory
|
||||
static constexpr const char* KeyLoggingLogs = "Logging.Logs";
|
||||
static constexpr const char* PartLogs = "Logs";
|
||||
|
||||
/// The key that stores whether a log should be appended to or should be overwritten
|
||||
static constexpr const char* PartAppend = "Append";
|
||||
|
||||
/// The key that stores the verbosity (None, Minimal, Default, Full) of the system
|
||||
/// capabilities components
|
||||
static constexpr const char* PartCapabilitiesVerbosity = "CapabilitiesVerbosity";
|
||||
|
||||
/// The key that stores the settings for determining Launcher-related settings
|
||||
static constexpr const char* KeyLauncher = "Launcher";
|
||||
|
||||
/// The full key that stores the verbosity of the system capabilities component
|
||||
static constexpr const char* KeyCapabilitiesVerbosity =
|
||||
"Logging.CapabilitiesVerbosity";
|
||||
|
||||
/// The key that stores the time (in seconds) that the application will wait before
|
||||
/// shutting down after the shutdown call is made
|
||||
static constexpr const char* KeyShutdownCountdown = "ShutdownCountdown";
|
||||
|
||||
/// The key that stores whether the onscreen text should be scaled to the window size
|
||||
/// or the window resolution
|
||||
static constexpr const char* KeyOnScreenTextScaling = "OnScreenTextScaling";
|
||||
|
||||
/// The key that stores whether the master node should perform rendering just function
|
||||
/// as a pure manager
|
||||
static constexpr const char* KeyDisableMasterRendering = "DisableRenderingOnMaster";
|
||||
|
||||
/// The key that stores whether the master node should apply the scene transformation
|
||||
static constexpr const char* KeyDisableSceneOnMaster = "DisableSceneOnMaster";
|
||||
|
||||
/// The key that stores the switch for enabling/disabling the rendering on a master
|
||||
/// computer
|
||||
static constexpr const char* KeyRenderingMethod = "RenderingMethod";
|
||||
|
||||
/// The key that determines whether a new cache folder is used for each scene file
|
||||
static constexpr const char* KeyPerSceneCache = "PerSceneCache";
|
||||
|
||||
/// The key that stores the http proxy settings for the downloadmanager
|
||||
static constexpr const char* KeyHttpProxy = "HttpProxy";
|
||||
|
||||
/// The key that stores the address of the http proxy
|
||||
static constexpr const char* PartHttpProxyAddress = "Address";
|
||||
|
||||
/// The key that stores the port of the http proxy
|
||||
static constexpr const char* PartHttpProxyPort = "Port";
|
||||
|
||||
/// The key that stores the authentication method of the http proxy
|
||||
static constexpr const char* PartHttpProxyAuthentication = "Authentication";
|
||||
|
||||
/// Key that stores the username to use for authentication to access the http proxy
|
||||
static constexpr const char* PartHttpProxyUser = "User";
|
||||
|
||||
/// Key that stores the password to use for authentication to access the http proxy
|
||||
static constexpr const char* PartHttpProxyPassword = "Password";
|
||||
|
||||
/// The key that stores the dictionary containing information about debug contexts
|
||||
static constexpr const char* KeyOpenGLDebugContext = "OpenGLDebugContext";
|
||||
|
||||
/// The part of the key storing whether an OpenGL Debug context should be created
|
||||
static constexpr const char* PartActivate = "Activate";
|
||||
|
||||
/// The part of the key storing whether the debug callbacks are performed synchronous
|
||||
static constexpr const char* PartSynchronous = "Synchronous";
|
||||
|
||||
/// The part of the key storing a list of identifiers that should be filtered out
|
||||
static constexpr const char* PartFilterIdentifier = "FilterIdentifier";
|
||||
|
||||
/// The part of the key that stores the source of the ignored identifier
|
||||
static constexpr const char* PartFilterIdentifierSource = "Source";
|
||||
|
||||
/// The part of the key that stores the type of the ignored identifier
|
||||
static constexpr const char* PartFilterIdentifierType = "Type";
|
||||
|
||||
/// The part of the key that stores the identifier of the ignored identifier
|
||||
static constexpr const char* PartFilterIdentifierIdentifier = "Identifier";
|
||||
|
||||
/// The part of the key storing a list of severities that should be filtered out
|
||||
static constexpr const char* PartFilterSeverity = "PartFilterSeverity";
|
||||
|
||||
/// The part of the key storing whether the OpenGL state should be checked each call
|
||||
static constexpr const char* KeyCheckOpenGLState = "CheckOpenGLState";
|
||||
|
||||
/// The part of the key storing whether the OpenGL state should be checked each call
|
||||
static constexpr const char* KeyServerPasskey = "ServerPasskey";
|
||||
|
||||
/// Whitelist of client addresses that won't need autorization
|
||||
static constexpr const char* KeyServerClientAddressWhitelist =
|
||||
"ClientAddressWhitelist";
|
||||
|
||||
static constexpr const char* KeyLogEachOpenGLCall = "LogEachOpenGLCall";
|
||||
|
||||
/// This key determines whether the scene graph nodes should initialized multithreaded
|
||||
static constexpr const char* KeyUseMultithreadedInitialization =
|
||||
"UseMultithreadedInitialization";
|
||||
|
||||
/// The key under which all of the loading settings are grouped
|
||||
static constexpr const char* KeyLoadingScreen = "LoadingScreen";
|
||||
|
||||
/// The part of the key storing whether the loading screen should display the message
|
||||
/// about current status
|
||||
static constexpr const char* KeyLoadingScreenShowMessage =
|
||||
"LoadingScreen.ShowMessage";
|
||||
static constexpr const char* PartShowMessage = "ShowMessage";
|
||||
|
||||
/// The part of the key storing whether the loading screen should display node names
|
||||
static constexpr const char* KeyLoadingScreenShowNodeNames =
|
||||
"LoadingScreen.ShowNodeNames";
|
||||
static constexpr const char* PartShowNodeNames = "ShowNodeNames";
|
||||
|
||||
/// The part of the key storing whether the loading screen should contain a progress
|
||||
/// bar
|
||||
static constexpr const char* KeyLoadingScreenShowProgressbar =
|
||||
"LoadingScreen.ShowProgressbar";
|
||||
static constexpr const char* PartShowProgressbar = "ShowProgressbar";
|
||||
|
||||
/// The key used to specify module specific configurations
|
||||
static constexpr const char* KeyModuleConfigurations = "ModuleConfigurations";
|
||||
|
||||
/// The key used to specify whether screenshots should contain the current date
|
||||
static constexpr const char* KeyScreenshotUseDate = "ScreenshotUseDate";
|
||||
|
||||
static constexpr const char* KeyWebHelperLocation = "WebHelperLocation";
|
||||
static constexpr const char* KeyCefWebGuiUrl = "CefWebGuiUrl";
|
||||
|
||||
/**
|
||||
* Iteratively walks the directory structure starting with \p filename to find the
|
||||
* base name compoenent of \p filename. The directory structure is searched by first
|
||||
* searching the current directory and then moving iteratively to the the parent
|
||||
* directory.
|
||||
* \param filename The fully qualified filename to be searched for
|
||||
* \return The path to the file that was found with the same base name as \p filename
|
||||
* but higher up in the file structure.
|
||||
* \throw ghoul::RuntimeError If the configuration could not be found
|
||||
*/
|
||||
static std::string findConfiguration(const std::string& filename);
|
||||
|
||||
/**
|
||||
* Load the provided configuration file (\p filename) into this Dictionary. All paths
|
||||
* that are specified in the configuration file will automatically be registered in
|
||||
* the ghoul::filesystem::FileSystem.
|
||||
* \param filename The filename to be loaded
|
||||
* \throw SpecificationError If the configuration file was not complete (i.e., did
|
||||
* not specify the necessary keys KeyPaths, KeyPaths.KeyCache, KeyFonts, and
|
||||
* KeyConfigSgct)
|
||||
* \throw ghoul::lua::LuaRuntimeException If there was Lua-based error loading the
|
||||
* configuration file
|
||||
* \pre \p filename must not be empty
|
||||
* \pre \p filename must exist
|
||||
*/
|
||||
void loadFromFile(const std::string& filename);
|
||||
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___CONFIGURATIONMANAGER___H__
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
|
||||
namespace ghoul::systemcapabilities { struct Version; }
|
||||
|
||||
@@ -59,7 +60,7 @@ public:
|
||||
* \throw ghoul::RuntimeError If two modules in the default modules have the same
|
||||
* name
|
||||
*/
|
||||
void initialize(const ghoul::Dictionary& moduleConfigurations);
|
||||
void initialize(const std::map<std::string, ghoul::Dictionary>& moduleConfigurations);
|
||||
|
||||
/**
|
||||
* Calls the initializeGL functions of all registered OpenSpaceModule%s.
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#ifndef __OPENSPACE_CORE___OPENSPACEENGINE___H__
|
||||
#define __OPENSPACE_CORE___OPENSPACEENGINE___H__
|
||||
|
||||
#include <openspace/interaction/joystickinputstate.h>
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
#include <openspace/util/keys.h>
|
||||
#include <openspace/util/mouse.h>
|
||||
@@ -43,7 +44,7 @@ namespace ghoul::fontrendering { class FontManager; }
|
||||
namespace openspace {
|
||||
|
||||
class AssetManager;
|
||||
class ConfigurationManager;
|
||||
struct Configuration;
|
||||
class Dashboard;
|
||||
class DownloadManager;
|
||||
class GUI;
|
||||
@@ -60,9 +61,9 @@ class VirtualPropertyManager;
|
||||
class WindowWrapper;
|
||||
|
||||
namespace interaction {
|
||||
class NavigationHandler;
|
||||
class KeyBindingManager;
|
||||
}
|
||||
class NavigationHandler;
|
||||
} // namespace interaction
|
||||
namespace gui { class GUI; }
|
||||
namespace properties { class PropertyOwner; }
|
||||
namespace scripting {
|
||||
@@ -75,12 +76,12 @@ namespace scripting {
|
||||
struct ShutdownInformation {
|
||||
// Whether the application is currently in shutdown mode (i.e. counting down the
|
||||
// timer and closing it at '0'
|
||||
bool inShutdown;
|
||||
bool inShutdown = false;
|
||||
// Total amount of time the application will wait before actually shutting down
|
||||
float waitTime;
|
||||
float waitTime = 0.f;
|
||||
// Current state of the countdown; if it reaches '0', the application will
|
||||
// close
|
||||
float timer;
|
||||
float timer = 0.f;
|
||||
};
|
||||
|
||||
class OpenSpaceEngine {
|
||||
@@ -94,7 +95,7 @@ public:
|
||||
static OpenSpaceEngine& ref();
|
||||
static bool isCreated();
|
||||
|
||||
~OpenSpaceEngine();
|
||||
~OpenSpaceEngine() = default;
|
||||
|
||||
// callbacks
|
||||
void initialize();
|
||||
@@ -111,6 +112,7 @@ public:
|
||||
void mouseButtonCallback(MouseButton button, MouseAction action);
|
||||
void mousePositionCallback(double x, double y);
|
||||
void mouseScrollWheelCallback(double posX, double posY);
|
||||
void setJoystickInputStates(interaction::JoystickInputStates& states);
|
||||
void externalControlCallback(const char* receivedChars, int size, int clientId);
|
||||
void encode();
|
||||
void decode();
|
||||
@@ -119,8 +121,12 @@ public:
|
||||
void scheduleLoadSingleAsset(std::string assetPath);
|
||||
void toggleShutdownMode();
|
||||
|
||||
// On purpose, there is no function that returns a non-const reference to
|
||||
// Configuration; that guards us against anyone in the program changing the
|
||||
// configuration values underneath our feet
|
||||
const Configuration& configuration() const;
|
||||
|
||||
// Guaranteed to return a valid pointer
|
||||
ConfigurationManager& configurationManager();
|
||||
LuaConsole& console();
|
||||
AssetManager& assetManager();
|
||||
Dashboard& dashboard();
|
||||
@@ -193,7 +199,6 @@ private:
|
||||
OpenSpaceEngine(std::string programName,
|
||||
std::unique_ptr<WindowWrapper> windowWrapper);
|
||||
|
||||
std::unique_ptr<LoadingScreen> createLoadingScreen();
|
||||
void loadSingleAsset(const std::string& assetPath);
|
||||
void gatherCommandlineArguments();
|
||||
void loadFonts();
|
||||
@@ -203,8 +208,9 @@ private:
|
||||
void runGlobalCustomizationScripts();
|
||||
void configureLogging();
|
||||
|
||||
std::unique_ptr<Configuration> _configuration;
|
||||
|
||||
// Components
|
||||
std::unique_ptr<ConfigurationManager> _configurationManager;
|
||||
std::unique_ptr<Scene> _scene;
|
||||
std::unique_ptr<AssetManager> _assetManager;
|
||||
std::unique_ptr<Dashboard> _dashboard;
|
||||
@@ -237,7 +243,7 @@ private:
|
||||
properties::StringProperty sourceControlInformation;
|
||||
} _versionInformation;
|
||||
|
||||
bool _hasScheduledAssetLoading;
|
||||
bool _hasScheduledAssetLoading = false;
|
||||
std::string _scheduledAssetPathToLoad;
|
||||
|
||||
struct {
|
||||
@@ -265,7 +271,9 @@ private:
|
||||
|
||||
// The first frame might take some more time in the update loop, so we need to know to
|
||||
// disable the synchronization; otherwise a hardware sync will kill us after 1 minute
|
||||
bool _isFirstRenderingFirstFrame;
|
||||
bool _isFirstRenderingFirstFrame = true;
|
||||
|
||||
glm::dvec2 _mousePosition;
|
||||
|
||||
static OpenSpaceEngine* _engine;
|
||||
};
|
||||
|
||||
@@ -53,8 +53,10 @@ public:
|
||||
glm::vec2 mousePosition() const override;
|
||||
uint32_t mouseButtons(int maxNumber) const override;
|
||||
glm::ivec2 currentWindowSize() const override;
|
||||
glm::ivec2 currentSubwindowSize() const override;
|
||||
glm::ivec2 currentWindowResolution() const override;
|
||||
glm::ivec2 currentDrawBufferResolution() const override;
|
||||
glm::ivec2 getCurrentViewportSize() const override;
|
||||
glm::vec2 dpiScaling() const override;
|
||||
int currentNumberOfAaSamples() const override;
|
||||
|
||||
|
||||
@@ -137,6 +137,15 @@ public:
|
||||
*/
|
||||
virtual glm::ivec2 currentWindowSize() const;
|
||||
|
||||
/**
|
||||
* Returns the size of the currently active subwindow in pixel coordinates. On default,
|
||||
* this method returns the same a currentWindowSize. A subwindow is the part of a
|
||||
* window that is used for one of the eyes in stereoscopic side-by-side/top-bottom
|
||||
* rendering.
|
||||
* \return The size of the currently active subwindow in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 currentSubwindowSize() const;
|
||||
|
||||
/**
|
||||
* Returns the resolution of the currently active window in pixel coordinates. On
|
||||
* default, this method returns the same size as #currentWindowSize.
|
||||
@@ -151,6 +160,13 @@ public:
|
||||
*/
|
||||
virtual glm::ivec2 currentDrawBufferResolution() const;
|
||||
|
||||
/**
|
||||
* Returns the resolution of the currently viewport resolution in pixel
|
||||
* coordinates.
|
||||
* \return The resolution of the currently viewport in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 getCurrentViewportSize() const;
|
||||
|
||||
/**
|
||||
* Returns the DPI scaling factor for the current window. This is normally 1 on all
|
||||
* regular monitors and 2 on Retina screens.
|
||||
|
||||
@@ -22,10 +22,60 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#version __CONTEXT__
|
||||
#ifndef __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
|
||||
#define __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
|
||||
|
||||
out vec4 renderTableColor;
|
||||
#include <openspace/interaction/delayedvariable.h>
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
void main() {
|
||||
renderTableColor = vec4(0.0);
|
||||
}
|
||||
namespace openspace::interaction {
|
||||
|
||||
class InputState;
|
||||
|
||||
class CameraInteractionStates {
|
||||
public:
|
||||
/**
|
||||
* \param sensitivity
|
||||
* \param velocityScaleFactor can be set to 60 to remove the inertia of the
|
||||
* interaction. Lower value will make it harder to move the camera.
|
||||
*/
|
||||
CameraInteractionStates(double sensitivity, double velocityScaleFactor);
|
||||
virtual ~CameraInteractionStates() = default;
|
||||
|
||||
virtual void updateStateFromInput(const InputState& inputState, double deltaTime) = 0;
|
||||
|
||||
void setRotationalFriction(double friction);
|
||||
void setHorizontalFriction(double friction);
|
||||
void setVerticalFriction(double friction);
|
||||
void setSensitivity(double sensitivity);
|
||||
void setVelocityScaleFactor(double scaleFactor);
|
||||
|
||||
glm::dvec2 globalRotationVelocity() const;
|
||||
glm::dvec2 localRotationVelocity() const;
|
||||
glm::dvec2 truckMovementVelocity() const;
|
||||
glm::dvec2 localRollVelocity() const;
|
||||
glm::dvec2 globalRollVelocity() const;
|
||||
|
||||
protected:
|
||||
struct InteractionState {
|
||||
InteractionState(double scaleFactor);
|
||||
void setFriction(double friction);
|
||||
void setVelocityScaleFactor(double scaleFactor);
|
||||
|
||||
glm::dvec2 previousPosition;
|
||||
DelayedVariable<glm::dvec2, double> velocity;
|
||||
};
|
||||
|
||||
|
||||
double _sensitivity;
|
||||
|
||||
InteractionState _globalRotationState;
|
||||
InteractionState _localRotationState;
|
||||
InteractionState _truckMovementState;
|
||||
InteractionState _localRollState;
|
||||
InteractionState _globalRollState;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
#endif // __OPENSPACE_CORE___CAMERAINTERACTIONSTATES___H__
|
||||
@@ -22,56 +22,60 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___MOUSESTATE___H__
|
||||
#define __OPENSPACE_CORE___MOUSESTATE___H__
|
||||
#ifndef __OPENSPACE_CORE___INPUTDEVICESTATES___H__
|
||||
#define __OPENSPACE_CORE___INPUTDEVICESTATES___H__
|
||||
|
||||
#include <openspace/interaction/delayedvariable.h>
|
||||
#include <openspace/interaction/inputstate.h>
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
struct MouseState {
|
||||
MouseState(double scaleFactor);
|
||||
void setFriction(double friction);
|
||||
void setVelocityScaleFactor(double scaleFactor);
|
||||
class InputState;
|
||||
|
||||
glm::dvec2 previousPosition;
|
||||
DelayedVariable<glm::dvec2, double> velocity;
|
||||
};
|
||||
|
||||
class MouseStates {
|
||||
class CameraInteractionStates {
|
||||
public:
|
||||
/**
|
||||
* \param sensitivity
|
||||
* \param velocityScaleFactor can be set to 60 to remove the inertia of the
|
||||
* interaction. Lower value will make it harder to move the camera.
|
||||
*/
|
||||
MouseStates(double sensitivity, double velocityScaleFactor);
|
||||
void updateMouseStatesFromInput(const InputState& inputState, double deltaTime);
|
||||
CameraInteractionStates(double sensitivity, double velocityScaleFactor);
|
||||
virtual ~CameraInteractionStates() = default;
|
||||
|
||||
virtual void updateStateFromInput(const InputState& inputState, double deltaTime) = 0;
|
||||
|
||||
void setRotationalFriction(double friction);
|
||||
void setHorizontalFriction(double friction);
|
||||
void setVerticalFriction(double friction);
|
||||
void setSensitivity(double sensitivity);
|
||||
void setVelocityScaleFactor(double scaleFactor);
|
||||
|
||||
glm::dvec2 globalRotationMouseVelocity() const;
|
||||
glm::dvec2 localRotationMouseVelocity() const;
|
||||
glm::dvec2 truckMovementMouseVelocity() const;
|
||||
glm::dvec2 localRollMouseVelocity() const;
|
||||
glm::dvec2 globalRollMouseVelocity() const;
|
||||
glm::dvec2 globalRotationVelocity() const;
|
||||
glm::dvec2 localRotationVelocity() const;
|
||||
glm::dvec2 truckMovementVelocity() const;
|
||||
glm::dvec2 localRollVelocity() const;
|
||||
glm::dvec2 globalRollVelocity() const;
|
||||
|
||||
protected:
|
||||
struct InteractionState {
|
||||
InteractionState(double scaleFactor);
|
||||
void setFriction(double friction);
|
||||
void setVelocityScaleFactor(double scaleFactor);
|
||||
|
||||
glm::dvec2 previousPosition;
|
||||
DelayedVariable<glm::dvec2, double> velocity;
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
double _sensitivity;
|
||||
|
||||
MouseState _globalRotationMouseState;
|
||||
MouseState _localRotationMouseState;
|
||||
MouseState _truckMovementMouseState;
|
||||
MouseState _localRollMouseState;
|
||||
MouseState _globalRollMouseState;
|
||||
InteractionState _globalRotationState;
|
||||
InteractionState _localRotationState;
|
||||
InteractionState _truckMovementState;
|
||||
InteractionState _localRollState;
|
||||
InteractionState _globalRollState;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
#endif // __OPENSPACE_CORE___MOUSESTATE___H__
|
||||
#endif // __OPENSPACE_CORE___INPUTDEVICESTATES___H__
|
||||
@@ -25,15 +25,15 @@
|
||||
#ifndef __OPENSPACE_CORE___INPUTSTATE___H__
|
||||
#define __OPENSPACE_CORE___INPUTSTATE___H__
|
||||
|
||||
#include <openspace/interaction/joystickinputstate.h>
|
||||
#include <openspace/util/keys.h>
|
||||
#include <openspace/util/mouse.h>
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
#include <list>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
// This class represents the global input state of interaction devices
|
||||
class InputState {
|
||||
public:
|
||||
InputState() = default;
|
||||
@@ -45,22 +45,34 @@ public:
|
||||
void mousePositionCallback(double mouseX, double mouseY);
|
||||
void mouseScrollWheelCallback(double mouseScrollDelta);
|
||||
|
||||
// Accessors
|
||||
const std::list<std::pair<Key, KeyModifier>>& getPressedKeys() const;
|
||||
const std::list<MouseButton>& getPressedMouseButtons() const;
|
||||
glm::dvec2 getMousePosition() const;
|
||||
double getMouseScrollDelta() const;
|
||||
void setJoystickInputStates(JoystickInputStates& states);
|
||||
|
||||
// Accessors
|
||||
const std::list<std::pair<Key, KeyModifier>>& pressedKeys() const;
|
||||
bool isKeyPressed(std::pair<Key, KeyModifier> keyModPair) const;
|
||||
bool isKeyPressed(Key key) const;
|
||||
|
||||
const std::list<MouseButton>& pressedMouseButtons() const;
|
||||
glm::dvec2 mousePosition() const;
|
||||
double mouseScrollDelta() const;
|
||||
bool isMouseButtonPressed(MouseButton mouseButton) const;
|
||||
|
||||
const JoystickInputStates& joystickInputStates() const;
|
||||
float joystickAxis(int i) const;
|
||||
bool joystickButton(int i) const;
|
||||
|
||||
private:
|
||||
// Input from keyboard and mouse
|
||||
// Input from keyboard
|
||||
std::list<std::pair<Key, KeyModifier>> _keysDown;
|
||||
|
||||
// Input from mouse
|
||||
std::list<MouseButton> _mouseButtonsDown;
|
||||
glm::dvec2 _mousePosition;
|
||||
double _mouseScrollDelta;
|
||||
|
||||
// Input from joysticks
|
||||
// The memory is owned by the outer most main (apps/OpenSpace/main.cpp right now)
|
||||
JoystickInputStates* _joystickInputStates = nullptr;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
123
include/openspace/interaction/joystickcamerastates.h
Normal file
123
include/openspace/interaction/joystickcamerastates.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__
|
||||
#define __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__
|
||||
|
||||
#include <openspace/interaction/camerainteractionstates.h>
|
||||
|
||||
#include <openspace/interaction/joystickinputstate.h>
|
||||
#include <ghoul/misc/boolean.h>
|
||||
#include <ghoul/misc/fromstring.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
class JoystickCameraStates : public CameraInteractionStates {
|
||||
public:
|
||||
enum class AxisType {
|
||||
None = 0,
|
||||
OrbitX,
|
||||
OrbitY,
|
||||
ZoomIn,
|
||||
ZoomOut,
|
||||
LocalRollX,
|
||||
LocalRollY,
|
||||
GlobalRollX,
|
||||
GlobalRollY,
|
||||
PanX,
|
||||
PanY
|
||||
};
|
||||
|
||||
BooleanType(AxisInvert);
|
||||
BooleanType(AxisNormalize);
|
||||
BooleanType(ButtonCommandRemote);
|
||||
|
||||
struct AxisInformation {
|
||||
AxisType type = AxisType::None;
|
||||
AxisInvert invert = AxisInvert::No;
|
||||
AxisNormalize normalize = AxisNormalize::No;
|
||||
|
||||
float deadzone = 0.f;
|
||||
};
|
||||
|
||||
|
||||
JoystickCameraStates(double sensitivity, double velocityScaleFactor);
|
||||
|
||||
void updateStateFromInput(const InputState& inputState, double deltaTime) override;
|
||||
|
||||
void setAxisMapping(
|
||||
int axis,
|
||||
AxisType mapping,
|
||||
AxisInvert shouldInvert = AxisInvert::No,
|
||||
AxisNormalize shouldNormalize = AxisNormalize::No
|
||||
);
|
||||
|
||||
AxisInformation axisMapping(int axis) const;
|
||||
|
||||
void setDeadzone(int axis, float deadzone);
|
||||
float deadzone(int axis) const;
|
||||
|
||||
|
||||
void bindButtonCommand(int button, std::string command, JoystickAction action,
|
||||
ButtonCommandRemote local);
|
||||
void clearButtonCommand(int button);
|
||||
std::vector<std::string> buttonCommand(int button) const;
|
||||
|
||||
private:
|
||||
// We use an array for the axes and a map for the buttons since the axis are going to
|
||||
// be accessed much more often and thus have to be more efficient. And storing a few
|
||||
// extra AxisInformation that are not used will not matter that much; finding an axis
|
||||
// location in a potential map each frame, however, would
|
||||
|
||||
std::array<AxisInformation, JoystickInputState::MaxAxes> _axisMapping;
|
||||
|
||||
struct ButtonInformation {
|
||||
std::string command;
|
||||
JoystickAction action;
|
||||
ButtonCommandRemote synchronization;
|
||||
std::string documentation;
|
||||
};
|
||||
|
||||
std::multimap<int, ButtonInformation> _buttonMapping;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
namespace std {
|
||||
|
||||
std::string to_string(const openspace::interaction::JoystickCameraStates::AxisType& type);
|
||||
|
||||
} // namespace std
|
||||
|
||||
namespace ghoul {
|
||||
|
||||
template <>
|
||||
openspace::interaction::JoystickCameraStates::AxisType
|
||||
from_string(const std::string& string);
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
#endif // __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__
|
||||
126
include/openspace/interaction/joystickinputstate.h
Normal file
126
include/openspace/interaction/joystickinputstate.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
|
||||
#define __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
|
||||
|
||||
#include <ghoul/misc/fromstring.h>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
/**
|
||||
* Actions that any button of a joystick can have. Each button must be in one of these
|
||||
* states
|
||||
*/
|
||||
enum class JoystickAction : uint8_t {
|
||||
/// Idle state if the button is unpressed and has been unpressed since last frame
|
||||
Idle = 0,
|
||||
/// If the button has been pressed since the last frame
|
||||
Press,
|
||||
/// If the button has been pressed since longer than last frame
|
||||
Repeat,
|
||||
/// If the button was released since the last frame
|
||||
Release
|
||||
};
|
||||
|
||||
/**
|
||||
* The input state of a single joystick.
|
||||
*/
|
||||
struct JoystickInputState {
|
||||
/// The maximum number of supported axes
|
||||
static constexpr const int MaxAxes = 8;
|
||||
/// The maximum number of supported buttons
|
||||
static constexpr const int MaxButtons = 32;
|
||||
|
||||
/// Marks whether this joystick is connected. If this value is \c false, all other
|
||||
/// members of this struct are undefined
|
||||
bool isConnected = false;
|
||||
|
||||
/// The name of this joystick
|
||||
std::string name;
|
||||
|
||||
/// The number of axes that this joystick supports
|
||||
int nAxes = 0;
|
||||
/// The values for each axis. Each value is in the range [-1, 1]. Only the first
|
||||
/// \c nAxes values are defined values, the rest are undefined
|
||||
std::array<float, MaxAxes> axes;
|
||||
|
||||
/// The number of buttons that this joystick possesses
|
||||
int nButtons = 0;
|
||||
/// The status of each button. Only the first \c nButtons values are defined, the rest
|
||||
/// are undefined
|
||||
std::array<JoystickAction, MaxButtons> buttons;
|
||||
};
|
||||
|
||||
/// The maximum number of joysticks that are supported by this system. This number is
|
||||
/// derived from the available GLFW constants
|
||||
constexpr const int MaxJoysticks = 16;
|
||||
struct JoystickInputStates : public std::array<JoystickInputState, MaxJoysticks> {
|
||||
/**
|
||||
* This function adds the contributions of all connected joysticks for the provided
|
||||
* \p axis. After adding each joysticks contribution, the result is clamped to [-1,1].
|
||||
* If a joystick does not possess a particular axis, it's does not contribute to the
|
||||
* sum.
|
||||
*
|
||||
* \param axis The numerical axis for which the values are added
|
||||
* \return The summed axis values of all connected joysticks
|
||||
*
|
||||
* \pre \p axis must be 0 or positive
|
||||
*/
|
||||
float axis(int axis) const;
|
||||
|
||||
/**
|
||||
* This functions checks whether any connected joystick has its \p button in the
|
||||
* passed \p action. Any joystick that does not posses the \p button, it will be
|
||||
* ignored.
|
||||
*
|
||||
* \param button The button that is to be checked
|
||||
* \param action The action which is checked for each button
|
||||
* \return \c true if there is at least one joystick whose \param button is in the
|
||||
* \p action state
|
||||
*
|
||||
* \pre \p button must be 0 or positive
|
||||
*/
|
||||
bool button(int button, JoystickAction action) const;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
namespace std {
|
||||
|
||||
std::string to_string(openspace::interaction::JoystickAction action);
|
||||
|
||||
} // namespace std
|
||||
|
||||
namespace ghoul {
|
||||
|
||||
template <>
|
||||
openspace::interaction::JoystickAction from_string(const std::string& str);
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
#endif // __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
|
||||
@@ -79,7 +79,6 @@ public:
|
||||
void keyboardCallback(Key key, KeyModifier modifier, KeyAction action);
|
||||
|
||||
private:
|
||||
|
||||
std::string generateJson() const override;
|
||||
|
||||
std::multimap<KeyWithModifier, KeyInformation> _keyLua;
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
glm::dvec3 position;
|
||||
glm::quat rotation;
|
||||
std::string focusNode;
|
||||
float scale;
|
||||
bool followFocusNodeRotation;
|
||||
};
|
||||
|
||||
|
||||
@@ -22,30 +22,20 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___CONTROLLER___H__
|
||||
#define __OPENSPACE_CORE___CONTROLLER___H__
|
||||
#ifndef __OPENSPACE_CORE___MOUSECAMERASTATES___H__
|
||||
#define __OPENSPACE_CORE___MOUSECAMERASTATES___H__
|
||||
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
#include <glm/gtx/vector_angle.hpp>
|
||||
#include <openspace/interaction/camerainteractionstates.h>
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
class NavigationHandler;
|
||||
|
||||
class Controller {
|
||||
class MouseCameraStates : public CameraInteractionStates {
|
||||
public:
|
||||
Controller() :
|
||||
_handler(nullptr)
|
||||
{}
|
||||
MouseCameraStates(double sensitivity, double velocityScaleFactor);
|
||||
|
||||
void setHandler(NavigationHandler* handler);
|
||||
|
||||
protected:
|
||||
NavigationHandler* _handler;
|
||||
void updateStateFromInput(const InputState& inputState, double deltaTime) override;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
#endif // __OPENSPACE_CORE___CONTROLLER___H__
|
||||
#endif // __OPENSPACE_CORE___MOUSECAMERASTATES___H__
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include <openspace/interaction/orbitalnavigator.h>
|
||||
#include <openspace/interaction/keyframenavigator.h>
|
||||
#include <openspace/interaction/joystickinputstate.h>
|
||||
#include <openspace/interaction/joystickcamerastates.h>
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
@@ -63,7 +65,7 @@ public:
|
||||
void updateCamera(double deltaTime);
|
||||
|
||||
// Accessors
|
||||
ghoul::Dictionary getCameraStateDictionary();
|
||||
ghoul::Dictionary cameraStateDictionary();
|
||||
SceneGraphNode* focusNode() const;
|
||||
glm::dvec3 focusNodeToCameraVector() const;
|
||||
glm::quat focusNodeToCameraRotation() const;
|
||||
@@ -74,10 +76,35 @@ public:
|
||||
|
||||
// Callback functions
|
||||
void keyboardCallback(Key key, KeyModifier modifier, KeyAction action);
|
||||
|
||||
void mouseButtonCallback(MouseButton button, MouseAction action);
|
||||
void mousePositionCallback(double x, double y);
|
||||
void mouseScrollWheelCallback(double pos);
|
||||
|
||||
void setJoystickInputStates(JoystickInputStates& states);
|
||||
|
||||
void setJoystickAxisMapping(
|
||||
int axis,
|
||||
JoystickCameraStates::AxisType mapping,
|
||||
JoystickCameraStates::AxisInvert shouldInvert =
|
||||
JoystickCameraStates::AxisInvert::No,
|
||||
JoystickCameraStates::AxisNormalize shouldNormalize =
|
||||
JoystickCameraStates::AxisNormalize::No
|
||||
);
|
||||
|
||||
JoystickCameraStates::AxisInformation joystickAxisMapping(int axis) const;
|
||||
|
||||
void setJoystickAxisDeadzone(int axis, float deadzone);
|
||||
float joystickAxisDeadzone(int axis) const;
|
||||
|
||||
void bindJoystickButtonCommand(int button, std::string command, JoystickAction action,
|
||||
JoystickCameraStates::ButtonCommandRemote remote);
|
||||
|
||||
void clearJoystickButtonCommand(int button);
|
||||
std::vector<std::string> joystickButtonCommand(int button) const;
|
||||
|
||||
|
||||
|
||||
void saveCameraStateToFile(const std::string& filepath);
|
||||
void restoreCameraStateFromFile(const std::string& filepath);
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
#include <openspace/interaction/delayedvariable.h>
|
||||
#include <openspace/interaction/inputstate.h>
|
||||
#include <openspace/interaction/interpolator.h>
|
||||
#include <openspace/interaction/mousestate.h>
|
||||
#include <openspace/interaction/joystickcamerastates.h>
|
||||
#include <openspace/interaction/mousecamerastates.h>
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
@@ -50,11 +51,14 @@ public:
|
||||
OrbitalNavigator();
|
||||
~OrbitalNavigator();
|
||||
|
||||
void updateMouseStatesFromInput(const InputState& inputState, double deltaTime);
|
||||
void updateCameraStateFromMouseStates(Camera& camera, double deltaTime);
|
||||
void updateStatesFromInput(const InputState& inputState, double deltaTime);
|
||||
void updateCameraStateFromStates(Camera& camera, double deltaTime);
|
||||
|
||||
void setFocusNode(SceneGraphNode* focusNode);
|
||||
void startInterpolateCameraDirection(const Camera& camera);
|
||||
|
||||
JoystickCameraStates& joystickStates();
|
||||
|
||||
bool followingNodeRotation() const;
|
||||
SceneGraphNode* focusNode() const;
|
||||
|
||||
@@ -82,15 +86,28 @@ private:
|
||||
|
||||
properties::FloatProperty _followFocusNodeRotationDistance;
|
||||
properties::FloatProperty _minimumAllowedDistance;
|
||||
properties::FloatProperty _sensitivity;
|
||||
|
||||
MouseStates _mouseStates;
|
||||
properties::FloatProperty _mouseSensitivity;
|
||||
properties::FloatProperty _joystickSensitivity;
|
||||
|
||||
properties::BoolProperty _useAdaptiveStereoscopicDepth;
|
||||
properties::FloatProperty _stereoscopicDepthOfFocusSurface;
|
||||
properties::FloatProperty _staticViewScaleExponent;
|
||||
|
||||
properties::FloatProperty _rotateToFocusInterpolationTime;
|
||||
properties::FloatProperty _stereoInterpolationTime;
|
||||
|
||||
MouseCameraStates _mouseStates;
|
||||
JoystickCameraStates _joystickStates;
|
||||
|
||||
SceneGraphNode* _focusNode = nullptr;
|
||||
glm::dvec3 _previousFocusNodePosition;
|
||||
glm::dquat _previousFocusNodeRotation;
|
||||
double _currentCameraToSurfaceDistance;
|
||||
bool _directlySetStereoDistance = false;
|
||||
|
||||
Interpolator<double> _rotateToFocusNodeInterpolator;
|
||||
Interpolator<double> _cameraToSurfaceDistanceInterpolator;
|
||||
Interpolator<double> _followRotationInterpolator;
|
||||
|
||||
/**
|
||||
@@ -116,14 +133,19 @@ private:
|
||||
* \returns a local camera rotation modified with two degrees of freedom.
|
||||
*/
|
||||
glm::dquat rotateLocally(double deltaTime,
|
||||
const glm::dquat& localCameraRotation) const;
|
||||
const glm::dquat& localCameraRotation) const;
|
||||
|
||||
/**
|
||||
* Interpolates the local rotation towards a 0 rotation.
|
||||
* \returns a modified local rotation interpolated towards 0.
|
||||
*/
|
||||
glm::dquat interpolateLocalRotation(double deltaTime,
|
||||
const glm::dquat& localCameraRotation);
|
||||
const glm::dquat& localCameraRotation);
|
||||
|
||||
|
||||
double interpolateCameraToSurfaceDistance(double deltaTime,
|
||||
double currentDistance,
|
||||
double targetDistance);
|
||||
|
||||
/**
|
||||
* Translates the horizontal direction. If far from the focus object, this will
|
||||
@@ -132,10 +154,9 @@ private:
|
||||
* \returns a position vector adjusted in the horizontal direction.
|
||||
*/
|
||||
glm::dvec3 translateHorizontally(double deltaTime, const glm::dvec3& cameraPosition,
|
||||
const glm::dvec3& objectPosition,
|
||||
const glm::dquat& focusNodeRotationDiff,
|
||||
const glm::dquat& globalCameraRotation,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
const glm::dvec3& objectPosition, const glm::dquat& focusNodeRotationDiff,
|
||||
const glm::dquat& globalCameraRotation,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
|
||||
/*
|
||||
* Adds rotation to the camera position so that it follows the rotation of the focus
|
||||
@@ -143,35 +164,32 @@ private:
|
||||
* \returns a position updated with the rotation defined by focusNodeRotationDiff
|
||||
*/
|
||||
glm::dvec3 followFocusNodeRotation(const glm::dvec3& cameraPosition,
|
||||
const glm::dvec3& objectPosition,
|
||||
const glm::dquat& focusNodeRotationDiff) const;
|
||||
const glm::dvec3& objectPosition, const glm::dquat& focusNodeRotationDiff) const;
|
||||
|
||||
/**
|
||||
* Updates the global rotation so that it points towards the focus node.
|
||||
* \returns a global rotation quaternion defining a rotation towards the focus node.
|
||||
*/
|
||||
glm::dquat rotateGlobally(const glm::dquat& globalCameraRotation,
|
||||
const glm::dvec3& objectPosition,
|
||||
const glm::dquat& focusNodeRotationDiff,
|
||||
const glm::dvec3& cameraPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
const glm::dvec3& objectPosition, const glm::dquat& focusNodeRotationDiff,
|
||||
const glm::dvec3& cameraPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
|
||||
/**
|
||||
* Translates the camera position towards or away from the focus node.
|
||||
* \returns a position vector adjusted in the vertical direction.
|
||||
*/
|
||||
glm::dvec3 translateVertically(double deltaTime, const glm::dvec3& cameraPosition,
|
||||
const glm::dvec3& objectPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
const glm::dvec3& objectPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
|
||||
/**
|
||||
* Rotates the camera around the out vector of the surface.
|
||||
* \returns a quaternion adjusted to rotate around the out vector of the surface.
|
||||
*/
|
||||
glm::dquat rotateHorizontally(double deltaTime,
|
||||
const glm::dquat& globalCameraRotation,
|
||||
const glm::dvec3& cameraPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
const glm::dquat& globalCameraRotation, const glm::dvec3& cameraPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
|
||||
/**
|
||||
* Push the camera out to the surface of the object.
|
||||
@@ -179,19 +197,24 @@ private:
|
||||
* above the actual surface of the object
|
||||
*/
|
||||
glm::dvec3 pushToSurface(double minHeightAboveGround,
|
||||
const glm::dvec3& cameraPosition,
|
||||
const glm::dvec3& objectPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
const glm::dvec3& cameraPosition, const glm::dvec3& objectPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
|
||||
/**
|
||||
* Interpolates between rotationDiff and a 0 rotation.
|
||||
*/
|
||||
glm::dquat interpolateRotationDifferential(
|
||||
double deltaTime, double interpolationTime,
|
||||
const glm::dquat& rotationDiff,
|
||||
const glm::dvec3& objectPosition,
|
||||
const glm::dvec3& cameraPosition,
|
||||
const SurfacePositionHandle& positionHandle);
|
||||
glm::dquat interpolateRotationDifferential(double deltaTime,
|
||||
double interpolationTime, const glm::dquat& rotationDiff,
|
||||
const glm::dvec3& objectPosition, const glm::dvec3& cameraPosition,
|
||||
const SurfacePositionHandle& positionHandle);
|
||||
|
||||
/**
|
||||
* Get the vector from the camera to the surface of the focus object in world space.
|
||||
*/
|
||||
glm::dvec3 cameraToSurfaceVector(
|
||||
const glm::dvec3& cameraPos,
|
||||
const glm::dvec3& centerPos,
|
||||
const SurfacePositionHandle& posHandle);
|
||||
|
||||
/**
|
||||
* Calculates a SurfacePositionHandle given a camera position in world space.
|
||||
|
||||
@@ -49,6 +49,7 @@ struct CameraKeyframe {
|
||||
glm::dquat _rotation;
|
||||
bool _followNodeRotation;
|
||||
std::string _focusNode;
|
||||
float _scale;
|
||||
|
||||
double _timestamp;
|
||||
|
||||
@@ -88,6 +89,12 @@ struct CameraKeyframe {
|
||||
_focusNode.data() + nodeNameLength
|
||||
);
|
||||
|
||||
buffer.insert(
|
||||
buffer.end(),
|
||||
reinterpret_cast<char*>(&_scale),
|
||||
reinterpret_cast<char*>(&_scale) + sizeof(_scale)
|
||||
);
|
||||
|
||||
// Add timestamp
|
||||
buffer.insert(
|
||||
buffer.end(),
|
||||
@@ -124,6 +131,11 @@ struct CameraKeyframe {
|
||||
_focusNode = std::string(buffer.data() + offset, buffer.data() + offset + size);
|
||||
offset += size;
|
||||
|
||||
// Scale
|
||||
size = sizeof(_scale);
|
||||
memcpy(&_scale, buffer.data() + offset, size);
|
||||
offset += size;
|
||||
|
||||
// Timestamp
|
||||
size = sizeof(_timestamp);
|
||||
memcpy(&_timestamp, buffer.data() + offset, size);
|
||||
@@ -206,7 +218,7 @@ struct TimeKeyframe {
|
||||
// Timestamp
|
||||
size = sizeof(_timestamp);
|
||||
memcpy(&_timestamp, buffer.data() + offset, size);
|
||||
offset += size;
|
||||
// offset += size;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2017 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___BINARYPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___BINARYPROPERTY___H__
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
void setInterpolationTarget(ghoul::any value) override;
|
||||
void setLuaInterpolationTarget(lua_State* state) override;
|
||||
void setStringInterpolationTarget(std::string value) override;
|
||||
|
||||
|
||||
void interpolateValue(float t,
|
||||
ghoul::EasingFunc<float> easingFunc = nullptr) override;
|
||||
|
||||
|
||||
@@ -388,10 +388,14 @@ void NumericalProperty<T>::setExponent(float exponent) {
|
||||
template <typename T>
|
||||
std::string NumericalProperty<T>::generateAdditionalJsonDescription() const {
|
||||
std::string result = "{ ";
|
||||
result += "\"" + MinimumValueKey + "\": " + luaToJson(std::to_string(_minimumValue)) + ",";
|
||||
result += "\"" + MaximumValueKey + "\": " + luaToJson(std::to_string(_maximumValue)) + ",";
|
||||
result += "\"" + SteppingValueKey + "\": " + luaToJson(std::to_string(_stepping)) + ",";
|
||||
result += "\"" + ExponentValueKey + "\": " + luaToJson(std::to_string(_exponent));
|
||||
result +=
|
||||
"\"" + MinimumValueKey + "\": " + luaToJson(std::to_string(_minimumValue)) + ",";
|
||||
result +=
|
||||
"\"" + MaximumValueKey + "\": " + luaToJson(std::to_string(_maximumValue)) + ",";
|
||||
result +=
|
||||
"\"" + SteppingValueKey + "\": " + luaToJson(std::to_string(_stepping)) + ",";
|
||||
result +=
|
||||
"\"" + ExponentValueKey + "\": " + luaToJson(std::to_string(_exponent));
|
||||
result += " }";
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -396,8 +396,8 @@ public:
|
||||
const ghoul::Dictionary& metaData() const;
|
||||
|
||||
/**
|
||||
* Convert the Property into a string containing a JSON representation of the Property.
|
||||
* Includes description of the object.
|
||||
* Convert the Property into a string containing a JSON representation of the
|
||||
* Property. Includes description of the object.
|
||||
* @return the JSON string
|
||||
*/
|
||||
virtual std::string toJson() const;
|
||||
@@ -412,7 +412,7 @@ public:
|
||||
virtual void setInterpolationTarget(ghoul::any value);
|
||||
virtual void setLuaInterpolationTarget(lua_State* state);
|
||||
virtual void setStringInterpolationTarget(std::string value);
|
||||
|
||||
|
||||
virtual void interpolateValue(float t,
|
||||
ghoul::EasingFunc<float> easingFunction = nullptr);
|
||||
|
||||
|
||||
@@ -83,8 +83,8 @@ public:
|
||||
/**
|
||||
* Sets the identifier for this PropertyOwner. If the PropertyOwner does not have an
|
||||
* owner itself, the identifier must be globally unique. If the PropertyOwner has an
|
||||
* owner, the identifier must be unique to the owner (including the owner's
|
||||
* properties). No uniqueness check will be preformed here, but rather in the
|
||||
* owner, the identifier must be unique to the owner (including the owner's
|
||||
* properties). No uniqueness check will be preformed here, but rather in the
|
||||
* PropertyOwner::addProperty and PropertyOwner::addPropertySubOwner methods).
|
||||
*
|
||||
* \param identifier The identifier of this PropertyOwner. It must not contain any
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
std::string identifier() const;
|
||||
|
||||
/**
|
||||
* Sets the user-facing name of this PropertyOwner. This name does not have to be
|
||||
* Sets the user-facing name of this PropertyOwner. This name does not have to be
|
||||
* unique, but it is recommended to be.
|
||||
*
|
||||
* \param guiName The new user-facing name for this PropertyOwner
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace ghoul::filesystem { class File; }
|
||||
namespace ghoul::opengl {
|
||||
class ProgramObject;
|
||||
class Texture;
|
||||
} // namespace opengl
|
||||
} // namespace ghoul::opengl
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -61,8 +61,6 @@ public:
|
||||
void initialize() override;
|
||||
void deinitialize() override;
|
||||
|
||||
void setCamera(Camera* camera) override;
|
||||
void setScene(Scene* scene) override;
|
||||
void setResolution(glm::ivec2 res) override;
|
||||
void setNAaSamples(int nAaSamples) override;
|
||||
void setHDRExposure(float hdrExposure) override;
|
||||
@@ -79,7 +77,8 @@ public:
|
||||
void postRaycast(const RaycasterTask& raycasterTask);
|
||||
|
||||
void update() override;
|
||||
void render(float blackoutFactor, bool doPerformanceMeasurements) override;
|
||||
void render(Scene* scene, Camera* camera, float blackoutFactor,
|
||||
bool doPerformanceMeasurements) override;
|
||||
|
||||
/**
|
||||
* Update render data
|
||||
@@ -97,8 +96,6 @@ private:
|
||||
void saveTextureToMemory(const GLenum color_buffer_attachment,
|
||||
const int width, const int height, std::vector<double> & memory) const;
|
||||
|
||||
Camera* _camera;
|
||||
Scene* _scene;
|
||||
glm::ivec2 _resolution;
|
||||
|
||||
bool _dirtyResolution;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace ghoul::filesystem { class File; }
|
||||
namespace ghoul::opengl {
|
||||
class ProgramObject;
|
||||
class Texture;
|
||||
}
|
||||
} // namespace ghoul::opengl
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -54,6 +54,15 @@ class Scene;
|
||||
class FramebufferRenderer : public Renderer, public RaycasterListener,
|
||||
public DeferredcasterListener
|
||||
{
|
||||
public:
|
||||
typedef std::map<
|
||||
VolumeRaycaster*,
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject>
|
||||
> RaycasterProgObjMap;
|
||||
typedef std::map<
|
||||
Deferredcaster*,
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject>
|
||||
> DeferredcasterProgObjMap;
|
||||
public:
|
||||
FramebufferRenderer();
|
||||
virtual ~FramebufferRenderer();
|
||||
@@ -67,8 +76,6 @@ public:
|
||||
void updateHDRData();
|
||||
void updateMSAASamplingPattern();
|
||||
|
||||
void setCamera(Camera* camera) override;
|
||||
void setScene(Scene* scene) override;
|
||||
void setResolution(glm::ivec2 res) override;
|
||||
void setNAaSamples(int nAaSamples) override;
|
||||
void setHDRExposure(float hdrExposure) override;
|
||||
@@ -77,11 +84,13 @@ public:
|
||||
|
||||
float hdrBackground() const override;
|
||||
int nAaSamples() const override;
|
||||
/*const double * mSSAPattern() const override;*/
|
||||
std::vector<double> mSSAPattern() const override;
|
||||
|
||||
void update() override;
|
||||
void render(float blackoutFactor, bool doPerformanceMeasurements) override;
|
||||
void performRaycasterTasks(const std::vector<RaycasterTask>& tasks);
|
||||
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks);
|
||||
void render(Scene* scene, Camera* camera, float blackoutFactor,
|
||||
bool doPerformanceMeasurements) override;
|
||||
|
||||
/**
|
||||
* Update render data
|
||||
@@ -95,21 +104,12 @@ public:
|
||||
|
||||
private:
|
||||
std::map<VolumeRaycaster*, RaycastData> _raycastData;
|
||||
std::map<
|
||||
VolumeRaycaster*, std::unique_ptr<ghoul::opengl::ProgramObject>
|
||||
> _exitPrograms;
|
||||
std::map<
|
||||
VolumeRaycaster*, std::unique_ptr<ghoul::opengl::ProgramObject>
|
||||
> _raycastPrograms;
|
||||
std::map<
|
||||
VolumeRaycaster*, std::unique_ptr<ghoul::opengl::ProgramObject>
|
||||
> _insideRaycastPrograms;
|
||||
RaycasterProgObjMap _exitPrograms;
|
||||
RaycasterProgObjMap _raycastPrograms;
|
||||
RaycasterProgObjMap _insideRaycastPrograms;
|
||||
|
||||
std::map<Deferredcaster*, DeferredcastData> _deferredcastData;
|
||||
std::map<
|
||||
Deferredcaster*,
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject>
|
||||
> _deferredcastPrograms;
|
||||
DeferredcasterProgObjMap _deferredcastPrograms;
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _hdrBackGroundProgram;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _resolveProgram;
|
||||
@@ -131,9 +131,8 @@ private:
|
||||
bool _dirtyDeferredcastData;
|
||||
bool _dirtyRaycastData;
|
||||
bool _dirtyResolution;
|
||||
bool _dirtyMsaaSamplingPattern;
|
||||
|
||||
Camera* _camera;
|
||||
Scene* _scene;
|
||||
glm::vec2 _resolution;
|
||||
int _nAaSamples;
|
||||
float _hdrExposure;
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
namespace ghoul::fontrendering {
|
||||
class Font;
|
||||
class FontRenderer;
|
||||
} // namespace ghoul::fontrendering
|
||||
|
||||
namespace ghoul::opengl {
|
||||
@@ -101,6 +102,7 @@ private:
|
||||
|
||||
std::unique_ptr<ghoul::opengl::Texture> _logoTexture;
|
||||
|
||||
std::unique_ptr<ghoul::fontrendering::FontRenderer> _renderer;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _loadingFont;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _messageFont;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _itemFont;
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
protected:
|
||||
properties::BoolProperty _enabled;
|
||||
properties::FloatProperty _opacity;
|
||||
|
||||
|
||||
void registerUpdateRenderBinFromOpacity();
|
||||
|
||||
private:
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
namespace ghoul {
|
||||
class Dictionary;
|
||||
class SharedMemory;
|
||||
}
|
||||
} // ghoul
|
||||
namespace ghoul::fontrendering { class Font; }
|
||||
namespace ghoul::opengl { class ProgramObject; }
|
||||
|
||||
@@ -77,8 +77,7 @@ public:
|
||||
Scene* scene();
|
||||
void updateScene();
|
||||
|
||||
Camera* camera() const;
|
||||
Renderer* renderer() const;
|
||||
const Renderer& renderer() const;
|
||||
RendererImplementation rendererImplementation() const;
|
||||
RaycasterManager& raycasterManager();
|
||||
DeferredcasterManager& deferredcasterManager();
|
||||
@@ -91,6 +90,8 @@ public:
|
||||
void render(const glm::mat4& sceneMatrix, const glm::mat4& viewMatrix,
|
||||
const glm::mat4& projectionMatrix);
|
||||
|
||||
bool mouseActivationCallback(const glm::dvec2& mousePosition) const;
|
||||
|
||||
void renderOverlays(const ShutdownInformation& shutdownInfo);
|
||||
void postDraw();
|
||||
|
||||
@@ -101,24 +102,19 @@ public:
|
||||
float globalBlackOutFactor();
|
||||
void setGlobalBlackOutFactor(float factor);
|
||||
|
||||
void addScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s);
|
||||
void removeScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s);
|
||||
void addScreenSpaceRenderable(std::unique_ptr<ScreenSpaceRenderable> s);
|
||||
void removeScreenSpaceRenderable(ScreenSpaceRenderable* s);
|
||||
void removeScreenSpaceRenderable(const std::string& name);
|
||||
std::shared_ptr<ScreenSpaceRenderable> screenSpaceRenderable(const std::string& name);
|
||||
ScreenSpaceRenderable* screenSpaceRenderable(const std::string& name);
|
||||
std::vector<ScreenSpaceRenderable*> screenSpaceRenderables() const;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> buildRenderProgram(
|
||||
std::string name,
|
||||
std::string vsPath,
|
||||
std::string fsPath,
|
||||
const ghoul::Dictionary& dictionary = ghoul::Dictionary());
|
||||
const std::string& name, const std::string& vsPath, std::string fsPath,
|
||||
ghoul::Dictionary dictionary = ghoul::Dictionary());
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> buildRenderProgram(
|
||||
std::string name,
|
||||
std::string vsPath,
|
||||
std::string fsPath,
|
||||
std::string csPath,
|
||||
const ghoul::Dictionary& dictionary = ghoul::Dictionary());
|
||||
const std::string& name, const std::string& vsPath, std::string fsPath,
|
||||
const std::string& csPath, ghoul::Dictionary dictionary = ghoul::Dictionary());
|
||||
|
||||
void removeRenderProgram(ghoul::opengl::ProgramObject* program);
|
||||
|
||||
@@ -144,13 +140,13 @@ public:
|
||||
* Lets the renderer update the data to be brought into the rendererer programs
|
||||
* as a 'rendererData' variable in the dictionary.
|
||||
*/
|
||||
void setRendererData(const ghoul::Dictionary& rendererData);
|
||||
void setRendererData(ghoul::Dictionary rendererData);
|
||||
|
||||
/**
|
||||
* Lets the renderer update the data to be brought into the post rendererer programs
|
||||
* as a 'resolveData' variable in the dictionary.
|
||||
*/
|
||||
void setResolveData(const ghoul::Dictionary& resolveData);
|
||||
void setResolveData(ghoul::Dictionary resolveData);
|
||||
|
||||
/**
|
||||
* Returns the Lua library that contains all Lua functions available to affect the
|
||||
@@ -164,8 +160,6 @@ public:
|
||||
glm::ivec2 renderingResolution() const;
|
||||
glm::ivec2 fontResolution() const;
|
||||
|
||||
std::vector<Syncable*> getSyncables();
|
||||
|
||||
properties::PropertyOwner& screenSpaceOwner();
|
||||
|
||||
private:
|
||||
@@ -199,31 +193,37 @@ private:
|
||||
properties::BoolProperty _showCameraInfo;
|
||||
|
||||
properties::TriggerProperty _takeScreenshot;
|
||||
bool _shouldTakeScreenshot;
|
||||
bool _shouldTakeScreenshot = false;
|
||||
properties::BoolProperty _applyWarping;
|
||||
properties::BoolProperty _showFrameNumber;
|
||||
properties::BoolProperty _disableMasterRendering;
|
||||
properties::BoolProperty _disableSceneTranslationOnMaster;
|
||||
|
||||
float _globalBlackOutFactor;
|
||||
float _fadeDuration;
|
||||
float _currentFadeTime;
|
||||
int _fadeDirection;
|
||||
float _globalBlackOutFactor = 1.f;
|
||||
float _fadeDuration = 2.f;
|
||||
float _currentFadeTime = 0.f;
|
||||
int _fadeDirection = 0;
|
||||
properties::IntProperty _nAaSamples;
|
||||
properties::FloatProperty _hdrExposure;
|
||||
properties::FloatProperty _hdrBackground;
|
||||
properties::FloatProperty _gamma;
|
||||
|
||||
uint64_t _frameNumber;
|
||||
uint64_t _frameNumber = 0;
|
||||
|
||||
std::vector<ghoul::opengl::ProgramObject*> _programs;
|
||||
properties::PropertyOwner _screenSpaceOwner;
|
||||
std::vector<std::shared_ptr<ScreenSpaceRenderable>> _screenSpaceRenderables;
|
||||
std::vector<std::unique_ptr<ScreenSpaceRenderable>> _screenSpaceRenderables;
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontBig = nullptr;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontInfo = nullptr;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontDate = nullptr;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontLog = nullptr;
|
||||
|
||||
struct {
|
||||
glm::ivec4 rotation;
|
||||
glm::ivec4 zoom;
|
||||
glm::ivec4 roll;
|
||||
} _cameraButtonLocations;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -52,8 +52,6 @@ public:
|
||||
virtual void initialize() = 0;
|
||||
virtual void deinitialize() = 0;
|
||||
|
||||
virtual void setCamera(Camera* camera) = 0;
|
||||
virtual void setScene(Scene* scene) = 0;
|
||||
virtual void setResolution(glm::ivec2 res) = 0;
|
||||
virtual void setNAaSamples(int nAaSamples) = 0;
|
||||
virtual void setHDRExposure(float hdrExposure) = 0;
|
||||
@@ -77,7 +75,8 @@ public:
|
||||
|
||||
virtual void update() = 0;
|
||||
|
||||
virtual void render(float blackoutFactor, bool doPerformanceMeasurements) = 0;
|
||||
virtual void render(Scene* scene, Camera* camera, float blackoutFactor,
|
||||
bool doPerformanceMeasurements) = 0;
|
||||
/**
|
||||
* Update render data
|
||||
* Responsible for calling renderEngine::setRenderData
|
||||
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
* Adds an interpolation request for the passed \p prop that will run for
|
||||
* \p durationSeconds seconds. Every time the #updateInterpolations method is called
|
||||
* the Property will be notified that it has to update itself using the stored
|
||||
* interpolation values. If an interpolation record already exists for the passed
|
||||
* interpolation values. If an interpolation record already exists for the passed
|
||||
* \p prop, the previous record will be overwritten and the remaining time of the old
|
||||
* interpolation is ignored.
|
||||
*
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
*
|
||||
* \pre \p prop must not be \c nullptr
|
||||
* \pre \p durationSeconds must be positive and not 0
|
||||
* \post A new interpolation record exists for \p that is not expired
|
||||
* \post A new interpolation record exists for \p that is not expired
|
||||
*/
|
||||
void addInterpolation(properties::Property* prop, float durationSeconds,
|
||||
ghoul::EasingFunction easingFunction = ghoul::EasingFunction::Linear);
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
void setPositionVec3(Vec3 pos);
|
||||
void setFocusPositionVec3(Vec3 pos);
|
||||
void setRotation(Quat rotation);
|
||||
void setScaling(glm::vec2 scaling);
|
||||
void setScaling(float scaling);
|
||||
void setMaxFov(float fov);
|
||||
void setParent(SceneGraphNode* parent);
|
||||
|
||||
@@ -101,17 +101,19 @@ public:
|
||||
// Accessors
|
||||
// Remove Vec3 from the name when psc is gone
|
||||
const Vec3& positionVec3() const;
|
||||
const Vec3 eyePositionVec3() const;
|
||||
const Vec3& unsynchedPositionVec3() const;
|
||||
const Vec3& focusPositionVec3() const;
|
||||
const Vec3& viewDirectionWorldSpace() const;
|
||||
const Vec3& lookUpVectorCameraSpace() const;
|
||||
const Vec3& lookUpVectorWorldSpace() const;
|
||||
const glm::vec2& scaling() const;
|
||||
const Mat4& viewRotationMatrix() const;
|
||||
const Mat4& viewScaleMatrix() const;
|
||||
const Quat& rotationQuaternion() const;
|
||||
float maxFov() const;
|
||||
float sinMaxFov() const;
|
||||
SceneGraphNode* parent() const;
|
||||
float scaling() const;
|
||||
|
||||
// @TODO this should simply be called viewMatrix!
|
||||
// Or it needs to be changed so that it actually is combined. Right now it is
|
||||
@@ -170,6 +172,7 @@ public:
|
||||
psc unsynchedPosition() const;
|
||||
// [[deprecated("Replaced by Camera::focusPositionVec3()")]]
|
||||
psc focusPosition() const;
|
||||
const glm::mat4& sceneMatrix() const;
|
||||
// @TODO use Camera::SgctInternal interface instead
|
||||
// [[deprecated("Replaced by Camera::SgctInternal::viewMatrix()")]]
|
||||
const glm::mat4& viewMatrix() const;
|
||||
@@ -186,10 +189,9 @@ private:
|
||||
|
||||
SyncData<Vec3> _position;
|
||||
SyncData<Quat> _rotation;
|
||||
SyncData<glm::vec2> _scaling;
|
||||
SyncData<float> _scaling;
|
||||
SceneGraphNode* _parent;
|
||||
|
||||
|
||||
// _focusPosition to be removed
|
||||
Vec3 _focusPosition;
|
||||
float _maxFov;
|
||||
@@ -198,6 +200,7 @@ private:
|
||||
mutable Cached<Vec3> _cachedViewDirection;
|
||||
mutable Cached<Vec3> _cachedLookupVector;
|
||||
mutable Cached<Mat4> _cachedViewRotationMatrix;
|
||||
mutable Cached<Mat4> _cachedViewScaleMatrix;
|
||||
mutable Cached<Mat4> _cachedCombinedViewMatrix;
|
||||
mutable Cached<float> _cachedSinMaxFov;
|
||||
|
||||
|
||||
@@ -70,10 +70,11 @@ public:
|
||||
* Constructor that creates a ScreenLog with the provided \p timeToLive, and the
|
||||
* minimum \p logLevel that is stored. Log message with a lower
|
||||
* ghoul::logging::LogLevel are automatically discarded.
|
||||
*
|
||||
* \param timeToLive The time-to-live for the messages in this ScreenLog. Expired
|
||||
* messages are removed whenever the #removeExpiredEntries method is called
|
||||
* messages are removed whenever the #removeExpiredEntries method is called
|
||||
* \param logLevel The minimum ghoul::logging::LogLevel that messages must
|
||||
* have in order to be stored in the ScreenLog
|
||||
* have in order to be stored in the ScreenLog
|
||||
*/
|
||||
ScreenLog(std::chrono::seconds timeToLive, LogLevel logLevel = LogLevel::Info);
|
||||
|
||||
@@ -85,6 +86,7 @@ public:
|
||||
/**
|
||||
* Overwritten ghoul::loggling::Log method that is called whenever a new log message
|
||||
* shall be stored.
|
||||
*
|
||||
* \param level The ghoul::logging::LogLevel of the incoming log message
|
||||
* \param category The category of the log message
|
||||
* \param message The actual log message that was transmitted
|
||||
@@ -95,17 +97,19 @@ public:
|
||||
/**
|
||||
* This method removes all the stored LogEntry%s that have expired, calculated by
|
||||
* their <code>timeStamp</code> and the #_timeToLive value.
|
||||
*
|
||||
* \post All entries retrieved by the #entries function have a <code>timeStamp</code>
|
||||
* that is lower than the current time + #_timeToLive. The current time used is the
|
||||
* time when this method was last called
|
||||
* that is lower than the current time + #_timeToLive. The current time used is
|
||||
* the time when this method was last called
|
||||
*/
|
||||
void removeExpiredEntries();
|
||||
|
||||
/**
|
||||
* Returns the list of all stored LogEntry%s.
|
||||
*
|
||||
* \return The list of all stored LogEntry%s
|
||||
*/
|
||||
std::vector<LogEntry> entries() const;
|
||||
const std::vector<LogEntry>& entries() const;
|
||||
|
||||
private:
|
||||
/// The list of all LogEntry%s stored by this ScreenLog
|
||||
@@ -118,7 +122,8 @@ private:
|
||||
/// The minimum LogLevel of messages
|
||||
LogLevel _logLevel;
|
||||
|
||||
/// A mutex to ensure thread-safety
|
||||
/// A mutex to ensure thread-safety since the logging and the removal of expired
|
||||
/// entires can occur on different threads
|
||||
mutable std::mutex _mutex;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,16 +23,15 @@
|
||||
****************************************************************************************/
|
||||
|
||||
#include <modules/atmosphere/atmospheremodule.h>
|
||||
|
||||
#include <modules/atmosphere/rendering/renderableatmosphere.h>
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/util/factorymanager.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
|
||||
#include <openspace/rendering/renderable.h>
|
||||
|
||||
#include <modules/atmosphere/rendering/renderableatmosphere.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
AtmosphereModule::AtmosphereModule() : OpenSpaceModule("Atmosphere") {}
|
||||
AtmosphereModule::AtmosphereModule() : OpenSpaceModule(Name) {}
|
||||
|
||||
void AtmosphereModule::internalInitialize(const ghoul::Dictionary&) {
|
||||
auto fRenderable = FactoryManager::ref().factory<Renderable>();
|
||||
|
||||
@@ -26,12 +26,13 @@
|
||||
#define __OPENSPACE_MODULE_ATMOSPHERE___ATMOSPHERE_MODULE___H__
|
||||
|
||||
#include <openspace/util/openspacemodule.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class AtmosphereModule : public OpenSpaceModule {
|
||||
public:
|
||||
constexpr static const char* Name = "Atmosphere";
|
||||
|
||||
AtmosphereModule();
|
||||
|
||||
private:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -100,10 +100,9 @@ private:
|
||||
void deleteUnusedComputationTextures();
|
||||
void executeCalculations(GLuint quadCalcVAO, GLenum drawBuffers[1],
|
||||
GLsizei vertexSize);
|
||||
void resetAtmosphereTextures();
|
||||
void createRenderQuad(GLuint* vao, GLuint* vbo, GLfloat size);
|
||||
void step3DTexture(std::unique_ptr<ghoul::opengl::ProgramObject>& shaderProg,
|
||||
int layer, bool doCalc = true);
|
||||
int layer, bool doCalculation = true);
|
||||
void checkFrameBufferState(const std::string& codePosition) const;
|
||||
void loadAtmosphereDataIntoShaderProgram(
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> & shaderProg
|
||||
@@ -111,7 +110,7 @@ private:
|
||||
void renderQuadForCalc(GLuint vao, GLsizei numberOfVertices);
|
||||
void saveTextureToPPMFile(GLenum color_buffer_attachment, const std::string& fileName,
|
||||
int width, int height) const;
|
||||
bool isAtmosphereInFrustum(const double* MVMatrix, const glm::dvec3& position,
|
||||
bool isAtmosphereInFrustum(const glm::dmat4& MVMatrix, const glm::dvec3& position,
|
||||
double radius) const;
|
||||
|
||||
const double DISTANCE_CULLING = 1e10;
|
||||
@@ -135,9 +134,8 @@ private:
|
||||
HO, betaOzoneExtinction, SAMPLES_R,
|
||||
SAMPLES_MU, SAMPLES_MU_S, SAMPLES_NU) _uniformCache;
|
||||
UniformCache(dInverseModelTransformMatrix, dModelTransformMatrix,
|
||||
dInverseSgctProjectionToModelTransformMatrix,
|
||||
dInverseSGCTEyeToTmpRotTransformMatrix,
|
||||
dCampos, dCamPosObj, sunDirectionObj,
|
||||
dSgctProjectionToModelTransformMatrix,
|
||||
dSGCTViewToWorldMatrix, dCamPosObj, sunDirectionObj,
|
||||
hardShadows, transmittanceTexture, irradianceTexture,
|
||||
inscatterTexture) _uniformCache2;
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
#include <openspace/rendering/deferredcastermanager.h>
|
||||
#include <modules/atmosphere/rendering/atmospheredeferredcaster.h>
|
||||
#include <openspace/engine/configurationmanager.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/renderer.h>
|
||||
|
||||
@@ -86,10 +86,9 @@ uniform sampler2DMS mainColorTexture;
|
||||
|
||||
uniform dmat4 dInverseModelTransformMatrix;
|
||||
uniform dmat4 dModelTransformMatrix;
|
||||
uniform dmat4 dInverseSGCTEyeToTmpRotTransformMatrix;
|
||||
uniform dmat4 dInverseSgctProjectionToModelTransformMatrix;
|
||||
uniform dmat4 dSGCTViewToWorldMatrix;
|
||||
uniform dmat4 dSgctProjectionToModelTransformMatrix;
|
||||
|
||||
uniform dvec3 dCampos;
|
||||
uniform dvec4 dCamPosObj;
|
||||
uniform dvec3 sunDirectionObj;
|
||||
|
||||
@@ -186,12 +185,12 @@ struct dRay {
|
||||
* intersection of the ray with atmosphere when the eye position
|
||||
* is inside atmosphere.
|
||||
*/
|
||||
bool dAtmosphereIntersection(const dvec3 planetPosition, const dRay ray, const float atmRadius,
|
||||
out bool inside, out float offset, out float maxLength ) {
|
||||
vec3 l = vec3(planetPosition) - vec3(ray.origin.xyz);
|
||||
float s = dot(l, vec3(ray.direction.xyz));
|
||||
float l2 = dot(l, l);
|
||||
float r2 = atmRadius * atmRadius; // avoiding surface acne
|
||||
bool dAtmosphereIntersection(const dvec3 planetPosition, const dRay ray, const double atmRadius,
|
||||
out bool inside, out double offset, out double maxLength ) {
|
||||
dvec3 l = planetPosition - ray.origin.xyz;
|
||||
double s = dot(l, ray.direction.xyz);
|
||||
double l2 = dot(l, l);
|
||||
double r2 = atmRadius * atmRadius; // avoiding surface acne
|
||||
|
||||
// Ray origin (eye position) is behind sphere
|
||||
if ((s < 0.0) && (l2 > r2)) {
|
||||
@@ -201,7 +200,7 @@ bool dAtmosphereIntersection(const dvec3 planetPosition, const dRay ray, const f
|
||||
return false;
|
||||
}
|
||||
|
||||
float m2 = l2 - s*s;
|
||||
double m2 = l2 - s*s;
|
||||
|
||||
// Ray misses atmospere
|
||||
if (m2 > r2) {
|
||||
@@ -214,7 +213,7 @@ bool dAtmosphereIntersection(const dvec3 planetPosition, const dRay ray, const f
|
||||
// We already now the ray hits the atmosphere
|
||||
|
||||
// If q = 0.0f, there is only one intersection
|
||||
float q = sqrt(r2 - m2);
|
||||
double q = sqrt(r2 - m2);
|
||||
|
||||
// If l2 < r2, the ray origin is inside the sphere
|
||||
if (l2 > r2) {
|
||||
@@ -246,29 +245,29 @@ void dCalculateRayRenderableGlobe(in int mssaSample, out dRay ray,
|
||||
// ======================================
|
||||
// ======= Avoiding Some Matrices =======
|
||||
|
||||
// NDC to clip coordinates (gl_FragCoord.w = 1.0/w_clip)
|
||||
// Using the interpolated coords:
|
||||
// Assuming Red Book is right: z_ndc e [0, 1] and not [-1, 1]
|
||||
// Compute positions and directions in object space.
|
||||
dvec2 samplePos = dvec2(msaaSamplePatter[mssaSample],
|
||||
msaaSamplePatter[mssaSample+1]);
|
||||
dvec4 clipCoords = dvec4(interpolatedNDCPos.xy + samplePos, interpolatedNDCPos.z, 1.0) / gl_FragCoord.w;
|
||||
//dvec4 clipCoords = dvec4(interpolatedNDCPos.xy + samplePos, 0.0, 1.0);
|
||||
dvec4 clipCoords = dvec4(interpolatedNDCPos.xy, 0.0, 1.0);
|
||||
|
||||
// Clip to Object Coords
|
||||
dvec4 objectCoords = dInverseSgctProjectionToModelTransformMatrix * clipCoords;
|
||||
dvec4 objectCoords = dSgctProjectionToModelTransformMatrix * clipCoords;
|
||||
|
||||
// Planet Position in Object Space
|
||||
// JCC: Applying the inverse of the model transformation on the object postion in World
|
||||
// space results in imprecision.
|
||||
planetPositionObjectCoords = dvec4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
// Camera Position in Object Space
|
||||
// Camera Position in Object Space (in meters)
|
||||
cameraPositionInObject = dCamPosObj;
|
||||
|
||||
// ============================
|
||||
// ====== Building Ray ========
|
||||
// Ray in object space (in KM)
|
||||
ray.origin = cameraPositionInObject * dvec4(0.001, 0.001, 0.001, 1.0);
|
||||
ray.direction = dvec4(normalize(objectCoords.xyz - cameraPositionInObject.xyz), 0.0);
|
||||
//ray.direction = dvec4(normalize(objectCoords.xyz - cameraPositionInObject.xyz), 0.0);
|
||||
ray.direction = dvec4(normalize((objectCoords.xyz * dvec3(0.001))- ray.origin.xyz), 0.0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -294,6 +293,9 @@ vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor
|
||||
out vec3 attenuation, const vec3 fragPosObj,
|
||||
const double maxLength, const double pixelDepth,
|
||||
const vec4 spaceColor, const float sunIntensity) {
|
||||
|
||||
const float INTERPOLATION_EPS = 0.004f; // precision const from Brunetton
|
||||
|
||||
vec3 radiance;
|
||||
|
||||
r = length(x);
|
||||
@@ -325,7 +327,7 @@ vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor
|
||||
float mu0 = dot(x0, v) * invr0;
|
||||
|
||||
bool groundHit = false;
|
||||
if ((pixelDepth > 0.0) && (pixelDepth < maxLength)) {
|
||||
if ((pixelDepth > INTERPOLATION_EPS) && (pixelDepth < maxLength)) {
|
||||
t = float(pixelDepth);
|
||||
groundHit = true;
|
||||
|
||||
@@ -358,7 +360,6 @@ vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor
|
||||
|
||||
// In order to avoid imprecision problems near horizon,
|
||||
// we interpolate between two points: above and below horizon
|
||||
const float INTERPOLATION_EPS = 0.004f; // precision const from Brunetton
|
||||
if (abs(mu - muHorizon) < INTERPOLATION_EPS) {
|
||||
// We want an interpolation value close to 1/2, so the
|
||||
// contribution of each radiance value is almost the same
|
||||
@@ -532,7 +533,8 @@ vec3 sunColor(const vec3 x, const float t, const vec3 v, const vec3 s, const flo
|
||||
}
|
||||
|
||||
void main() {
|
||||
ivec2 fragCoords = ivec2(gl_FragCoord);
|
||||
ivec2 fragCoords = ivec2(gl_FragCoord);
|
||||
|
||||
if (cullAtmosphere == 0) {
|
||||
vec4 atmosphereFinalColor = vec4(0.0f);
|
||||
int nSamples = 1;
|
||||
@@ -586,8 +588,8 @@ void main() {
|
||||
cameraPositionInObject);
|
||||
|
||||
bool insideATM = false;
|
||||
double offset = 0.0;
|
||||
double maxLength = 0.0;
|
||||
double offset = 0.0; // in Km
|
||||
double maxLength = 0.0; // in Km
|
||||
|
||||
bool intersectATM = false;
|
||||
|
||||
@@ -605,18 +607,18 @@ void main() {
|
||||
vec4 normal = texelFetch(mainNormalTexture, fragCoords, i);
|
||||
// Data in the mainPositionTexture are written in view space (view plus camera rig)
|
||||
vec4 position = texelFetch(mainPositionTexture, fragCoords, i);
|
||||
|
||||
|
||||
// OS Eye to World coords
|
||||
dvec4 tmpRInvPos = dInverseSGCTEyeToTmpRotTransformMatrix * position;
|
||||
dvec4 fragWorldCoords = dvec4(dvec3(tmpRInvPos) + dCampos, 1.0);
|
||||
|
||||
dvec4 positionWorldCoords = dSGCTViewToWorldMatrix * position;
|
||||
|
||||
// World to Object (Normal and Position in meters)
|
||||
dvec4 fragObjectCoords = dInverseModelTransformMatrix * fragWorldCoords;
|
||||
dvec4 positionObjectsCoords = dInverseModelTransformMatrix * positionWorldCoords;
|
||||
|
||||
|
||||
// Distance of the pixel in the gBuffer to the observer
|
||||
// JCC (12/12/2017): AMD distance function is buggy.
|
||||
//double pixelDepth = distance(cameraPositionInObject.xyz, fragObjectCoords.xyz);
|
||||
double pixelDepth = length(cameraPositionInObject.xyz - fragObjectCoords.xyz);
|
||||
//double pixelDepth = distance(cameraPositionInObject.xyz, positionObjectsCoords.xyz);
|
||||
double pixelDepth = length(cameraPositionInObject.xyz - positionObjectsCoords.xyz);
|
||||
|
||||
// JCC (12/13/2017): Trick to remove floating error in texture.
|
||||
// We see a squared noise on planet's surface when seeing the planet
|
||||
@@ -636,8 +638,8 @@ void main() {
|
||||
}
|
||||
|
||||
// All calculations are done in Km:
|
||||
pixelDepth *= 0.001;
|
||||
fragObjectCoords.xyz *= 0.001;
|
||||
pixelDepth *= 0.001;
|
||||
positionObjectsCoords.xyz *= 0.001;
|
||||
|
||||
if (position.xyz != vec3(0.0) && (pixelDepth < offset)) {
|
||||
atmosphereFinalColor += vec4(HDR(color.xyz * backgroundConstant, atmExposure), color.a);
|
||||
@@ -664,7 +666,7 @@ void main() {
|
||||
|
||||
dvec4 onATMPos = dModelTransformMatrix * dvec4(x * 1000.0, 1.0);
|
||||
vec4 eclipseShadowATM = calcShadow(shadowDataArray, onATMPos.xyz, false);
|
||||
vec4 eclipseShadowPlanet = calcShadow(shadowDataArray, fragWorldCoords.xyz, true);
|
||||
vec4 eclipseShadowPlanet = calcShadow(shadowDataArray, positionWorldCoords.xyz, true);
|
||||
|
||||
float sunIntensityInscatter = sunRadiance * eclipseShadowATM.x;
|
||||
float sunIntensityGround = sunRadiance * eclipseShadowPlanet.x;
|
||||
@@ -673,7 +675,7 @@ void main() {
|
||||
|
||||
vec3 inscatterColor = inscatterRadiance(x, tF, irradianceFactor, v,
|
||||
s, r, mu, attenuation,
|
||||
vec3(fragObjectCoords.xyz),
|
||||
vec3(positionObjectsCoords.xyz),
|
||||
maxLength, pixelDepth,
|
||||
color, sunIntensityInscatter);
|
||||
vec3 groundColor = groundColor(x, tF, v, s, r, mu, attenuation,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -21,7 +21,7 @@
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
|
||||
#version __CONTEXT__
|
||||
|
||||
#include "atmosphere_common.glsl"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user