Merge branch 'master' into feature/rover-visualization

# Conflicts:
#	modules/globebrowsing/ext/gdal/include/ogrsf_frmts.h
#	openspace.cfg
This commit is contained in:
Alexander Bock
2019-05-20 18:45:35 -06:00
275 changed files with 8191 additions and 2656 deletions
+1
View File
@@ -29,6 +29,7 @@ Thumbs.db
/documentation/
/logs/
/screenshots/
/recordings/
/sync/
# Customization is not supposed to be committed
customization.lua
+25 -6
View File
@@ -27,9 +27,9 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(OpenSpace)
set(OPENSPACE_VERSION_MAJOR 0)
set(OPENSPACE_VERSION_MINOR 13)
set(OPENSPACE_VERSION_MINOR 14)
set(OPENSPACE_VERSION_PATCH 0)
set(OPENSPACE_VERSION_STRING "Beta-3")
set(OPENSPACE_VERSION_STRING "Beta-4")
set(OPENSPACE_BASE_DIR "${PROJECT_SOURCE_DIR}")
@@ -103,7 +103,7 @@ execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE OPENSPACE_GIT_STATUS_RETURN
)
if (NOT OPENSPACE_GIT_STATUS_RETURN EQUAL 0)
if (NOT OPENSPACE_GIT_STATUS_RETURN EQUAL 0)
set(OPENSPACE_GIT_STATUS "uncommitted changes")
else()
set(OPENSPACE_GIT_STATUS "")
@@ -118,7 +118,7 @@ include(src/CMakeLists.txt)
##########################################################################################
# System libraries
if (APPLE)
begin_dependency("Core Libraries")
begin_dependency("Core Libraries")
target_include_directories(openspace-core PUBLIC "/Developer/Headers/FlatCarbon")
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(CARBON_LIBRARY Carbon)
@@ -186,8 +186,27 @@ if (MSVC)
target_include_directories(openspace-core PUBLIC ${OPENSPACE_EXT_DIR}/vld)
end_dependency()
endif ()
endif ()
option(OPENSPACE_VTUNE_ENABLED "Include VTune support" OFF)
set(OPENSPACE_VTUNE_PATH "C:/Program Files (x86)/IntelSWTools/VTune Amplifier 2019" CACHE STRING "Path to VTune installation")
if (OPENSPACE_VTUNE_ENABLED)
begin_dependency("Intel VTune")
target_compile_definitions(openspace-core PUBLIC "OPENSPACE_HAS_VTUNE")
target_include_directories(openspace-core PUBLIC "${OPENSPACE_VTUNE_PATH}/include")
target_link_libraries(openspace-core "${OPENSPACE_VTUNE_PATH}/lib64/libittnotify.lib")
end_dependency()
endif ()
option(OPENSPACE_NVTOOLS_ENABLED "Include support for Nvidia Tools Extensions" OFF)
set(OPENSPACE_NVTOOLS_PATH "C:/Program Files/NVIDIA Corporation/NvToolsExt")
if (OPENSPACE_NVTOOLS_ENABLED)
begin_dependency("Nvidia Tools Extension")
target_compile_definitions(openspace-core PUBLIC "OPENSPACE_HAS_NVTOOLS")
target_include_directories(openspace-core PUBLIC "${OPENSPACE_NVTOOLS_PATH}/include")
end_dependency()
endif ()
endif ()
##########################################################################################
# Tests #
@@ -237,7 +256,7 @@ message(STATUS "")
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
set(PROJECT_ARCH "x86_64")
+3 -3
View File
@@ -1,11 +1,11 @@
# Core Team
Alexander Bock
Emil Axelsson
Kalle Bladin
Micah Acinapura
Jonathas Costa
Joakim Kilby
Gene Payne
Micah Acinapura
Kalle Bladin
Joakim Kilby
Erik Sundén
Eric Myers
+1 -4
View File
@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2018 #
# Copyright (c) 2014-2019 #
# #
# 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 #
@@ -56,9 +56,6 @@ target_link_libraries(OpenSpace-MinVR libOpenSpace MinVR)
# Why not put these in the module's path? Because they do not have access to the
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace-MinVR/openspace.rc)
endif ()
+5 -2
View File
@@ -2,7 +2,7 @@
# #
# OpenSpace #
# #
# Copyright (c) 2014-2018 #
# Copyright (c) 2014-2019 #
# #
# 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 #
@@ -152,7 +152,6 @@ end_header("Dependency: SGCT")
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(PROJECT_ARCH "x86_64")
if (WIN32)
@@ -176,3 +175,7 @@ if (MSVC)
target_link_libraries(OpenSpace Dbghelp.lib)
end_header()
endif ()
if (OPENSPACE_NVTOOLS_ENABLED)
target_link_libraries(OpenSpace "${OPENSPACE_NVTOOLS_PATH}/lib/x64/nvToolsExt64_1.lib")
endif ()
+256 -1
View File
@@ -44,6 +44,7 @@
#include <sgct.h>
#include <chrono>
#include <ctime>
#include <stb_image.h>
#ifdef WIN32
#include <openspace/openspace.h>
@@ -63,6 +64,18 @@
#include "SpoutLibrary.h"
#endif // OPENSPACE_HAS_SPOUT
#ifdef OPENSPACE_HAS_VTUNE
#include <ittnotify.h>
// If this is set to 'true', it will disable all frame markers in this file and expect
// you to place them in the code you actually want to inspect
constexpr const bool EnableDetailedVtune = false;
#endif // OPENSPACE_HAS_VTUNE
#ifdef OPENSPACE_HAS_NVTOOLS
#include "nvToolsExt.h"
#endif // OPENSPACE_HAS_NVTOOLS
namespace {
constexpr const char* _loggerCat = "main";
@@ -76,6 +89,26 @@ sgct::SharedVector<char> _synchronizationBuffer;
sgct::SGCTWindow* FirstOpenVRWindow = nullptr;
#endif
#ifdef OPENSPACE_HAS_VTUNE
struct {
__itt_domain* init;
__itt_domain* preSync;
__itt_domain* postSyncPreDraw;
__itt_domain* render;
__itt_domain* draw2D;
__itt_domain* postDraw;
__itt_domain* keyboard;
__itt_domain* mouseButton;
__itt_domain* mousePos;
__itt_domain* mouseScroll;
__itt_domain* character;
__itt_domain* encode;
__itt_domain* decode;
} _vTune;
#endif // OPENSPACE_HAS_VTUNE
//
// SPOUT-support
//
@@ -219,17 +252,57 @@ std::pair<int, int> supportedOpenGLVersion() {
// Init function
//
void mainInitFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.init, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainInitFunc(begin)");
LDEBUG("Initializing OpenSpace Engine started");
openspace::global::openSpaceEngine.initialize();
LDEBUG("Initializing OpenSpace Engine finished");
{
std::string path = absPath("${DATA}/openspace-icon.png");
int x;
int y;
int n;
unsigned char* data = stbi_load(path.c_str(), &x, &y, &n, 0);
GLFWimage icons[1];
icons[0].pixels = data;
icons[0].width = x;
icons[0].height = y;
const size_t nWindows = SgctEngine->getNumberOfWindows();
for (size_t i = 0; i < nWindows; ++i) {
const sgct::SGCTWindow* windowPtr = SgctEngine->getWindowPtr(i);
glfwSetWindowIcon(windowPtr->getWindowHandle(), 1, icons);
}
stbi_image_free(icons[0].pixels);
}
LDEBUG("Initializing OpenGL in OpenSpace Engine started");
openspace::global::openSpaceEngine.initializeGL();
LDEBUG("Initializing OpenGL in OpenSpace Engine finished");
{
//using namespace ghoul::opengl;
//std::unique_ptr<ghoul::opengl::Texture> t = ghoul::io::TextureReader::ref().loadTexture(absPath("${DATA}/openspace-icon.png"));
//GLFWimage icons[1];
//icons[0].pixels =
}
// Find if we have at least one OpenVR window
// Save reference to first OpenVR window, which is the one we will copy to the HMD.
for (size_t i = 0; i < SgctEngine->getNumberOfWindows(); ++i) {
@@ -318,7 +391,6 @@ void mainInitFunc() {
);
}
for (size_t i = 0; i < nWindows; ++i) {
sgct::SGCTWindow* w = SgctEngine->getWindowPtr(i);
constexpr const char* screenshotNames = "OpenSpace";
@@ -335,12 +407,23 @@ void mainInitFunc() {
}
LTRACE("main::mainInitFunc(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.init, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainPreSyncFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.preSync, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainPreSyncFunc(begin)");
openspace::global::openSpaceEngine.preSynchronization();
// Query joystick status
@@ -420,12 +503,26 @@ void mainPreSyncFunc() {
}
LTRACE("main::mainPreSyncFunc(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.preSync, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainPostSyncPreDrawFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.postSyncPreDraw, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
#ifdef OPENSPACE_HAS_NVTOOLS
nvtxRangePush("postSyncPreDraw");
#endif // OPENSPACE_HAS_NVTOOLS
LTRACE("main::postSynchronizationPreDraw(begin)");
openspace::global::openSpaceEngine.postSynchronizationPreDraw();
#ifdef OPENVR_SUPPORT
@@ -436,11 +533,28 @@ void mainPostSyncPreDrawFunc() {
#endif // OPENVR_SUPPORT
LTRACE("main::postSynchronizationPreDraw(end)");
#ifdef OPENSPACE_HAS_NVTOOLS
nvtxRangePop();
#endif // OPENSPACE_HAS_NVTOOLS
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.postSyncPreDraw, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainRenderFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.render, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
#ifdef OPENSPACE_HAS_NVTOOLS
nvtxRangePush("render");
#endif // OPENSPACE_HAS_NVTOOLS
LTRACE("main::mainRenderFunc(begin)");
glm::mat4 viewMatrix = SgctEngine->getCurrentViewMatrix() *
@@ -466,12 +580,26 @@ void mainRenderFunc() {
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
}
LTRACE("main::mainRenderFunc(end)");
#ifdef OPENSPACE_HAS_NVTOOLS
nvtxRangePop();
#endif // OPENSPACE_HAS_NVTOOLS
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.render, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainDraw2DFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.draw2D, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainDraw2DFunc(begin)");
try {
@@ -487,11 +615,21 @@ void mainDraw2DFunc() {
glDisable(GL_DEPTH_TEST);
LTRACE("main::mainDraw2DFunc(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.draw2D, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainPostDrawFunc() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.postDraw, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainPostDrawFunc(begin)");
#ifdef OPENVR_SUPPORT
@@ -532,73 +670,162 @@ void mainPostDrawFunc() {
#endif // OPENSPACE_HAS_SPOUT
LTRACE("main::mainPostDrawFunc(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.postDraw, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainKeyboardCallback(int key, int, int action, int mods) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.keyboard, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainKeyboardCallback(begin)");
openspace::global::openSpaceEngine.keyboardCallback(
openspace::Key(key),
openspace::KeyModifier(mods),
openspace::KeyAction(action)
);
LTRACE("main::mainKeyboardCallback(begin)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.keyboard, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainMouseButtonCallback(int key, int action, int modifiers) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mouseButton, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainMouseButtonCallback(begin)");
openspace::global::openSpaceEngine.mouseButtonCallback(
openspace::MouseButton(key),
openspace::MouseAction(action),
openspace::KeyModifier(modifiers)
);
LTRACE("main::mainMouseButtonCallback(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.mouseButton, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainMousePosCallback(double x, double y) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mousePos, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
openspace::global::openSpaceEngine.mousePositionCallback(x, y);
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.mousePos, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainMouseScrollCallback(double posX, double posY) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.mouseScroll, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainMouseScrollCallback(begin");
openspace::global::openSpaceEngine.mouseScrollWheelCallback(posX, posY);
LTRACE("main::mainMouseScrollCallback(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.mouseScroll, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainCharCallback(unsigned int codepoint, int mods) {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.character, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
openspace::global::openSpaceEngine.charCallback(
codepoint,
openspace::KeyModifier(mods)
);
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.character, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainEncodeFun() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.encode, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainEncodeFun(begin)");
std::vector<char> data = openspace::global::openSpaceEngine.encode();
_synchronizationBuffer.setVal(std::move(data));
sgct::SharedData::instance()->writeVector(&_synchronizationBuffer);
LTRACE("main::mainEncodeFun(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.encode, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
void mainDecodeFun() {
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_begin_v3(_vTune.decode, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
LTRACE("main::mainDecodeFun(begin)");
sgct::SharedData::instance()->readVector(&_synchronizationBuffer);
std::vector<char> data = _synchronizationBuffer.getVal();
openspace::global::openSpaceEngine.decode(std::move(data));
LTRACE("main::mainDecodeFun(end)");
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
__itt_frame_end_v3(_vTune.decode, nullptr);
}
#endif // OPENSPACE_HAS_VTUNE
}
@@ -816,6 +1043,15 @@ void setSgctDelegateFunctions() {
sgctDelegate.openGLProcedureAddress = [](const char* func) {
return glfwGetProcAddress(func);
};
sgctDelegate.getHorizFieldOfView = []() {
return static_cast<double>(
sgct::Engine::instance()->getWindowPtr(0)->getHorizFieldOfViewDegrees()
);
};
sgctDelegate.setHorizFieldOfView = [](float hFovDeg) {
sgct::SGCTWindow* w = sgct::Engine::instance()->getWindowPtr(0);
w->setHorizFieldOfView(hFovDeg);
};
}
int main(int argc, char** argv) {
@@ -823,6 +1059,25 @@ int main(int argc, char** argv) {
SetUnhandledExceptionFilter(generateMiniDump);
#endif // WIN32
#ifdef OPENSPACE_HAS_VTUNE
if (EnableDetailedVtune) {
_vTune.init = __itt_domain_create("init");
_vTune.preSync = __itt_domain_create("preSync");
_vTune.postSyncPreDraw = __itt_domain_create("postSyncPreDraw");
_vTune.render = __itt_domain_create("render");
_vTune.draw2D = __itt_domain_create("draw2D");
_vTune.postDraw = __itt_domain_create("postDraw");
_vTune.keyboard = __itt_domain_create("keyboard");
_vTune.mouseButton = __itt_domain_create("mouseButton");
_vTune.mousePos = __itt_domain_create("mousePos");
_vTune.mouseScroll = __itt_domain_create("mouseScroll");
_vTune.character = __itt_domain_create("character");
_vTune.encode = __itt_domain_create("encode");
_vTune.decode = __itt_domain_create("decode");
}
#endif // OPENSPACE_HAS_VTUNE
// Initialize the LogManager and add the console log as this will be used every time
// and we need a fall back if something goes wrong between here and when we add the
// logs from the configuration file. If the user requested as specific loglevel in the
+1 -1
View File
@@ -44,7 +44,7 @@ target_link_libraries(Sync openspace-core)
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)
+1 -1
View File
@@ -44,7 +44,7 @@ target_link_libraries(TaskRunner openspace-core)
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
if (WIN32)
set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/OpenSpace/openspace.rc)
+1 -1
View File
@@ -45,7 +45,7 @@ target_link_libraries(Wormhole openspace-core)
# target as of July 2017, which is needed.
if (OPENSPACE_MODULE_WEBBROWSER AND CEF_ROOT)
# wanted by CEF
set(CMAKE_BUILD_TYPE Debug CACHE INTERNAL "CMAKE_BUILD_TYPE")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "CMAKE_BUILD_TYPE")
set(PROJECT_ARCH "x86_64")
if (WIN32)
+78
View File
@@ -0,0 +1,78 @@
-- This is a base scene that is included in most other scenes to set up defaults
-- loading this scene directly without any other elements added on top of it will
-- probably not work
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
asset.require('scene/solarsystem/sun/sun')
asset.require('scene/solarsystem/sun/glare')
asset.require('scene/solarsystem/planets')
asset.require('scene/solarsystem/planets/mars/moons/phobos')
asset.require('scene/solarsystem/planets/mars/moons/deimos')
asset.require('scene/solarsystem/dwarf_planets/pluto/system')
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')
-- Load web gui
asset.require('util/webgui')
asset.request('customization/globebrowsing')
-- Keybindings that are specific for this scene
local Keybindings = {
{
Key = "b",
Name = "Toggle background",
Command = propertyHelper.invert('Scene.MilkyWay.Renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.Renderable.Enabled'),
Documentation = "Toggle background (Stars and Milkyway).",
GuiPath = "/Rendering",
Local = false
},
{
Key = "g",
Name = "Toggle background/shading",
Command = propertyHelper.invert('Scene.MilkyWay.Renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.Renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Enabled') ..
propertyHelper.invert('Scene.EarthAtmosphere.Renderable.Enabled') ..
propertyHelper.invert('Scene.MarsAtmosphere.Renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.Renderable.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
propertyHelper.invert('Scene.Moon.Renderable.Enabled') ..
propertyHelper.invert('Scene.Sun.Renderable.Enabled'),
Documentation = "Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun",
GuiPath = "/Rendering",
Local = false
},
{
Key = "h",
Name="Toggle Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Toggles the visibility of all trails",
GuiPath = "/Rendering",
Local = false
},
}
asset.onInitialize(function ()
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()
openspace.globebrowsing.loadWMSServersFromFile(
openspace.absPath("${DATA}/globebrowsing_servers.lua")
)
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
end)
+10 -2
View File
@@ -1,10 +1,9 @@
-- Add require statements for assets exporting the neccessary globes
-- example:
-- here we add Mars, Moon and Mercury:
asset.require('../scene/solarsystem/planets/mars/mars')
asset.require('../scene/solarsystem/planets/earth/moon/moon')
asset.require('../scene/solarsystem/planets/mercury/mercury')
local CreateFocusNodes = false
-- Add folders to this list that contain .info files describing patches
@@ -21,8 +20,17 @@ local vrt_folders = {
-- tl;dr: Specify CTX folders first, then HiRISE
-- example: 'C:/OpenSpace/GlobeBrowsingData/Mars/CTX'
-- We recommend using this folder for CTX
openspace.absPath('${BASE}/../OpenSpaceData/Mars/CTX'),
-- if not and you have a custom path for CTX layers, enter it below
'',
-- Our provided HiRISE layer
openspace.absPath('${ASSETS}/scene/solarsystem/planets/mars/map_service_configs/ESRI/'),
-- We recommend using this folder for HiRISE
openspace.absPath('${BASE}/../OpenSpaceData/Mars/HiRISE'),
-- if not and you have a custom path for HiRISE layers, enter it below
'',
},
Moon = {
+3 -34
View File
@@ -1,42 +1,14 @@
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
asset.require('./base')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
asset.request('scene/solarsystem/planets')
asset.request('scene/digitaluniverse/stars')
asset.request('scene/digitaluniverse/milkyway')
asset.require('scene/solarsystem/missions/dawn/ceres')
asset.require('scene/solarsystem/missions/dawn/dawn')
asset.require('scene/solarsystem/missions/dawn/vesta')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/webgui')
local DawnAsset = asset.require('scene/solarsystem/missions/dawn/dawn')
asset.onInitialize(function ()
openspace.time.setTime("2011 AUG 06 00:00:00")
openspace.setDefaultGuiSorting()
openspace.markInterestingNodes({
"Dawn", "Ceres", "Vesta"
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.markInterestingNodes({ "Dawn", "Ceres", "Vesta" })
openspace.navigation.setCameraState({
Anchor = DawnAsset.Dawn.Identifier,
@@ -46,8 +18,5 @@ asset.onInitialize(function ()
end)
asset.onDeinitialize(function ()
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({
"Dawn", "Ceres", "Vesta"
})
openspace.removeInterestingNodes({ "Dawn", "Ceres", "Vesta" })
end)
+3 -81
View File
@@ -1,88 +1,12 @@
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
asset.require('scene/solarsystem/planets')
asset.require('scene/solarsystem/planets/mars/moons/phobos')
asset.require('scene/solarsystem/planets/mars/moons/deimos')
asset.require('scene/solarsystem/dwarf_planets/pluto/system')
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.require('util/webgui')
asset.request('customization/globebrowsing')
-- Keybindings that are specific for this scene
local Keybindings = {
{
Key = "b",
Name = "Toggle background",
Command = propertyHelper.invert('Scene.MilkyWay.Renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.Renderable.Enabled'),
Documentation = "Toggle background (Stars and Milkyway).",
GuiPath = "/Rendering",
Local = false
},
{
Key = "g",
Name = "Toggle background/shading",
Command = propertyHelper.invert('Scene.MilkyWay.Renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.Renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Enabled') ..
propertyHelper.invert('Scene.EarthAtmosphere.Renderable.Enabled') ..
propertyHelper.invert('Scene.MarsAtmosphere.Renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.Renderable.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
propertyHelper.invert('Scene.Moon.Renderable.Enabled') ..
propertyHelper.invert('Scene.Sun.Renderable.Enabled'),
Documentation = "Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun",
GuiPath = "/Rendering",
Local = false
},
{
Key = "h",
Name="Hide Trails",
Command = "openspace.setPropertyValue('Scene.*Trail.Renderable.Enabled', false)",
Documentation = "Disables visibility of the trails",
GuiPath = "/Rendering",
Local = false
},
}
asset.require('./base')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
assetHelper.registerInterestingNodes(asset, {
"Earth", "Mars", "Moon", "Sun"
})
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()
-- Jump back one day to show a complete planet
openspace.time.setTime(openspace.time.advancedTime(now, "-1d"))
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()
openspace.globebrowsing.loadWMSServersFromFile(
openspace.absPath("${DATA}/globebrowsing_servers.lua")
)
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"Scene.*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.markInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
openspace.navigation.setCameraState({
Anchor = earthAsset.Earth.Identifier,
@@ -94,7 +18,5 @@ asset.onInitialize(function ()
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
end)
+11 -4
View File
@@ -4,9 +4,10 @@ if not has_gaia then
do return end
end
local assetHelper = asset.require('util/asset_helper')
asset.require('./base')
asset.require('default')
local assetHelper = asset.require('util/asset_helper')
-- Augment default scene with gaia data, 3D model and trail
asset.require('scene/milkyway/gaia/gaiastars')
@@ -27,14 +28,20 @@ assetHelper.registerDashboardItems(asset, {
}
})
assetHelper.registerInterestingNodes(asset, { "Gaia" })
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.onInitialize(function ()
openspace.setPropertyValueSingle('Scene.Stars.Renderable.Enabled', false);
openspace.markInterestingNodes({ "Gaia" })
openspace.navigation.setCameraState({
Anchor = "Gaia",
Anchor = earthAsset.Earth.Identifier,
Position = { 1000000000000.0, 1000000000000.0, 1000000000000.0 },
Rotation = { 0.683224, -0.765934, -0.601234, -0.418073 },
})
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Gaia" })
end)
+82
View File
@@ -0,0 +1,82 @@
asset.require('./base')
local sceneHelper = asset.require('util/scene_helper')
-- Keybindings that are specific for this scene
local Keybindings = {
{
Key = "i",
Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', -470.800006);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Gamma', 3.098590);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Multiplier', 3.568080);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 2.816900);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 0.938970);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 2.394370);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);",
Documentation = "Setup Insight landing layers",
Local = false
},
{
Key = "SHIFT+i",
Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', 0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', false);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', false);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false);",
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Gamma', 1.0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Multiplier', 1.0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 1.0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 1.0);" ..
"openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 1.0);";
Documentation = "Undo Insight landing layers setup",
Local = false
}
}
local insightAsset = asset.require('scene/solarsystem/missions/insight/edl')
asset.onInitialize(function ()
openspace.time.setTime("2018 NOV 26 19:39:03.68")
sceneHelper.bindKeys(Keybindings)
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', -470.800006);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', true);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Gamma', 3.098590);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Multiplier', 3.568080);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 2.81690);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 0.938970);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 2.394370);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);
openspace.markInterestingNodes({ "Insight" })
openspace.navigation.setCameraState({
Anchor = insightAsset.Insight.Identifier,
Position = { 0, 0, 0 },
Rotation = { 0.758797, 0.221490, -0.605693, -0.091135 },
})
end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', 0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', false);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', false);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Gamma', 1.0);
-- openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Settings.Multiplier', 1.0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 1.0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 1.0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 1.0);
openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false);
openspace.removeInterestingNodes({ "Insight" })
end)
+4 -28
View File
@@ -1,47 +1,23 @@
asset.request('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
asset.request('scene/solarsystem/planets')
asset.request('scene/digitaluniverse/stars')
asset.request('scene/digitaluniverse/milkyway')
assetHelper.requireAll(asset, 'scene/solarsystem/missions/juno')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/default_joystick')
asset.require('util/webgui')
local junoAsset = asset.require('scene/solarsystem/missions/juno/juno')
assetHelper.registerInterestingNodes(asset, {
"Jupiter", "Juno"
})
asset.onInitialize(function ()
openspace.time.setTime("2016-07-01T10:05:00.00")
openspace.setDefaultGuiSorting()
openspace.markInterestingNodes({ "Jupiter", "Juno" })
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400,
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = junoAsset.Juno.Identifier,
Position = { 1837386367.601345, -389860693812.834839, 714830404470.398926 },
@@ -50,5 +26,5 @@ asset.onInitialize(function ()
end)
asset.onDeinitialize(function ()
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({ "Jupiter", "Juno" })
end)
+7 -32
View File
@@ -1,30 +1,16 @@
--messenger.scene
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
asset.require('spice/base')
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
asset.require('scene/solarsystem/planets')
asset.request('scene/digitaluniverse/stars')
asset.request('scene/digitaluniverse/milkyway')
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/webgui')
local MessengerAsset = asset.require('scene/solarsystem/missions/messenger/messengerSC')
if not openspace.modules.isLoaded("Volume") then
openspace.printError("Volume module is not loaded, skipping asset: mercurymagnetosphere")
openspace.printWarning("Volume module is not loaded, skipping asset: mercurymagnetosphere")
else
asset.require('scene/solarsystem/missions/messenger/mercurymagnetosphere')
end
asset.request('customization/globebrowsing')
assetHelper.registerDashboardItems(asset, {
{
Type = "DashboardItemDistance",
@@ -37,34 +23,23 @@ assetHelper.registerDashboardItems(asset, {
}
})
assetHelper.registerInterestingNodes(asset, {
"Mercury", "Messenger", "Earth", "Sun"
})
asset.onInitialize(function ()
openspace.time.setTime("2011 MAY 13 00:05:18")
openspace.setDefaultGuiSorting()
openspace.markInterestingNodes({ "Mercury", "Messenger", "Sun" })
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400,
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"Scene.*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = "Mercury",
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
Rotation = {0.180662, 0.021334, 0.979084, 0.091111},
})
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Mercury", "Messenger", "Sun" })
end)
+15 -19
View File
@@ -1,4 +1,4 @@
asset.require('default');
asset.require('./base');
asset.require('scene/solarsystem/missions/newhorizons/newhorizons')
local NewHorizonsAsset = asset.require('scene/solarsystem/missions/newhorizons/model')
@@ -161,7 +161,16 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not
Name = "Toggle NH Trail",
GuiPath = "/New Horizons",
Local = false
}
},
{
Key = "h",
Name="Hide Trails",
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
Documentation = "Disables visibility of the trails",
GuiPath = "/Rendering",
Local = false
},
}
@@ -188,15 +197,11 @@ assetHelper.registerDashboardItems(asset, {
}
})
assetHelper.registerInterestingNodes(asset, {
"Pluto", "NewHorizons", "Charon"
})
asset.onInitialize(function ()
openspace.time.setTime("2015-07-14T08:00:00.00")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()
openspace.markInterestingNodes({ "Pluto", "NewHorizons", "Charon" })
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 60, 120, 360, 540, 1080,
@@ -208,16 +213,6 @@ asset.onInitialize(function ()
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', false)
openspace.setPropertyValueSingle("Scene.PlutoBarycenterTrail.Renderable.Enabled", false)
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = NewHorizonsAsset.NewHorizons.Identifier,
Position = { 4662120063743.592773, 1263245003503.724854, -955413856565.788086 },
@@ -227,9 +222,10 @@ end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeInterestingNodes({ "Pluto", "NewHorizons", "Charon" })
openspace.setPropertyValueSingle('Scene.Pluto.Renderable.Enabled', true)
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', true)
openspace.setPropertyValueSingle('Scene.PlutoBarycenterTrail.Renderable.Enabled', true)
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
end)
+4 -32
View File
@@ -1,22 +1,11 @@
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
asset.require('scene/solarsystem/planets')
asset.request('scene/digitaluniverse/stars')
asset.request('scene/digitaluniverse/milkyway')
asset.require('scene/solarsystem/missions/osirisrex/osirisrex')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/default_joystick')
asset.require('util/webgui')
-- Custom Keybindings
local Keybindings = {
{
@@ -111,26 +100,12 @@ asset.onInitialize(function ()
openspace.time.setTime("2016 SEP 8 23:00:00.500")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 60, 120, 360, 540, 1080,
2160, 4320, 8640
})
openspace.markInterestingNodes({
"OsirisRex", "BennuBarycenter", "Earth"
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.markInterestingNodes({ "OsirisRex", "BennuBarycenter", "Earth" })
openspace.navigation.setCameraState({
Anchor = OsirisRexAsset.OsirisRex.Identifier,
@@ -142,8 +117,5 @@ end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({
"OsirisRex", "BennuBarycenter", "Earth"
})
openspace.removeInterestingNodes({ "OsirisRex", "BennuBarycenter", "Earth" })
end)
+5 -32
View File
@@ -1,26 +1,14 @@
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
local renderableHelper = asset.require('util/renderable_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
asset.require('scene/solarsystem/planets')
asset.request('scene/digitaluniverse/stars')
asset.request('scene/digitaluniverse/milkyway')
asset.require('scene/solarsystem/missions/rosetta/67p')
asset.require('scene/solarsystem/missions/rosetta/rosetta')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/default_joystick')
asset.require('util/webgui')
asset.request('customization/globebrowsing')
-- Custom Keybindings
local Keybindings = {
{
@@ -111,31 +99,17 @@ assetHelper.registerDashboardItems(asset, {
}
})
assetHelper.registerInterestingNodes(asset, {
"67P", "Rosetta", "Philae"
})
asset.onInitialize(function ()
openspace.time.setTime("2014-08-01T03:05:00.000")
sceneHelper.bindKeys(Keybindings)
openspace.setDefaultGuiSorting()
openspace.markInterestingNodes({ "67P", "Rosetta", "Philae" })
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400,
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = Comet67PAsset.Comet67P.Identifier,
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
@@ -147,6 +121,5 @@ end)
asset.onDeinitialize(function ()
sceneHelper.unbindKeys(Keybindings)
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({ "67P", "Rosetta", "Philae" })
end)
@@ -35,7 +35,8 @@ local object = {
Unit = "pc"
},
GUI = {
Path = "/Milky Way/Brown Dwarfs"
Name = "Brown Dwarfs",
Path = "/Milky Way"
}
}
@@ -36,7 +36,7 @@ local object = {
},
GUI = {
Name = "Globular Clusters",
Path = "/Milky Way/Globular Clusters"
Path = "/Milky Way"
}
}
+267 -3
View File
@@ -7,7 +7,7 @@ local speck = asset.syncedResource({
Name = "Grids Speck Files",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_grids_speck",
Version = 1
Version = 2
})
local radio = {
@@ -37,6 +37,31 @@ local radio = {
}
}
local oort = {
Identifier = "OortSphere",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Scale = {
Type = "StaticScale",
Scale = 7.47989845E15;
}
},
Renderable = {
Type = "RenderableSphericalGrid",
Enabled = false,
GridColor = { 0.8, 0.4, 0.4, 0.25},
LineWidth = 2.0,
GridMatrix = { -0.05487554, 0.4941095, -0.8676661 , 0.0,
-0.9938214 , -0.1109906, -0.0003515167, 0.0,
-0.09647644, 0.8622859, 0.4971472 , 0.0,
0.0 , 0.0 , 0.0 , 1.0 }
},
GUI = {
Name = "Oort Sphere",
Path = "/Other/Grids"
}
}
local ecliptic = {
Identifier = "EclipticSphere",
Parent = transforms.SolarSystemBarycenter.Name,
@@ -186,6 +211,244 @@ local galacticLabels = {
}
}
local plane1ld = {
Identifier = "1ldGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/1ld.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/1ld.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 10.3,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "Km"
},
GUI = {
Name = "1ld Grid",
Path = "/Other/Grids"
}
}
local plane1lm = {
Identifier = "1lmGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/1lm.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/1lm.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 11.8,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "1lm Grid",
Path = "/Other/Grids"
}
}
local plane1ly = {
Identifier = "1lyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/1ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/1ly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 13.0,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "1ly Grid",
Path = "/Other/Grids"
}
}
local plane10ly = {
Identifier = "10lyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/10ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/10ly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 14.17,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "10ly Grid",
Path = "/Other/Grids"
}
}
local plane100ly = {
Identifier = "100lyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/100ly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/100ly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 15.0,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "100ly Grid",
Path = "/Other/Grids"
}
}
local plane1kly = {
Identifier = "1klyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/1kly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/1kly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 16.0,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "1kly Grid",
Path = "/Other/Grids"
}
}
local plane10kly = {
Identifier = "10klyGrid",
Parent = transforms.SolarSystemBarycenter.Name,
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {
-0.05487554, 0.4941095, -0.8676661,
-0.9938214 , -0.1109906, -0.0003515167,
-0.09647644, 0.8622859, 0.4971472
}
}
},
Renderable = {
Type = "RenderableDUMeshes",
Enabled = false,
Color = { 1.0, 1.0, 1.0 },
Transparency = 0.4,
ScaleFactor = 1.0,
File = speck .. "/10kly.speck",
MeshColor = {{ 0.1, 0.5, 0.6 }},
LabelFile = speck .. "/10kly.label",
TextColor = { 0.0, 0.2, 0.5, 1.0 },
TextSize = 17.25,
TextMinSize = 0.5,
TextMaxSize = 30.0,
Unit = "pc"
},
GUI = {
Name = "10kly Grid",
Path = "/Other/Grids"
}
}
local plane100kly = {
Identifier = "100klyGrid",
Renderable = {
@@ -302,6 +565,7 @@ local plane20Gly = {
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
radio, ecliptic, eclipticLabels, equatorial, equatorialLabels, galactic,
galacticLabels, plane100kly, plane1Mly, plane10Mly, plane100Mly, plane20Gly
radio, oort, ecliptic, eclipticLabels, equatorial, equatorialLabels, galactic,
galacticLabels, plane1ld, plane1lm, plane1ly, plane10ly, plane100ly, plane1kly,
plane10kly, plane100kly, plane1Mly, plane10Mly, plane100Mly, plane20Gly
})
@@ -36,7 +36,7 @@ local object = {
},
GUI = {
Name = "HII Regions",
Path = "/Milky Way/HII"
Path = "/Milky Way"
}
}
@@ -43,8 +43,8 @@ local sphere = {
FadeOutThreshold = 0.025
},
GUI = {
Name = "Milky Way",
Path = "/Milky Way/Milky Way"
Name = "Milky Way Sphere",
Path = "/Milky Way"
}
}
@@ -36,7 +36,7 @@ local object = {
},
GUI = {
Name = "OB Associations",
Path = "/Milky Way/OB Associations"
Path = "/Milky Way"
}
}
@@ -36,7 +36,7 @@ local object = {
},
GUI = {
Name = "Planetary Nebulae",
Path = "/Milky Way/Planetary Nebulae"
Path = "/Milky Way"
}
}
@@ -35,7 +35,7 @@ local object = {
Unit = "pc"
},
GUI = {
Path = "/Milky Way/Pulsars"
Path = "/Milky Way"
}
}
@@ -33,7 +33,7 @@ local object = {
BillboardMinSize = 0.0,
},
GUI = {
Path = "/Universe/Quasars"
Path = "/Universe"
}
}
@@ -29,7 +29,11 @@ local stars = {
Type = "RenderableStars",
File = speck .. "/stars.speck",
Texture = textures .. "/halo.png",
ColorMap = colorLUT .. "/colorbv.cmap"
--ShapeTexture = textures .. "/disc.png",
ColorMap = colorLUT .. "/colorbv.cmap",
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based" -- or PSF
},
GUI = {
Path = "/Milky Way/Stars"
@@ -38,7 +38,7 @@ local object = {
},
GUI = {
Name = "Supernova Remnants",
Path = "/Milky Way/Supernova Remnants"
Path = "/Milky Way"
}
}
@@ -13,7 +13,7 @@ local speck = asset.syncedResource({
Name = "Tully Speck Files",
Type = "HttpSynchronization",
Identifier = "digitaluniverse_tully_speck",
Version = 1
Version = 2
})
local tullyPoints = {
+4 -1
View File
@@ -31,8 +31,11 @@ local gaia_abundance_apogee = {
File = speck .. "/GaiaAbundApogee.speck",
ColorOption = "Other Data",
OtherData = "FeH",
ScaleFactor = 100,
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based",
Texture = textures .. "/halo.png",
-- ShapeTexture = textures .. "/disc.png",
ColorMap = colorLUT .. "/colorbv.cmap",
OtherDataColorMap = colorLUT .. "/viridis.cmap",
StaticFilter = -9999,
+4 -1
View File
@@ -30,9 +30,12 @@ local gaia_abundance_galah = {
Enabled = false,
File = speck .. "/GaiaAbundGalah.speck",
Texture = textures .. "/halo.png",
-- ShapeTexture = textures .. "/disc.png",
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based",
ColorOption = "Other Data",
OtherData = "FeH",
ScaleFactor = 100,
ColorMap = colorLUT .. "/colorbv.cmap",
OtherDataColorMap = colorLUT .. "/viridis.cmap",
StaticFilter = -9999,
@@ -26,7 +26,8 @@ local object = {
UseAdditiveBlending = true,
Orientation = "Inside",
MirrorTexture = true,
FadeOutThreshold = 0.01
FadeOutThreshold = 0.01,
Background = true
},
GUI = {
Name = "Milky Way (ESO)",
@@ -29,7 +29,10 @@ local object = {
Type = "RenderableStars",
File = speck .. "/denver_stars.speck",
Texture = textures .. "/halo.png",
ColorMap = colorLUT .. "/denver_colorbv.cmap"
ColorMap = colorLUT .. "/denver_colorbv.cmap",
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based" -- or PSF
},
GUI = {
Name = "Stars (Denver)",
@@ -18,7 +18,7 @@ local CharonTrailBarycentric = {
Resolution = 1000
},
GUI = {
Name = "Charon Barycenteric Trail",
Name = "Charon Barycentric Trail",
Path = "/Solar System/Dwarf Planets/Pluto"
}
}
@@ -18,7 +18,7 @@ local PlutoTrailBarycentric = {
Resolution = 1000
},
GUI = {
Name = "Pluto Barycenteric Trail",
Name = "Pluto Barycentric Trail",
Path = "/Solar System/Dwarf Planets/Pluto"
}
}
@@ -0,0 +1,981 @@
asset.require('spice/base')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local assetHelper = asset.require('util/asset_helper')
local models_chutes = asset.syncedResource({
Name = "Insight Models Chutes",
Type = "HttpSynchronization",
Identifier = "insight_models_chutes",
Version = 1
})
local models_cruise_arrays = asset.syncedResource({
Name = "Insight Models Cruise Arrays",
Type = "HttpSynchronization",
Identifier = "insight_models_cruise_arrays",
Version = 1
})
local models_cruise_cone = asset.syncedResource({
Name = "Insight Models Cruise Cone",
Type = "HttpSynchronization",
Identifier = "insight_models_cruise_cone",
Version = 1
})
local models_lander_lander_deck = asset.syncedResource({
Name = "Insight Models Lander Deck",
Type = "HttpSynchronization",
Identifier = "insight_models_lander_lander_deck",
Version = 1
})
local models_lander_legs_deploy = asset.syncedResource({
Name = "Insight Models Lander Legs Deploy",
Type = "HttpSynchronization",
Identifier = "insight_models_lander_legs_deploy",
Version = 1
})
local models_lander_legs_stow = asset.syncedResource({
Name = "Insight Models Lander Legs Stow",
Type = "HttpSynchronization",
Identifier = "insight_models_lander_legs_stow",
Version = 1
})
local models_lander_panels_deploy = asset.syncedResource({
Name = "Insight Models Lander Panels Deploy",
Type = "HttpSynchronization",
Identifier = "insight_models_lander_panels_deploy",
Version = 1
})
local models_lander_panels_stow = asset.syncedResource({
Name = "Insight Models Lander Panels Stow",
Type = "HttpSynchronization",
Identifier = "insight_models_lander_panels_stow",
Version = 1
})
local ikernels = asset.syncedResource({
Name = "Insight Kernels",
Type = "HttpSynchronization",
Identifier = "insight_kernels",
Version = 1
})
local iKernels = {
ikernels .. '/nsyt_spk_cruise_od063_v1_approach2surface_SC_Lander.tsc',
ikernels .. '/insight_v02.tfr',
ikernels .. '/mar085s.bsp',
ikernels .. '/nsyt_spk_cruise_POST_approach2surface_SC_Lander.bsp',
ikernels .. '/nsyt_spk_cruise_POST_approach2surface_SC_Lander.bck',
}
local RotationMatrix = {
-1, 0, 0,
0, 0, -1,
0, -1, 0
}
local LightSources = {
{
Type = "SceneGraphLightSource",
Identifier = "Sun",
Node = sunTransforms.SolarSystemBarycenter.Identifier,
Intensity = 1.0
},
{
Type = "SceneGraphLightSource",
Identifier = "Mars",
Node = "Mars",
Intensity = 1.0
},
{
Identifier = "Camera",
Type = "CameraLightSource",
Intensity = 0.5
}
}
--expected timeline
local entryTimeStart = "2018 NOV 26 19:39:03.68"; --(-00:08:07.32 less then pdf)
local parachuteDeployTime1 = "2018 NOV 26 19:42:41.68" -- entry + 218s
local parachuteDeployTime20 = "2018 NOV 26 19:42:42.18" -- entry + 218.5s
local parachuteDeployTime40 = "2018 NOV 26 19:42:42.68" -- entry + 219s
local heatShieldSeperationTime = "2018 NOV 26 19:42:56.68" -- entry + 233s
local legDeployTime = "2018 NOV 26 19:43:06.68" -- entry + 243s
local landerSeperationTime = "2018 NOV 26 19:44:51.68" -- entry + 348s
local touchdownTime = "2018 NOV 26 19:45:32.68" -- entry + 389s
local panelDeployTime = "2018 NOV 26 19:45:33.68" -- entry + 390s
local foreverTime = "2018 NOV 26 20:17:50.68" -- entry + 2327s
local kernelTouchdownTime = "2018 NOV 26 19:45:32.3"
local spiceRotationEndTime = "2018 NOV 26 19:51:39"
local InsightParent = {
Identifier = "InsightParent",
Parent = "MarsBarycenter",
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = "INSIGHT",
Observer = "MARS",
Frame = "GALACTIC",
Kernels = iKernels
},
Rotation = {
Type = "SpiceRotation",
SourceFrame = "INSIGHT_LANDER_CRUISE",
DestinationFrame = "GALACTIC"
},
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = spiceRotationEndTime
},
GUI = {
Hidden = true,
Name = "InsightParent",
Path = "/Solar System/Missions/Insight"
}
}
-- -1397 offset for MOLA
local Insight = {
Identifier = "Insight",
Parent = "InsightParent",
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = {0.0, 0.0, -3.1415}
}
},
GUI = {
Name = "Insight",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Entry_CapsuleA = {
Identifier = "Insight_Entry_CapsuleA",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_cruise_cone .. "/cruise_insight_doubleside2_newcapsule_diffuse.obj"
},
ColorTexture = models_cruise_cone .. "/insight_newcapsule_diffuse.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = landerSeperationTime
},
GUI = {
Hidden = true,
Name = "Insight Entry CapsuleA",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Entry_Capsule_Ring = {
Identifier = "Insight_Entry_Capsule_Ring",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_cruise_cone .. "/insight_cruise_cone_ring_foil_gold.obj"
},
ColorTexture = models_cruise_cone .. "/foil_gold_ramp.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = landerSeperationTime
},
GUI = {
Hidden = true,
Name = "Insight Entry Capsule Ring",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Entry_Capsule_Plugs = {
Identifier = "Insight_Entry_Capsule_Plugs",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_cruise_cone .. "/insight_cruise_cone_capsule_diffuse.obj"
},
ColorTexture = models_cruise_cone .. "/insight_capsule_diffuse.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = landerSeperationTime
},
GUI = {
Hidden = true,
Name = "Insight Entry Capsule Plugs",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Entry_Heatshield = {
Identifier = "Insight_Entry_Heatshield",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_cruise_cone .. "/insight_cruise_heatshield_foil_gold.obj"
},
ColorTexture = models_cruise_cone .. "/foil_gold_ramp.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = heatShieldSeperationTime
},
GUI = {
Hidden = true,
Name = "Insight Entry Heatshield",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Parachute_0 = {
Identifier = "Insight_Parachute_0",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_chutes .. "/insight_chute_frame01_diff1.obj"
},
ColorTexture = models_chutes .. "/chute_diff.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = parachuteDeployTime1,
End = parachuteDeployTime20
},
GUI = {
Hidden = true,
Name = "Insight Parachute0",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Parachute_Cords_0 = {
Identifier = "Insight_Parachute_Cords_0",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_chutes .. "/insight_chute_frame01_cords1.obj"
},
ColorTexture = models_chutes .. "/foil_gold_ramp.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = parachuteDeployTime1,
End = parachuteDeployTime20
},
GUI = {
Hidden = true,
Name = "Insight ParachuteC0",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Parachute_20 = {
Identifier = "Insight_Parachute_20",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_chutes .. "/insight_chute_frame20_diff1.obj"
},
ColorTexture = models_chutes .. "/chute_diff.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = parachuteDeployTime20,
End = parachuteDeployTime40
},
GUI = {
Hidden = true,
Name = "Insight Parachute20",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Parachute_Cords_20 = {
Identifier = "Insight_Parachute_Cords_20",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_chutes .. "/insight_chute_frame20_cords1.obj"
},
ColorTexture = models_chutes .. "/foil_gold_ramp.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = parachuteDeployTime20,
End = parachuteDeployTime40
},
GUI = {
Hidden = true,
Name = "Insight ParachuteC20",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Parachute_40 = {
Identifier = "Insight_Parachute_40",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_chutes .. "/chute_doubleside_frame40_diff.obj"
},
ColorTexture = models_chutes .. "/chute_diff.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = parachuteDeployTime40,
End = landerSeperationTime
},
GUI = {
Hidden = true,
Name = "Insight Parachute40",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Parachute_Cords_40 = {
Identifier = "Insight_Parachute_Cords_40",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_chutes .. "/insight_chute_frame40_cords1.obj"
},
ColorTexture = models_chutes .. "/foil_gold_ramp.png",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = parachuteDeployTime40,
End = landerSeperationTime
},
GUI = {
Hidden = true,
Name = "Insight ParachuteC40",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_A001 = {
Identifier = "Insight_Lander_A001",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_AO01.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_AO_01.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander A001",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_A002 = {
Identifier = "Insight_Lander_A002",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_AO02.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_AO_02.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander A002",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_A003 = {
Identifier = "Insight_Lander_A003",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_AO03.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_AO_03.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander A003",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_A004 = {
Identifier = "Insight_Lander_A004",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_AO04.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_AO_04.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander A004",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_A005 = {
Identifier = "Insight_Lander_A005",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_AO05.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_AO_05.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander A005",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_A006 = {
Identifier = "Insight_Lander_A006",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_AO06.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_AO_06.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander A006",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_A007 = {
Identifier = "Insight_Lander_A007",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_AO07.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_AO_07.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander A007",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_A008 = {
Identifier = "Insight_Lander_A008",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_AO08.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_AO_08.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander A008",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_foil1 = {
Identifier = "Insight_Lander_foil1",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_foil1.obj"
},
ColorTexture = models_lander_lander_deck .. "/foil_silver_ramp.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander foil",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_Tex01 = {
Identifier = "Insight_Lander_Tex01",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_tex01.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_tex_01.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander Tex01",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Lander_Tex02 = {
Identifier = "Insight_Lander_Tex02",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_lander_deck .. "/insight_lander_deck_tex02.obj"
},
ColorTexture = models_lander_lander_deck .. "/InSIGHT_tex_02.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight Lander Tex02",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Legs_Stowed_tex = {
Identifier = "Insight_Legs_Stowed_tex",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_legs_stow .. "/insight_lander_legs_stow_tex01.obj"
},
ColorTexture = models_lander_legs_stow .. "/InSIGHT_tex_01.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = heatShieldSeperationTime,
End = legDeployTime
},
GUI = {
Hidden = true,
Name = "Insight legs_stow_tex",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Legs_Stowed_AO06 = {
Identifier = "Insight_Legs_Stowed_AO",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_legs_stow .. "/insight_lander_legs_stow_AO06.obj"
},
ColorTexture = models_lander_legs_stow .. "/InSIGHT_AO_06.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = heatShieldSeperationTime,
End = legDeployTime
},
GUI = {
Hidden = true,
Name = "Insight legs_stow_AO",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Legs_Deployed_tex = {
Identifier = "Insight_Legs_Deployed_tex",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_legs_deploy .. "/insight_lander_legs_deploy_tex01.obj"
},
ColorTexture = models_lander_legs_deploy .. "/InSIGHT_tex_01.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = legDeployTime,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight legs_deploy_tex",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Legs_Deployed_AO06 = {
Identifier = "Insight_Legs_Deployed_AO",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_legs_deploy .. "/insight_lander_legs_deploy_AO06.obj"
},
ColorTexture = models_lander_legs_deploy .. "/InSIGHT_AO_06.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = legDeployTime,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight legs_deploy_AO",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Panels_Stowed_tex = {
Identifier = "Insight_Panels_Stowed_tex",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_panels_stow .. "/insight_lander_panels_stow_tex01.obj"
},
ColorTexture = models_lander_panels_stow .. "/InSIGHT_tex_01.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight panels_stow_tex",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Panels_Stowed_tex2 = {
Identifier = "Insight_Panels_Stowed_tex2",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_panels_stow .. "/insight_lander_panels_stow_tex02.obj"
},
ColorTexture = models_lander_panels_stow .. "/InSIGHT_tex_02.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight panels_stow_tex2",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Panels_Stowed_AO01 = {
Identifier = "Insight_Panels_Stowed_AO",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_panels_stow .. "/insight_lander_panels_stow_AO01.obj"
},
ColorTexture = models_lander_panels_stow .. "/InSIGHT_AO_01.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight panels_stow_AO",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Panels_Deployed_tex = {
Identifier = "Insight_panels_Deployed_tex",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_panels_deploy .. "/insight_lander_panels_deploy_tex01.obj"
},
ColorTexture = models_lander_panels_deploy .. "/InSIGHT_tex_01.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = panelDeployTime,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight panels_deploy_tex",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Panels_Deployed_tex2 = {
Identifier = "Insight_panels_Deployed_tex2",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_panels_deploy .. "/insight_lander_panels_deploy_tex02.obj"
},
ColorTexture = models_lander_panels_deploy .. "/InSIGHT_tex_02.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = panelDeployTime,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight panels_deploy_tex2",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Panels_Deployed_AO06 = {
Identifier = "Insight_panels_Deployed_AO",
Parent = Insight.Identifier,
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = models_lander_panels_deploy .. "/insight_lander_panels_deploy_AO01.obj"
},
ColorTexture = models_lander_panels_deploy .. "/InSIGHT_AO_01.jpg",
ModelTransform = RotationMatrix,
LightSources = LightSources,
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = panelDeployTime,
End = foreverTime
},
GUI = {
Hidden = true,
Name = "Insight panels_deploy_AO",
Path = "/Solar System/Missions/Insight"
}
}
local Insight_Trail = {
Identifier = "InsightTrail",
Parent = "Mars",
Renderable = {
Enabled = false,
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
Target = "-189",
Observer = "MARS",
Frame = "IAU_MARS",
Kernels = iKernels
},
Color = { 0.70, 0.50, 0.20 },
StartTime = "2018 NOV 26 19:30:13.390",
EndTime = "2018 NOV 26 19:51:40.890",
SampleInterval = 2
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = entryTimeStart,
End = landerSeperationTime
},
GUI = {
Name = "Insight Trail",
Path = "/Solar System/Missions/Insight"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
InsightParent, Insight, Insight_Entry_CapsuleA, Insight_Entry_Capsule_Ring,
Insight_Entry_Capsule_Plugs, Insight_Entry_Heatshield, Insight_Parachute_0,
Insight_Parachute_Cords_0, Insight_Parachute_20, Insight_Parachute_Cords_20,
Insight_Parachute_40, Insight_Parachute_Cords_40, Insight_Lander_A001,
Insight_Lander_A002, Insight_Lander_A003, Insight_Lander_A004, Insight_Lander_A005,
Insight_Lander_A006, Insight_Lander_A007, Insight_Lander_A008, Insight_Lander_foil1,
Insight_Lander_Tex01, Insight_Lander_Tex02, Insight_Legs_Stowed_tex,
Insight_Legs_Stowed_AO06, Insight_Legs_Deployed_tex, Insight_Legs_Deployed_AO06,
Insight_Panels_Stowed_tex, Insight_Panels_Stowed_tex2, Insight_Panels_Stowed_AO01,
Insight_Panels_Deployed_tex, Insight_Panels_Deployed_tex2,
Insight_Panels_Deployed_AO06, Insight_Trail
})
@@ -17,14 +17,16 @@ local model = asset.syncedResource({
Version = 1
})
local kernels = asset.syncedResource({
Name = "Juno Kernels",
Type = "HttpSynchronization",
Identifier = "juno_kernels",
Version = 1
Version = 2
})
local JunoKernels = {
kernels .. "/juno_v12.tf",
kernels .. "/JNO_SCLKSCET.00039.tsc",
kernels .. "/juno_jade_v00.ti",
kernels .. "/juno_jedi_v00.ti",
@@ -34,10 +36,10 @@ local JunoKernels = {
kernels .. "/juno_mwr_v01.ti",
kernels .. "/juno_struct_v01.ti",
kernels .. "/juno_uvs_v00.ti",
kernels .. "/juno_v08.tf",
kernels .. "/juno_waves_v00.ti",
kernels .. "/juno_mwr_v01.ti",
kernels .. "/spk_merge_110805_171017_130515.bsp",
kernels .. "/juno_sc_nom_110807_171016_v01.bc",
kernels .. "/juno_sc_prl_110930_111028_jc003c01_v01.bc",
kernels .. "/juno_sc_prl_111028_111125_jc004b00_v01.bc",
kernels .. "/juno_sc_prl_111125_111223_jc005b00_v01.bc",
@@ -161,19 +163,12 @@ local Juno = {
},
ColorTexture = textures .. "/gray.png",
ModelTransform = RotationMatrix,
LightSources = {
{
Type = "SceneGraphLightSource",
Identifier = "Sun",
Node = sunTransforms.SolarSystemBarycenter.Identifier,
Intensity = 1.0
},
{
Identifier = "Camera",
Type = "CameraLightSource",
Intensity = 0.5
}
}
LightSources = assetHelper.getDefaultLightSources(sunTransforms.SolarSystemBarycenter.Identifier)
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2011-08-07T17:15:00",
End = "2017-10-16T19:29:24"
},
GUI = {
Path = "/Solar System/Missions/Juno"
@@ -14,12 +14,13 @@ local kernels = asset.syncedResource({
Name = "Messenger Kernels",
Type = "HttpSynchronization",
Identifier = "messenger_spice",
Version = 1
Version = 2
})
local LocalKernels = {
kernels .. '/messenger_2548.tsc',
kernels .. '/msgr_v231.tf',
kernels .. '/de405.bsp',
kernels .. '/msgr_040803_150430_150430_od431sc_2.bsp',
@@ -34,40 +35,30 @@ local LocalKernels = {
kernels .. '/msgr_mla_v010.ti',
kernels .. '/msgr_rs_v111.ti',
kernels .. '/msgr_xrs_v001.ti',
kernels .. '/msgr_1103_v02.bc',
kernels .. '/msgr_1104_v02.bc',
kernels .. '/msgr_1105_v02.bc',
kernels .. '/msgr_1106_v02.bc',
kernels .. '/pck00008.tpc',
kernels .. '/pck00008_msgr.tpc',
kernels .. '/pck00009_msgr_v10.tpc',
kernels .. '/pck00010_msgr_v10.tpc',
kernels .. '/pck00010_msgr_v23.tpc',
kernels .. '/pck00010.tpc'
kernels .. '/pck00010.tpc',
kernels .. '/msgr_1103_v02.bc',
kernels .. '/msgr_1104_v02.bc',
kernels .. '/msgr_1105_v02.bc',
kernels .. '/msgr_1106_v02.bc',
}
local RotationMatrix = {
0, 1, 0,
0, 0, 1,
1, 0, 0
1, 0, 0,
0, 0, -1,
0, 1, 0
}
local LightSources = {
{
Type = "SceneGraphLightSource",
Identifier = "Sun",
Node = sunTransforms.SolarSystemBarycenter.Identifier,
Intensity = 1.0
},
{
Identifier = "Camera",
Type = "CameraLightSource",
Intensity = 0.5
}
}
local LightSources = assetHelper.getDefaultLightSources(sunTransforms.SolarSystemBarycenter.Identifier)
local Messenger = {
Identifier = "Messenger",
@@ -85,6 +76,11 @@ local Messenger = {
DestinationFrame = "GALACTIC",
},
},
TimeFrame = {
Type = "TimeFrameInterval",
Start = "2011-03-01",
End = "2011-06-30"
},
GUI = {
Name = "Messenger",
Path = "/Solar System/Missions/Messenger"
@@ -148,7 +144,6 @@ local MessengerProbeHeatShield = {
}
}
local MessengerProbeMetal = {
Identifier = "MessengerProbe_Metal",
Parent = Messenger.Identifier,
@@ -0,0 +1,75 @@
local assetHelper = asset.require('util/asset_helper')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local modelFolder = asset.syncedResource({
Name = "Pioneer 10/11 Models",
Type = "HttpSynchronization",
Identifier = "pioneer_10_11_model",
Version = 1
})
local kernelsFolder = asset.syncedResource({
Name = "Pioneer Kernels",
Type = "HttpSynchronization",
Identifier = "pioneer_10_spice",
Version = 1
})
local kernelsList = {kernelsFolder .. '/p10-a.bsp'}
local Pioneer10NAIF = "-23"
local Pioneer10 = {
Identifier = "Pioneer10",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = Pioneer10NAIF,
Observer = "SUN",
Kernels = kernelsList
},
},
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = modelFolder .. "/Pioneer.obj"
},
ColorTexture = modelFolder .. "/gray.png",
LightSources = assetHelper.getDefaultLightSources(sunTransforms.SolarSystemBarycenter.Identifier)
},
GUI = {
Name = "Pioneer 10",
Path = "/Solar System/Missions/Pioneer/10"
}
}
local Pioneer10Trail = {
Identifier = "Pioneer10Trail",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
Target = Pioneer10NAIF,
Observer = "SUN",
Kernels = kernelsList
},
Color = { 0.70, 0.50, 0.20 },
StartTime = "1972 MAR 03 02:04:00",
EndTime = "1990 JAN 02 00:00:00",
EnableFade = false,
SampleInterval = 6545 * 2
-- 6545 is the number of days between the Start and End time (aka sample every 2d)
},
GUI = {
Name = "Pioneer 10 Trail",
Path = "/Solar System/Missions/Pioneer/10"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
Pioneer10,
Pioneer10Trail,
})
@@ -0,0 +1,78 @@
local assetHelper = asset.require('util/asset_helper')
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
local modelFolder = asset.syncedResource({
Name = "Pioneer 10/11 Models",
Type = "HttpSynchronization",
Identifier = "pioneer_10_11_model",
Version = 1
})
local kernelsFolder = asset.syncedResource({
Name = "Pioneer Kernels",
Type = "HttpSynchronization",
Identifier = "pioneer_11_spice",
Version = 1
})
local kernelsList = {
kernelsFolder .. '/p11-a.bsp',
kernelsFolder .. '/p11_sat336.bsp'
}
local Pioneer11NAIF = "-24"
local Pioneer11 = {
Identifier = "Pioneer_11",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = Pioneer11NAIF,
Observer = "SUN",
Kernels = kernelsList
},
},
Renderable = {
Type = "RenderableModel",
Geometry = {
Type = "MultiModelGeometry",
GeometryFile = modelFolder .. "/Pioneer.obj"
},
ColorTexture = modelFolder .. "/gray.png",
LightSources = assetHelper.getDefaultLightSources(sunTransforms.SolarSystemBarycenter.Identifier)
},
GUI = {
Name = "Pioneer 11",
Path = "/Solar System/Missions/Pioneer/11"
}
}
local Pioneer11Trail = {
Identifier = "Pioneer11Trail",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "SpiceTranslation",
Target = Pioneer11NAIF,
Observer = "SUN",
Kernels = kernelsList
},
Color = { 0.70, 0.50, 0.20 },
StartTime = "1973 APR 06 02:25:00.000",
EndTime = "1990 JAN 02 00:00:00.000",
EnableFade = false,
SampleInterval = 6087 * 2
--6087 is the number of days between the Start and End time (so sample every 2d)
},
GUI = {
Name = "Pioneer 11 Trail",
Path = "/Solar System/Missions/Pioneer/11"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
Pioneer11,
Pioneer11Trail,
})
@@ -205,7 +205,7 @@ local VoyagerTrailEncounterSaturn = {
}
}
local VoyagerTrailSaturnUranus = {
local VoyagerTrailCruiseSaturnUranus = {
Identifier = "Voyager_2_Trail_Cruise_Saturn_Uranus",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Renderable = {
@@ -1,6 +1,8 @@
local transforms = asset.require('./transforms')
local assetHelper = asset.require('util/asset_helper')
local texturesPath = asset.require('./earth_textures').TexturesPath
local labelsPath = asset.require('./earth_labels').LabelsPath
asset.request('./trail')
@@ -266,7 +268,24 @@ local Earth = {
Radius = 1.737E6
}
--Caster2 = { Name = "Independency Day Ship", Radius = 0.0, }
}
},
Labels = {
Enable = false,
FileName = labelsPath .. "/Earth.labels",
LabelAlignmentOption = "Horizontally", -- or Circularly
LabelsFontSize = 41.0,
LabelsSize = 0.52,
LabelsMinSize = 1.0,
LabelsMaxSize = 1500.0,
ProximityEnabled = false,
LabelsFadeInEnabled = true,
LabelsFadeOutEnabled = false,
FadeInStartingDistance = 50000.0,
FadeOutStartingDistance = 80000.0,
LabelsForceDomeRendering = true,
LabelsDistanceEPS = 1500000.0,
LabelsColor = {1.0, 0.0, 0.0, 1.0}
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
GUI = {
@@ -0,0 +1,7 @@
local LabelsPath = asset.syncedResource({
Name = "Earth Labels",
Type = "HttpSynchronization",
Identifier = "earth_labels",
Version = 1
})
asset.export("LabelsPath", LabelsPath)
@@ -1,18 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://planetarydev-1803629091.us-west-2.elb.amazonaws.com/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>
<SizeX>4194304</SizeX> <SizeY>2097152</SizeY>
<TileLevel>12</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>2</BandsCount>
<MaxConnections>5</MaxConnections>
<ZeroBlockHttpCodes>400,204,404</ZeroBlockHttpCodes>
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
<Timeout>5</Timeout>
</GDAL_WMS>
@@ -1,23 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://planetarydev-1803629091.us-west-2.elb.amazonaws.com/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>
<ZeroBlockHttpCodes>400,204,404</ZeroBlockHttpCodes>
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
<Timeout>5</Timeout>
</GDAL_WMS>
@@ -1,24 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://planetarydev-1803629091.us-west-2.elb.amazonaws.com/Mars/MolaElevation/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>1</BandsCount>
<DataType>Int16</DataType>
<MaxConnections>10</MaxConnections>
<ZeroBlockHttpCodes>400,204,404</ZeroBlockHttpCodes>
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
<Timeout>5</Timeout>
</GDAL_WMS>
@@ -1,23 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://planetarydev-1803629091.us-west-2.elb.amazonaws.com/Mars/MolaPseudoColor/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>
<ZeroBlockHttpCodes>400,204,404</ZeroBlockHttpCodes>
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
<Timeout>5</Timeout>
</GDAL_WMS>
@@ -1,23 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://planetarydev-1803629091.us-west-2.elb.amazonaws.com/Mars/ThemisIRDay/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>
<ZeroBlockHttpCodes>400,204,404</ZeroBlockHttpCodes>
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
<Timeout>5</Timeout>
</GDAL_WMS>
@@ -1,23 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://planetarydev-1803629091.us-west-2.elb.amazonaws.com/Mars/ThemisIRNight/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>
<ZeroBlockHttpCodes>400,204,404</ZeroBlockHttpCodes>
<ZeroBlockOnServerException>true</ZeroBlockOnServerException>
<Timeout>5</Timeout>
</GDAL_WMS>
@@ -0,0 +1,18 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://astro.arcgis.com/arcgis/rest/services/OnMars/HiRISELS/base/MapServer/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180</UpperLeftX> <UpperLeftY>90</UpperLeftY>
<LowerRightX>180</LowerRightX> <LowerRightY>-90</LowerRightY>
<SizeX>83886080</SizeX> <SizeY>41943040</SizeY>
<TileLevel>17</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>1</BandsCount>
<MaxConnections>5</MaxConnections>
<DataValues NoData="0" Min="1" Max="255"/>
<ZeroBlockHttpCodes>404,400</ZeroBlockHttpCodes>
</GDAL_WMS>
@@ -0,0 +1,29 @@
<VRTDataset rasterXSize="83886080" rasterYSize="41943040">
<SRS>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]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 4.2915344238281250e-06, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -4.2915344238281250e-06</GeoTransform>
<VRTRasterBand dataType="Byte" band="1">
<NoDataValue>0</NoDataValue>
<ColorInterp>Gray</ColorInterp>
<ComplexSource>
<SourceFilename relativeToVRT="1">HiRISELS.tif</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="83886080" RasterYSize="41943040" DataType="Byte" BlockXSize="512" BlockYSize="512" />
<SrcRect xOff="0" yOff="0" xSize="83886080" ySize="41943040" />
<DstRect xOff="0" yOff="0" xSize="83886080" ySize="41943040" />
<NODATA>0</NODATA>
</ComplexSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2">
<ColorInterp>Alpha</ColorInterp>
<NoDataValue>0</NoDataValue>
<ComplexSource>
<SourceFilename relativeToVRT="1">HiRISELS.tif</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="83886080" RasterYSize="41943040" DataType="Byte" BlockXSize="512" BlockYSize="512" />
<SrcRect xOff="0" yOff="0" xSize="83886080" ySize="41943040" />
<DstRect xOff="0" yOff="0" xSize="83886080" ySize="41943040" />
<ScaleRatio>255</ScaleRatio>
<NODATA>0</NODATA>
</ComplexSource>
</VRTRasterBand>
</VRTDataset>
@@ -0,0 +1,17 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://astro.arcgis.com/arcgis/rest/services/OnMars/HiRISE_DEM/ImageServer/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180</UpperLeftX> <UpperLeftY>90</UpperLeftY>
<LowerRightX>180</LowerRightX> <LowerRightY>-90</LowerRightY>
<SizeX>20971520</SizeX> <SizeY>10485760</SizeY>
<TileLevel>15</TileLevel> <YOrigin>top</YOrigin>
</DataWindow>
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190,0]],PRIMEM["Reference_Meridian",0],UNIT["Degree",0.0174532925199433]]</Projection>
<BlockSizeX>512</BlockSizeX> <BlockSizeY>512</BlockSizeY>
<BandsCount>1</BandsCount> <DataType>Int16</DataType>
<DataValues NoData="-32768" Min="-8528" Max="21226"/>
<MaxConnections>5</MaxConnections>
<ZeroBlockHttpCodes>404,400</ZeroBlockHttpCodes>
</GDAL_WMS>
@@ -0,0 +1,17 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://astro.arcgis.com/arcgis/rest/services/OnMars/HiRISE_DEM/ImageServer/tile/${z}/${y}/${x}</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-180</UpperLeftX> <UpperLeftY>90</UpperLeftY>
<LowerRightX>180</LowerRightX> <LowerRightY>-90</LowerRightY>
<SizeX>20971520</SizeX> <SizeY>10485760</SizeY>
<TileLevel>15</TileLevel> <YOrigin>top</YOrigin>
</DataWindow>
<Projection>GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190,0]],PRIMEM["Reference_Meridian",0],UNIT["Degree",0.0174532925199433]]</Projection>
<BlockSizeX>512</BlockSizeX> <BlockSizeY>512</BlockSizeY>
<BandsCount>1</BandsCount> <DataType>Int16</DataType>
<DataValues NoData="0" Min="-10000" Max="10000"></DataValues>
<MaxConnections>5</MaxConnections>
<ZeroBlockHttpCodes>404,400</ZeroBlockHttpCodes>
</GDAL_WMS>
@@ -0,0 +1,5 @@
Name="HiRISE Local Set"
Identifier="OnMarsHiRISELS"
Description="HiRISE Stereo Pairs"
ColorFile="HiRISELS.vrt"
HeightFile="HiRISE_DEM.wms"
@@ -48,11 +48,6 @@ local color_layers = {
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]",
@@ -63,11 +58,6 @@ local color_layers = {
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 = "MOLA_HRSC_Utah",
Name = "MOLA HRSC [Utah]",
@@ -90,12 +80,6 @@ local color_layers = {
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]",
@@ -108,12 +92,6 @@ local color_layers = {
FilePath = mapServiceConfigs .. "/LiU/Themis_IR_Night.wms",
BlendMode = "Color"
},
{
Identifier = "Themis_IR_Night_AWS",
Name = "Themis IR Night [AWS]",
FilePath = mapServiceConfigs .. "/AWS/Themis_IR_Night.wms",
BlendMode = "Color"
},
{
Identifier = "CTX_Mosaic_Utah",
Name = "CTX Mosaic [Utah]",
@@ -125,12 +103,6 @@ local color_layers = {
Name = "CTX Mosaic [Sweden]",
FilePath = mapServiceConfigs .. "/LiU/CTX.wms",
BlendMode = "Color"
},
{
Identifier = "CTX_Mosaic_AWS",
Name = "CTX Mosaic [AWS]",
FilePath = mapServiceConfigs .. "/AWS/CTX.wms",
BlendMode = "Color"
}
}
@@ -166,12 +138,6 @@ local height_layers = {
FilePath = mapServiceConfigs .. "/Utah/Mola_Elevation.wms",
Enabled = true,
TilePixelSize = 90
},
{
Identifier = "Mola_AWS",
Name = "Mola Elevation [AWS]",
FilePath = mapServiceConfigs .. "/AWS/Mola_Elevation.wms",
TilePixelSize = 90
}
}
@@ -205,6 +171,4 @@ local Mars = {
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, { Mars })
@@ -1,21 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://planetarydev-1803629091.us-west-2.elb.amazonaws.com/Mercury/MessengerMdis/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>
<Timeout>5</Timeout>
</GDAL_WMS>
@@ -1,21 +0,0 @@
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://planetarydev-1803629091.us-west-2.elb.amazonaws.com/Mercury/MessengerMosaic/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>
<Timeout>5</Timeout>
</GDAL_WMS>
@@ -1,5 +1,7 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require('./transforms')
local labelsPath = asset.require('./mercury_labels').LabelsPath
asset.require("spice/base")
asset.request('./trail')
@@ -26,11 +28,6 @@ local color_layers = {
Name = "Messenger MDIS [Sweden]",
FilePath = mapServiceConfigs .. "/LiU/Messenger_MDIS.wms",
},
{
Identifier = "Messenger_MDIS_AWS",
Name = "Messenger MDIS [AWS]",
FilePath = mapServiceConfigs .. "/AWS/MessengerMdis.wms"
},
--mossaic
{
Identifier = "Messenger_Mosaic_Utah",
@@ -42,11 +39,6 @@ local color_layers = {
Name = "Messenger Mosaic [Sweden]",
FilePath = mapServiceConfigs .. "/LiU/Messenger_Mosaic.wms"
},
{
Identifier = "Messenger_Mosaic_AWS",
Name = "Messenger Mosaic [AWS]",
FilePath = mapServiceConfigs .. "/AWS/MessengerMosaic.wms"
},
--bdr
{
Identifier = "Messenger_BDR_Utah",
@@ -212,6 +204,21 @@ local Mercury = {
SegmentsPerPatch = 64,
Layers = {
ColorLayers = color_layers
},
Labels = {
Enable = false,
FileName = labelsPath .. "/Mercury.labels",
LabelAlignmentOption = "Horizontally", -- or Circularly
LabelsFontSize = 40.0,
LabelsSize = 10.0,
LabelsMinSize = 1.0,
LabelsMaxSize = 1500.0,
ProximityEnabled = false,
FadeInStartingDistance = 40000000.0,
FadeOutStartingDistance = 80000.0,
LabelsForceDomeRendering = true,
LabelsDistanceEPS = 1500000.0,
LabelsColor = {1.0, 1.0, 0.0, 1.0}
}
},
Tag = { "planet_solarSystem", "planet_terrestrial" },
@@ -0,0 +1,7 @@
local LabelsPath = asset.syncedResource({
Name = "Mercury Labels",
Type = "HttpSynchronization",
Identifier = "mercury_labels",
Version = 1
})
asset.export("LabelsPath", LabelsPath)
@@ -28,4 +28,4 @@ local HyperionTrail = {
assetHelper.registerSceneGraphNodesAndExport(asset, { MimasTrail })
assetHelper.registerSceneGraphNodesAndExport(asset, { HyperionTrail })
@@ -14,7 +14,8 @@ local SunGlare = {
Origin = "Center",
Billboard = true,
Texture = textures .. "/halo.png",
BlendMode = "Additive"
BlendMode = "Additive",
RenderableType = "Transparent"
},
Transform = {
Translation = {
+26 -14
View File
@@ -23,7 +23,7 @@ local registerSceneGraphNodes = function (sceneAsset, nodes, override)
override = override or false
if not override then
if tableLength(nodes) == 0 then
openspace.printWarning("Register function was called with an empty node list. Pass 'true' as third argument to silence this warning.")
openspace.printWarning(sceneAsset.filePath .. ": Register function was called with an empty node list. Pass 'true' as third argument to silence this warning.")
return
end
end
@@ -43,11 +43,13 @@ local registerSceneGraphNodes = function (sceneAsset, nodes, override)
end
local registerDashboardItems = function (dashboardAsset, items)
dashboardAsset.onInitialize(function ()
dashboardAsset.onInitialize(
function ()
for i, item in ipairs(items) do
openspace.dashboard.addDashboardItem(item)
end
end)
end
)
dashboardAsset.onDeinitialize(function ()
for i = #items, 1, -1 do
item = items[i]
@@ -60,7 +62,7 @@ local registerSceneGraphNodesAndExport = function (sceneAsset, nodes, override)
override = override or false
if not override then
if tableLength(nodes) == 0 then
openspace.printWarning("Register function was called with an empty node list. Pass 'true' as third argument to silence this warning.")
openspace.printWarning(sceneAsset.filePath .. ": Register function was called with an empty node list. Pass 'true' as third argument to silence this warning.")
return
end
end
@@ -88,15 +90,6 @@ local registerSceneGraphNodesAndExport = function (sceneAsset, nodes, override)
end
end
local registerInterestingNodes = function (sceneAsset, nodes)
sceneAsset.onInitialize(function ()
openspace.markInterestingNodes(nodes)
end)
sceneAsset.onDeinitialize(function ()
openspace.removeInterestingNodes(nodes)
end)
end
local requireAll = function (sceneAsset, directory)
function string.ends(String,End)
return End=='' or string.sub(String,-string.len(End))==End
@@ -130,10 +123,29 @@ local requestAll = function (sceneAsset, directory)
end
end
local getDefaultLightSources = function (solarSystemBarycenterIdentifier)
local sourceList = {
{
Type = "SceneGraphLightSource",
Identifier = "Sun",
Node = solarSystemBarycenterIdentifier,
Intensity = 1.0
},
{
Identifier = "Camera",
Type = "CameraLightSource",
Intensity = 0.5
}
}
return sourceList
end
asset.export("registerSceneGraphNodes", registerSceneGraphNodes)
asset.export("registerSceneGraphNodesAndExport", registerSceneGraphNodesAndExport)
asset.export("registerSpiceKernels", registerSpiceKernels)
asset.export("registerDashboardItems", registerDashboardItems)
asset.export("registerInterestingNodes", registerInterestingNodes)
asset.export("requireAll", requireAll)
asset.export("requestAll", requestAll)
asset.export("getDefaultLightSources", getDefaultLightSources)
+1 -1
View File
@@ -51,7 +51,7 @@ local Keybindings = {
},
{
Key = "f",
Name = "Toggle roation friction",
Name = "Toggle Rotation friction",
Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'),
Documentation = "Toggles the rotational friction of the camera. If it is disabled, the camera rotates around the focus object indefinitely.",
GuiPath = "/Navigation",
+1 -1
View File
@@ -1,7 +1,7 @@
local guiCustomization = asset.require('customization/gui')
-- Select which commit hashes to use for the frontend and backend
local frontendHash = "6a34f2b0c6cfde64b890f12aa5bfaa42ac61a40f"
local frontendHash = "f6c17563e5fc3b3e16d18b50e8932f258b34a3bc"
local backendHash = "408142f26d3fa3d041399fcf58645874589d5b64"
local dataProvider = "data.openspaceproject.com/files/webgui"
+2 -26
View File
@@ -1,28 +1,17 @@
asset.require('./base')
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
assetHelper.requestAll(asset, 'scene/solarsystem/sun')
asset.require('scene/solarsystem/planets')
asset.require('scene/solarsystem/planets/jupiter/minor_moons')
asset.require('scene/solarsystem/planets/saturn/minor_moons')
asset.require('scene/solarsystem/planets/uranus/minor_moons')
asset.require('scene/solarsystem/planets/neptune/inner_moons')
asset.require('scene/solarsystem/planets/neptune/irregular_prograde_moons')
asset.require('scene/solarsystem/planets/neptune/irregular_retrograde_moons')
asset.request('scene/digitaluniverse/stars')
asset.request('scene/digitaluniverse/milkyway')
asset.require('scene/solarsystem/missions/voyager/voyager1')
asset.require('scene/solarsystem/missions/voyager/voyager2')
-- Load default key bindings applicable to most scenes
asset.require('util/default_keybindings')
asset.require('util/default_dashboard')
asset.require('util/default_joystick')
asset.require('util/webgui')
local VoyagerAsset = asset.require('scene/solarsystem/missions/voyager/voyager1')
assetHelper.registerDashboardItems(asset, {
@@ -49,8 +38,6 @@ assetHelper.registerDashboardItems(asset, {
asset.onInitialize(function ()
openspace.time.setTime("1977 SEP 10 12:00:00")
openspace.setDefaultGuiSorting()
sceneHelper.setDeltaTimeKeys({
1, 5, 10, 20, 40, 90, 360, 720, 2880, 14400,
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
@@ -60,16 +47,6 @@ asset.onInitialize(function ()
"Earth", "Voyager 1", "Voyager 2", "Jupiter", "Saturn", "Uranus", "Neptune"
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.Renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.navigation.setCameraState({
Anchor = VoyagerAsset.Voyager_1.Identifier,
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
@@ -78,7 +55,6 @@ asset.onInitialize(function ()
end)
asset.onDeinitialize(function ()
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
openspace.removeInterestingNodes({
"Earth", "Voyager 1", "Voyager 2", "Jupiter", "Saturn", "Uranus", "Neptune"
})
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

+1
View File
@@ -65,6 +65,7 @@ struct Configuration {
};
DocumentationInfo documentation;
std::string versionCheckUrl;
bool useMultithreadedInitialization = false;
struct LoadingScreen {
+3
View File
@@ -46,6 +46,7 @@ class RenderEngine;
class ScreenSpaceRenderable;
class SyncEngine;
class TimeManager;
class VersionChecker;
class VirtualPropertyManager;
struct WindowDelegate;
namespace configuration { struct Configuration; }
@@ -81,6 +82,7 @@ RenderEngine& gRenderEngine();
std::vector<std::unique_ptr<ScreenSpaceRenderable>>& gScreenspaceRenderables();
SyncEngine& gSyncEngine();
TimeManager& gTimeManager();
VersionChecker& gVersionChecker();
VirtualPropertyManager& gVirtualPropertyManager();
WindowDelegate& gWindowDelegate();
configuration::Configuration& gConfiguration();
@@ -112,6 +114,7 @@ static std::vector<std::unique_ptr<ScreenSpaceRenderable>>& screenSpaceRenderabl
detail::gScreenspaceRenderables();
static SyncEngine& syncEngine = detail::gSyncEngine();
static TimeManager& timeManager = detail::gTimeManager();
static VersionChecker& versionChecker = detail::gVersionChecker();
static VirtualPropertyManager& virtualPropertyManager = detail::gVirtualPropertyManager();
static WindowDelegate& windowDelegate = detail::gWindowDelegate();
static configuration::Configuration& configuration = detail::gConfiguration();
@@ -28,6 +28,7 @@
#include <openspace/properties/stringproperty.h>
#include <openspace/util/keys.h>
#include <openspace/util/mouse.h>
#include <openspace/util/versionchecker.h>
#include <ghoul/glm.h>
#include <memory>
#include <string>
@@ -109,6 +110,7 @@ private:
std::unique_ptr<Scene> _scene;
std::unique_ptr<AssetManager> _assetManager;
std::unique_ptr<LoadingScreen> _loadingScreen;
std::unique_ptr<VersionChecker> _versionChecker;
bool _hasScheduledAssetLoading = false;
std::string _scheduledAssetPathToLoad;
@@ -113,6 +113,10 @@ struct WindowDelegate {
int (*currentWindowId)() = []() { return 0; };
double (*getHorizFieldOfView)() = []() { return 0.0; };
void (*setHorizFieldOfView)(float hFovDeg) = [](float) { };
using GLProcAddress = void(*)(void);
GLProcAddress (*openGLProcedureAddress)(const char*) =
@@ -56,6 +56,8 @@ public:
glm::dvec2 localRollVelocity() const;
glm::dvec2 globalRollVelocity() const;
void resetVelocities();
protected:
struct InteractionState {
InteractionState(double scaleFactor);
@@ -54,6 +54,7 @@ public:
void updateStatesFromInput(const InputState& inputState, double deltaTime);
void updateCameraStateFromStates(double deltaTime);
void resetVelocities();
Camera* camera() const;
void setCamera(Camera* camera);
@@ -66,6 +67,7 @@ public:
void startRetargetAim();
float retargetInterpolationTime() const;
void setRetargetInterpolationTime(float durationInSeconds);
void resetNodeMovements();
JoystickCameraStates& joystickStates();
@@ -148,7 +150,6 @@ private:
glm::dquat _previousAnchorNodeRotation;
glm::dvec3 _previousAimNodePosition;
glm::dquat _previousAimNodeRotation;
double _currentCameraToSurfaceDistance = 0.0;
bool _directlySetStereoDistance = false;
@@ -43,10 +43,19 @@ class KeyframeNavigator;
class SessionRecording : public properties::PropertyOwner {
public:
enum class RecordedDataMode {
Ascii,
Ascii = 0,
Binary
};
enum class SessionState {
Idle = 0,
Recording,
Playback
};
using CallbackHandle = int;
using StateChangeCallback = std::function<void()>;
SessionRecording();
~SessionRecording();
/**
@@ -115,6 +124,12 @@ public:
*/
bool isPlayingBack() const;
/**
* Used to obtain the state of idle/recording/playback.
* \returns int value of state as defined by struct SessionState.
*/
SessionState state() const;
/**
* Used to trigger a save of the camera states (position, rotation, focus node,
* whether it is following the rotation of a node, and timestamp). The data will
@@ -141,12 +156,26 @@ public:
*/
static openspace::scripting::LuaLibrary luaLibrary();
/**
* Used to request a callback for notification of playback state change.
* \param cb function handle for callback.
* \returns CallbackHandle value of callback number.
*/
CallbackHandle addStateChangeCallback(StateChangeCallback cb);
/**
* Removes the callback for notification of playback state change.
* \param callback function handle for the callback.
*/
void removeStateChangeCallback(CallbackHandle handle);
/**
* Provides list of available playback files.
* \returns vector of filenames in recordings dir.
*/
std::vector<std::string> playbackList() const;
private:
enum class SessionState {
Idle = 0,
Recording,
Playback
};
enum class RecordedType {
Camera = 0,
Time,
@@ -175,20 +204,14 @@ private:
void playbackScript();
bool playbackAddEntriesToTimeline();
void signalPlaybackFinishedForComponent(RecordedType type);
void writeToFileBuffer(const double src);
void writeToFileBuffer(double src);
void writeToFileBuffer(std::vector<char>& cvec);
void writeToFileBuffer(const unsigned char c);
void writeToFileBuffer(unsigned char c);
void writeToFileBuffer(bool b);
void saveStringToFile(const std::string& s);
void saveKeyframeToFileBinary(unsigned char* bufferSource, size_t size);
void findFirstCameraKeyframeInTimeline();
std::string readHeaderElement(size_t readLen_chars);
void readFromPlayback(unsigned char& result);
void readFromPlayback(double& result);
void readFromPlayback(float& result);
void readFromPlayback(size_t& result);
void readFromPlayback(bool& result);
void readFromPlayback(std::string& result);
void saveKeyframeToFile(std::string entry);
void addKeyframe(double timestamp,
@@ -206,6 +229,7 @@ private:
bool isDataModeBinary();
unsigned int findIndexOfLastCameraKeyframeInTimeline();
bool doesTimelineEntryContainCamera(unsigned int index) const;
std::vector<std::pair<CallbackHandle, StateChangeCallback>> _stateChangeCallbacks;
RecordedType getNextKeyframeType();
RecordedType getPrevKeyframeType();
@@ -222,6 +246,7 @@ private:
RecordedDataMode _recordingDataMode = RecordedDataMode::Binary;
SessionState _state = SessionState::Idle;
SessionState _lastState = SessionState::Idle;
std::string _playbackFilename;
std::ifstream _playbackFile;
std::string _playbackLineParsing;
@@ -260,6 +285,8 @@ private:
unsigned int _idxTimeline_cameraFirstInTimeline = 0;
double _cameraFirstInTimeline_timestamp = 0;
int _nextCallbackHandle = 0;
};
} // namespace openspace
@@ -91,7 +91,8 @@ public:
void update() override;
void performRaycasterTasks(const std::vector<RaycasterTask>& tasks);
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks);
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks,
float blackoutFactor);
void render(Scene* scene, Camera* camera, float blackoutFactor) override;
/**
+2
View File
@@ -29,6 +29,7 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/stringproperty.h>
namespace ghoul { class Dictionary; }
namespace ghoul::opengl {
@@ -91,6 +92,7 @@ public:
protected:
properties::BoolProperty _enabled;
properties::FloatProperty _opacity;
properties::StringProperty _renderableType;
void registerUpdateRenderBinFromOpacity();
@@ -195,6 +195,7 @@ private:
properties::FloatProperty _hdrExposure;
properties::FloatProperty _hdrBackground;
properties::FloatProperty _gamma;
properties::FloatProperty _horizFieldOfView;
properties::Vec3Property _globalRotation;
properties::Vec3Property _screenSpaceRotation;
@@ -22,38 +22,37 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/properties/binaryproperty.h>
#ifndef __OPENSPACE_CORE___VERSIONCHECKER___H__
#define __OPENSPACE_CORE___VERSIONCHECKER___H__
#include <ghoul/lua/ghoul_lua.h>
#include <openspace/util/httprequest.h>
#include <memory>
#include <optional>
#include <string>
namespace openspace::properties {
namespace openspace {
REGISTER_TEMPLATEPROPERTY_SOURCE(
BinaryProperty,
std::vector<char>,
std::vector<char>(0),
[](lua_State* state, bool& success) -> std::vector<char> {
// TODO: Convert from lua
std::vector<char> result;
success = true;
return result;
},
[](lua_State* state, std::vector<char>) -> bool {
// TODO: Convert to lua
return true;
},
[](std::string value, bool& success) -> std::vector<char> {
// TODO: From json conversion
std::vector<char> result;
success = true;
return result;
},
[](std::string& outValue, std::vector<char> inValue) -> bool {
// TODO: To json conversion
outValue = "";
return true;
},
LUA_TTABLE
)
} // namespace openspace::properties
class VersionChecker {
public:
struct SemanticVersion {
int major;
int minor;
int patch;
};
void requestLatestVersion(const std::string& url);
bool hasLatestVersionInfo();
SemanticVersion latestVersion();
private:
std::unique_ptr<AsyncHttpMemoryDownload> _request;
std::optional<SemanticVersion> _latestVersion;
};
bool operator<(const VersionChecker::SemanticVersion a,
const VersionChecker::SemanticVersion b);
} // namespace openspace
#endif // __OPENSPACE_CORE___VERSIONCHECKER___H__
@@ -92,6 +92,8 @@ uniform dmat4 dSgctProjectionToModelTransformMatrix;
uniform dvec4 dCamPosObj;
uniform dvec3 sunDirectionObj;
uniform float blackoutFactor;
/*******************************************************************************
***** ALL CALCULATIONS FOR ECLIPSE ARE IN METERS AND IN WORLD SPACE SYSTEM ****
*******************************************************************************/
@@ -693,7 +695,7 @@ void main() {
}
renderTarget = atmosphereFinalColor / float(nSamples);
renderTarget.a *= blackoutFactor;
// if (complex)
// renderTarget = vec4(1.0, 0.0, 0.0, 1.0);
}
@@ -704,7 +706,7 @@ void main() {
bColor += texelFetch(mainColorTexture, fragCoords, f);
}
bColor /= float(nAaSamples);
renderTarget = vec4(HDR(bColor.xyz * backgroundConstant, atmExposure), bColor.a);
renderTarget = vec4(HDR(bColor.xyz * backgroundConstant, atmExposure), bColor.a * blackoutFactor);
}
else {
discard;
@@ -214,9 +214,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary)
_fontName = dictionary.value<std::string>(FontNameInfo.identifier);
}
if (dictionary.hasKey(FontSizeInfo.identifier)) {
_fontSize = static_cast<float>(
dictionary.value<double>(FontSizeInfo.identifier)
);
_fontSize = static_cast<float>(dictionary.value<double>(FontSizeInfo.identifier));
}
_fontName.onChange([this]() {
@@ -256,9 +254,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary)
}
addProperty(_source.type);
_source.nodeName.onChange([this]() {
_source.node = nullptr;
});
_source.nodeName.onChange([this]() { _source.node = nullptr; });
if (_source.type == Type::Node) {
if (dictionary.hasKey(SourceNodeNameInfo.identifier)) {
_source.nodeName = dictionary.value<std::string>(
@@ -297,9 +293,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary)
}
addProperty(_reference.type);
_reference.nodeName.onChange([this]() {
_reference.node = nullptr;
});
_reference.nodeName.onChange([this]() { _reference.node = nullptr; });
if (_reference.type == Type::Node) {
if (dictionary.hasKey(ReferenceNodeNameInfo.identifier)) {
_reference.nodeName = dictionary.value<std::string>(
+1 -3
View File
@@ -99,9 +99,7 @@ DashboardItemDate::DashboardItemDate(const ghoul::Dictionary& dictionary)
addProperty(_fontName);
if (dictionary.hasKey(FontSizeInfo.identifier)) {
_fontSize = static_cast<float>(
dictionary.value<double>(FontSizeInfo.identifier)
);
_fontSize = static_cast<float>(dictionary.value<double>(FontSizeInfo.identifier));
}
_fontSize.onChange([this](){
_font = global::fontManager.font(_fontName, _fontSize);
+98 -98
View File
@@ -118,9 +118,7 @@ DashboardItemMission::DashboardItemMission(const ghoul::Dictionary& dictionary)
addProperty(_fontName);
if (dictionary.hasKey(FontSizeInfo.identifier)) {
_fontSize = static_cast<float>(
dictionary.value<double>(FontSizeInfo.identifier)
);
_fontSize = static_cast<float>(dictionary.value<double>(FontSizeInfo.identifier));
}
_fontSize.onChange([this](){
_font = global::fontManager.font(_fontName, _fontSize);
@@ -131,114 +129,116 @@ DashboardItemMission::DashboardItemMission(const ghoul::Dictionary& dictionary)
}
void DashboardItemMission::render(glm::vec2& penPosition) {
if (global::missionManager.hasCurrentMission()) {
double currentTime = global::timeManager.time().j2000Seconds();
const Mission& mission = global::missionManager.currentMission();
if (!global::missionManager.hasCurrentMission()) {
return;
}
double currentTime = global::timeManager.time().j2000Seconds();
const Mission& mission = global::missionManager.currentMission();
if (!mission.phases().empty()) {
static const glm::vec4 nextMissionColor(0.7f, 0.3f, 0.3f, 1.f);
static const glm::vec4 currentMissionColor(0.f, 0.5f, 0.5f, 1.f);
static const glm::vec4 missionProgressColor = currentMissionColor;
static const glm::vec4 nonCurrentMissionColor(0.3f, 0.3f, 0.3f, 1.f);
if (mission.phases().empty()) {
return;
}
static const glm::vec4 nextMissionColor(0.7f, 0.3f, 0.3f, 1.f);
static const glm::vec4 currentMissionColor(0.f, 0.5f, 0.5f, 1.f);
static const glm::vec4 missionProgressColor = currentMissionColor;
static const glm::vec4 nonCurrentMissionColor(0.3f, 0.3f, 0.3f, 1.f);
// Add spacing
// Add spacing
RenderFont(
*_font,
penPosition,
" ",
nonCurrentMissionColor,
ghoul::fontrendering::CrDirection::Down
);
auto phaseTrace = mission.phaseTrace(currentTime);
if (!phaseTrace.empty()) {
const MissionPhase& phase = phaseTrace.back().get();
const std::string title = "Current Mission Phase: " + phase.name();
penPosition.y -= _font->height();
RenderFont(*_font, penPosition, title, missionProgressColor);
double remaining = phase.timeRange().end - currentTime;
float t = static_cast<float>(
1.0 - remaining / phase.timeRange().duration()
);
std::string progress = progressToStr(25, t);
penPosition.y -= _font->height();
RenderFont(
*_font,
penPosition,
fmt::format("{:.0f} s {:s} {:.1f} %", remaining, progress, t * 100),
missionProgressColor
);
}
else {
penPosition.y -= _font->height();
RenderFont(*_font, penPosition, "Next Mission:", nextMissionColor);
const double remaining = mission.timeRange().start - currentTime;
penPosition.y -= _font->height();
RenderFont(
*_font,
penPosition,
fmt::format("{:.0f} s", remaining),
nextMissionColor
);
}
bool showAllPhases = false;
using PhaseWithDepth = std::pair<const MissionPhase*, int>;
std::stack<PhaseWithDepth> S;
constexpr const int PixelIndentation = 20;
S.push({ &mission, 0 });
while (!S.empty()) {
const MissionPhase* phase = S.top().first;
const int depth = S.top().second;
S.pop();
const bool isCurrentPhase = phase->timeRange().includes(currentTime);
penPosition.x += depth * PixelIndentation;
if (isCurrentPhase) {
const double remaining = phase->timeRange().end - currentTime;
const float t = static_cast<float>(
1.0 - remaining / phase->timeRange().duration()
);
const std::string progress = progressToStr(25, t);
penPosition.y -= _font->height();
RenderFont(
*_font,
penPosition,
" ",
nonCurrentMissionColor,
ghoul::fontrendering::CrDirection::Down
fmt::format(
"{:s} {:s} {:.1f} %",
phase->name(),progress,t * 100
),
currentMissionColor
);
auto phaseTrace = mission.phaseTrace(currentTime);
if (!phaseTrace.empty()) {
const MissionPhase& phase = phaseTrace.back().get();
const std::string title = "Current Mission Phase: " + phase.name();
penPosition.y -= _font->height();
RenderFont(*_font, penPosition, title, missionProgressColor);
double remaining = phase.timeRange().end - currentTime;
float t = static_cast<float>(
1.0 - remaining / phase.timeRange().duration()
);
std::string progress = progressToStr(25, t);
}
else {
if (!phase->name().empty()) {
penPosition.y -= _font->height();
RenderFont(
*_font,
penPosition,
fmt::format("{:.0f} s {:s} {:.1f} %", remaining, progress, t * 100),
missionProgressColor
);
}
else {
penPosition.y -= _font->height();
RenderFont(*_font, penPosition, "Next Mission:", nextMissionColor);
const double remaining = mission.timeRange().start - currentTime;
penPosition.y -= _font->height();
RenderFont(
*_font,
penPosition,
fmt::format("{:.0f} s", remaining),
nextMissionColor
phase->name(),
nonCurrentMissionColor
);
}
}
penPosition.x -= depth * PixelIndentation;
bool showAllPhases = false;
using PhaseWithDepth = std::pair<const MissionPhase*, int>;
std::stack<PhaseWithDepth> S;
constexpr const int PixelIndentation = 20;
S.push({ &mission, 0 });
while (!S.empty()) {
const MissionPhase* phase = S.top().first;
const int depth = S.top().second;
S.pop();
const bool isCurrentPhase = phase->timeRange().includes(currentTime);
penPosition.x += depth * PixelIndentation;
if (isCurrentPhase) {
const double remaining = phase->timeRange().end - currentTime;
const float t = static_cast<float>(
1.0 - remaining / phase->timeRange().duration()
);
const std::string progress = progressToStr(25, t);
penPosition.y -= _font->height();
RenderFont(
*_font,
penPosition,
fmt::format(
"{:s} {:s} {:.1f} %",
phase->name(),progress,t * 100
),
currentMissionColor
);
}
else {
if (!phase->name().empty()) {
penPosition.y -= _font->height();
RenderFont(
*_font,
penPosition,
phase->name(),
nonCurrentMissionColor
);
}
}
penPosition.x -= depth * PixelIndentation;
if (isCurrentPhase || showAllPhases) {
// phases are sorted increasingly by start time, and will be
// popped last-in-first-out from the stack, so add them in
// reversed order.
int indexLastPhase = static_cast<int>(
phase->phases().size()
) - 1;
for (int i = indexLastPhase; 0 <= i; --i) {
S.push({ &phase->phases()[i], depth + 1 });
}
}
if (isCurrentPhase || showAllPhases) {
// phases are sorted increasingly by start time, and will be
// popped last-in-first-out from the stack, so add them in
// reversed order.
int indexLastPhase = static_cast<int>(
phase->phases().size()
) - 1;
for (int i = indexLastPhase; 0 <= i; --i) {
S.push({ &phase->phases()[i], depth + 1 });
}
}
}
@@ -103,9 +103,7 @@ DashboardItemParallelConnection::DashboardItemParallelConnection(
addProperty(_fontName);
if (dictionary.hasKey(FontSizeInfo.identifier)) {
_fontSize = static_cast<float>(
dictionary.value<double>(FontSizeInfo.identifier)
);
_fontSize = static_cast<float>(dictionary.value<double>(FontSizeInfo.identifier));
}
_fontSize.onChange([this](){
_font = global::fontManager.font(_fontName, _fontSize);
@@ -27,8 +27,8 @@
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
#include <openspace/engine/globals.h>
#include <openspace/util/timemanager.h>
#include <openspace/query/query.h>
#include <openspace/util/timemanager.h>
#include <ghoul/font/font.h>
#include <ghoul/font/fontmanager.h>
#include <ghoul/font/fontrenderer.h>
@@ -129,9 +129,7 @@ DashboardItemPropertyValue::DashboardItemPropertyValue(
addProperty(_fontName);
if (dictionary.hasKey(FontSizeInfo.identifier)) {
_fontSize = static_cast<float>(
dictionary.value<double>(FontSizeInfo.identifier)
);
_fontSize = static_cast<float>(dictionary.value<double>(FontSizeInfo.identifier));
}
_fontSize.onChange([this](){
_font = global::fontManager.font(_fontName, _fontSize);
@@ -141,9 +139,7 @@ DashboardItemPropertyValue::DashboardItemPropertyValue(
if (dictionary.hasKey(PropertyUriInfo.identifier)) {
_propertyUri = dictionary.value<std::string>(PropertyUriInfo.identifier);
}
_propertyUri.onChange([this]() {
_propertyIsDirty = true;
});
_propertyUri.onChange([this]() { _propertyIsDirty = true; });
addProperty(_propertyUri);
if (dictionary.hasKey(DisplayStringInfo.identifier)) {
@@ -165,11 +161,7 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) {
_property->getStringValue(value);
penPosition.y -= _font->height();
RenderFont(
*_font,
penPosition,
fmt::format(_displayString.value(), value)
);
RenderFont(*_font, penPosition, fmt::format(_displayString.value(), value));
}
}
@@ -59,8 +59,6 @@ private:
properties::StringProperty _propertyUri;
properties::StringProperty _displayString;
std::shared_ptr<ghoul::fontrendering::Font> _font;
};
@@ -152,12 +152,11 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
_doSimplification = dictionary.value<bool>(SimplificationInfo.identifier);
}
_doSimplification.onChange([this]() {
if (_doSimplification) {
_requestedUnit.setVisibility(properties::Property::Visibility::Hidden);
}
else {
_requestedUnit.setVisibility(properties::Property::Visibility::User);
}
_requestedUnit.setVisibility(
_doSimplification ?
properties::Property::Visibility::Hidden :
properties::Property::Visibility::User
);
});
addProperty(_doSimplification);
@@ -221,8 +220,7 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
penPosition,
fmt::format(
"Simulation increment: {:.1f} {:s} / second{:s}",
targetDeltaTime.first, targetDeltaTime.second,
pauseText
targetDeltaTime.first, targetDeltaTime.second, pauseText
)
);
}
@@ -42,6 +42,13 @@ namespace {
"This value specifies an image that is loaded from disk and is used as a texture "
"that is applied to this plane. This image has to be square."
};
constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = {
"RenderableType",
"RenderableType",
"This value specifies if the plane should be rendered in the Background,"
"Opaque, Transparent, or Overlay rendering step."
};
} // namespace
namespace openspace {
@@ -56,7 +63,13 @@ documentation::Documentation RenderablePlaneImageLocal::Documentation() {
TextureInfo.identifier,
new StringVerifier,
Optional::No,
TextureInfo.description,
TextureInfo.description
},
{
RenderableTypeInfo.identifier,
new StringVerifier,
Optional::Yes,
RenderableTypeInfo.description
}
}
};
@@ -80,6 +93,26 @@ RenderablePlaneImageLocal::RenderablePlaneImageLocal(const ghoul::Dictionary& di
_textureFile->setCallback(
[this](const ghoul::filesystem::File&) { _textureIsDirty = true; }
);
if (dictionary.hasKey(RenderableTypeInfo.identifier)) {
std::string renderType = dictionary.value<std::string>(
RenderableTypeInfo.identifier
);
if (renderType == "Background") {
setRenderBin(Renderable::RenderBin::Background);
} else if (renderType == "Opaque") {
setRenderBin(Renderable::RenderBin::Opaque);
}
else if (renderType == "Transparent") {
setRenderBin(Renderable::RenderBin::Transparent);
}
else if (renderType == "Overlay") {
setRenderBin(Renderable::RenderBin::Overlay);
}
}
else {
setRenderBin(Renderable::RenderBin::Opaque);
}
}
bool RenderablePlaneImageLocal::isReady() const {
@@ -111,6 +111,12 @@ namespace {
"Disable Fade-In/Fade-Out effects",
"Enables/Disables the Fade-In/Out effects."
};
constexpr openspace::properties::Property::PropertyInfo BackgroundInfo = {
"Background",
"Sets the current sphere rendering as a background rendering type",
"Enables/Disables background rendering."
};
} // namespace
namespace openspace {
@@ -175,6 +181,12 @@ documentation::Documentation RenderableSphere::Documentation() {
Optional::Yes,
DisableFadeInOutInfo.description
},
{
BackgroundInfo.identifier,
new BoolVerifier,
Optional::Yes,
BackgroundInfo.description
},
}
};
}
@@ -189,6 +201,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
, _mirrorTexture(MirrorTextureInfo, false)
, _useAdditiveBlending(UseAdditiveBlendingInfo, false)
, _disableFadeInDistance(DisableFadeInOutInfo, true)
, _backgroundRendering(BackgroundInfo, false)
, _fadeInThreshold(FadeInThresholdInfo, -1.f, 0.f, 1.f)
, _fadeOutThreshold(FadeOutThresholdInfo, -1.f, 0.f, 1.f)
{
@@ -249,6 +262,10 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
}
if (dictionary.hasKey(UseAdditiveBlendingInfo.identifier)) {
_useAdditiveBlending = dictionary.value<bool>(UseAdditiveBlendingInfo.identifier);
if (_useAdditiveBlending) {
setRenderBin(Renderable::RenderBin::Transparent);
}
}
if (dictionary.hasKey(FadeOutThresholdInfo.identifier)) {
@@ -270,6 +287,14 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
_disableFadeInDistance.set(false);
addProperty(_disableFadeInDistance);
}
if (dictionary.hasKey(BackgroundInfo.identifier)) {
_backgroundRendering = dictionary.value<bool>(BackgroundInfo.identifier);
if (_backgroundRendering) {
setRenderBin(Renderable::RenderBin::Background);
}
}
}
bool RenderableSphere::isReady() const {
@@ -72,6 +72,7 @@ private:
properties::BoolProperty _mirrorTexture;
properties::BoolProperty _useAdditiveBlending;
properties::BoolProperty _disableFadeInDistance;
properties::BoolProperty _backgroundRendering;
properties::FloatProperty _fadeInThreshold;
properties::FloatProperty _fadeOutThreshold;
@@ -243,8 +243,6 @@ void RenderableTrail::initializeGL() {
);
ghoul::opengl::updateUniformLocations(*_programObject, _uniformCache, UniformNames);
setRenderBin(Renderable::RenderBin::Overlay);
}
void RenderableTrail::deinitializeGL() {
@@ -97,6 +97,13 @@ namespace {
"smoother the trail, but also more memory will be used."
};
constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = {
"RenderableType",
"RenderableType",
"This value specifies if the plane should be rendered in the Background,"
"Opaque, Transparent, or Overlay rendering step."
};
} // namespace
namespace openspace {
@@ -118,6 +125,12 @@ documentation::Documentation RenderableTrailOrbit::Documentation() {
new IntVerifier,
Optional::No,
ResolutionInfo.description
},
{
RenderableTypeInfo.identifier,
new StringVerifier,
Optional::Yes,
RenderableTypeInfo.description
}
}
};
@@ -160,6 +173,27 @@ RenderableTrailOrbit::RenderableTrailOrbit(const ghoul::Dictionary& dictionary)
// We store the vertices with (excluding the wrapping) decending temporal order
_primaryRenderInformation.sorting = RenderInformation::VertexSorting::NewestFirst;
if (dictionary.hasKey(RenderableTypeInfo.identifier)) {
std::string renderType = dictionary.value<std::string>(
RenderableTypeInfo.identifier
);
if (renderType == "Background") {
setRenderBin(Renderable::RenderBin::Background);
}
else if (renderType == "Opaque") {
setRenderBin(Renderable::RenderBin::Opaque);
}
else if (renderType == "Transparent") {
setRenderBin(Renderable::RenderBin::Transparent);
}
else if (renderType == "Overlay") {
setRenderBin(Renderable::RenderBin::Overlay);
}
}
else {
setRenderBin(Renderable::RenderBin::Opaque);
}
}
void RenderableTrailOrbit::initializeGL() {
-1
View File
@@ -31,7 +31,6 @@
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/vector/vec3property.h>
#include <ghoul/glm.h>
namespace openspace {
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* Copyright (c) 2014-2019 *
* *
* 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 *
@@ -78,6 +78,9 @@ namespace {
constexpr int8_t CurrentCacheVersion = 1;
constexpr double PARSEC = 0.308567756E17;
constexpr const int RenderOptionViewDirection = 0;
constexpr const int RenderOptionPositionNormal = 1;
constexpr openspace::properties::Property::PropertyInfo SpriteTextureInfo = {
"Texture",
"Point Sprite Texture",
@@ -390,11 +393,11 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
, _spriteTexturePath(SpriteTextureInfo)
, _textColor(
TextColorInfo,
glm::vec4(1.0f, 1.0, 1.0f, 1.f),
glm::vec4(1.f, 1.f, 1.f, 1.f),
glm::vec4(0.f),
glm::vec4(1.f)
)
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
, _textMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f)
, _drawElements(DrawElementsInfo, true)
@@ -403,15 +406,15 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
, _fadeInDistance(
FadeInDistancesInfo,
glm::vec2(0.0f),
glm::vec2(0.0),
glm::vec2(100.0)
glm::vec2(0.f),
glm::vec2(0.f),
glm::vec2(100.f)
)
, _disableFadeInDistance(DisableFadeInInfo, true)
, _billboardMaxSize(BillboardMaxSizeInfo, 400.0, 0.0, 1000.0)
, _billboardMinSize(BillboardMinSizeInfo, 0.0, 0.0, 100.0)
, _correctionSizeEndDistance(CorrectionSizeEndDistanceInfo, 17.0, 12.0, 25.0)
, _correctionSizeFactor(CorrectionSizeFactorInfo, 8, 0.0, 20.0)
, _billboardMaxSize(BillboardMaxSizeInfo, 400.f, 0.f, 1000.f)
, _billboardMinSize(BillboardMinSizeInfo, 0.f, 0.f, 100.f)
, _correctionSizeEndDistance(CorrectionSizeEndDistanceInfo, 17.f, 12.f, 25.f)
, _correctionSizeFactor(CorrectionSizeFactorInfo, 8.f, 0.f, 20.f)
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
{
documentation::testSpecificationAndThrow(
@@ -427,18 +430,17 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
addProperty(_drawElements);
}
_renderOption.addOption(0, "Camera View Direction");
_renderOption.addOption(1, "Camera Position Normal");
_renderOption.addOption(RenderOptionViewDirection, "Camera View Direction");
_renderOption.addOption(RenderOptionPositionNormal, "Camera Position Normal");
_renderOption.set(1);
_renderOption = RenderOptionPositionNormal;
if (dictionary.hasKeyAndValue<std::string>(RenderOptionInfo.identifier)) {
const std::string option =
dictionary.value<std::string>(RenderOptionInfo.identifier);
const std::string o = dictionary.value<std::string>(RenderOptionInfo.identifier);
if (option == "Camera View Direction") {
_renderOption.set(0);
} else if (option == "Camera Position Normal") {
_renderOption.set(1);
if (o == "Camera View Direction") {
_renderOption = RenderOptionViewDirection;
} else if (o == "Camera Position Normal") {
_renderOption = RenderOptionPositionNormal;
}
}
@@ -499,11 +501,11 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
colorOptionDataDic.value<std::string>(std::to_string(i + 1))
);
_colorOption.addOption(i, colorMapInUseName);
_optionConversionMap.insert({i, colorMapInUseName});
_optionConversionMap.insert({ i, colorMapInUseName });
_colorOptionString = colorMapInUseName;
}
}
_colorOption.onChange([&] {
_colorOption.onChange([&]() {
_dataIsDirty = true;
_colorOptionString = _optionConversionMap[_colorOption.value()];
});
@@ -548,9 +550,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
}
addProperty(_drawLabels);
_labelFile = absPath(dictionary.value<std::string>(
LabelFileInfo.identifier
));
_labelFile = absPath(dictionary.value<std::string>(LabelFileInfo.identifier));
_hasLabel = true;
if (dictionary.hasKey(TextColorInfo.identifier)) {
@@ -581,15 +581,13 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
if (dictionary.hasKey(TransformationMatrixInfo.identifier)) {
_transformationMatrix = dictionary.value<glm::dmat4>(
TransformationMatrixInfo.identifier
);
);
}
if (dictionary.hasKey(FadeInDistancesInfo.identifier)) {
glm::vec2 fadeInValue = dictionary.value<glm::vec2>(
FadeInDistancesInfo.identifier
);
_fadeInDistance.set(fadeInValue);
_disableFadeInDistance.set(false);
glm::vec2 v = dictionary.value<glm::vec2>(FadeInDistancesInfo.identifier);
_fadeInDistance = v;
_disableFadeInDistance = false;
addProperty(_fadeInDistance);
addProperty(_disableFadeInDistance);
}
@@ -597,28 +595,28 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
if (dictionary.hasKey(BillboardMaxSizeInfo.identifier)) {
_billboardMaxSize = static_cast<float>(
dictionary.value<double>(BillboardMaxSizeInfo.identifier)
);
);
}
addProperty(_billboardMaxSize);
if (dictionary.hasKey(BillboardMinSizeInfo.identifier)) {
_billboardMinSize = static_cast<float>(
dictionary.value<double>(BillboardMinSizeInfo.identifier)
);
);
}
addProperty(_billboardMinSize);
if (dictionary.hasKey(CorrectionSizeEndDistanceInfo.identifier)) {
_correctionSizeEndDistance = static_cast<float>(
dictionary.value<double>(CorrectionSizeEndDistanceInfo.identifier)
);
);
}
addProperty(_correctionSizeEndDistance);
if (dictionary.hasKey(CorrectionSizeFactorInfo.identifier)) {
_correctionSizeFactor = static_cast<float>(
dictionary.value<double>(CorrectionSizeFactorInfo.identifier)
);
);
}
addProperty(_correctionSizeFactor);
@@ -643,12 +641,14 @@ void RenderableBillboardsCloud::initialize() {
// entry is the one selected by default.
_colorOption.setValue(static_cast<int>(_colorRangeData.size() - 1));
}
setRenderBin(Renderable::RenderBin::Transparent);
}
void RenderableBillboardsCloud::initializeGL() {
_program = DigitalUniverseModule::ProgramObjectManager.request(
ProgramObjectName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
[]() {
return global::renderEngine.buildRenderProgram(
ProgramObjectName,
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboard_vs.glsl"),
@@ -660,7 +660,7 @@ void RenderableBillboardsCloud::initializeGL() {
_renderToPolygonProgram = DigitalUniverseModule::ProgramObjectManager.request(
RenderToPolygonProgram,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
[]() {
return ghoul::opengl::ProgramObject::Build(
RenderToPolygonProgram,
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_vs.glsl"),
@@ -722,6 +722,7 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
float fadeInVariable)
{
glDepthMask(false);
glEnable(GL_DEPTH_TEST);
// Saving current OpenGL state
GLboolean blendEnabled = glIsEnabledi(GL_BLEND, 0);
@@ -746,8 +747,7 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
glEnablei(GL_BLEND, 0);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
_program->activate();
const glm::dmat4 projMatrix = glm::dmat4(data.camera.projectionMatrix());
@@ -763,8 +763,10 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
);
_program->setUniform(_uniformCache.renderOption, _renderOption.value());
_program->setUniform(_uniformCache.modelMatrix, modelMatrix);
_program->setUniform(_uniformCache.cameraViewProjectionMatrix,
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix());
_program->setUniform(
_uniformCache.cameraViewProjectionMatrix,
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix()
);
_program->setUniform(_uniformCache.minBillboardSize, _billboardMinSize); // in pixels
_program->setUniform(_uniformCache.maxBillboardSize, _billboardMaxSize); // in pixels
_program->setUniform(_uniformCache.color, _pointColor);
@@ -790,15 +792,17 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
textureUnit.activate();
if (_hasPolygon) {
glBindTexture(GL_TEXTURE_2D, _pTexture);
} else {
}
else {
_spriteTexture->bind();
}
_program->setUniform(_uniformCache.spriteTexture, textureUnit);
_program->setUniform(_uniformCache.hasColormap, _hasColorMapFile);
glBindVertexArray(_vao);
const GLsizei nAstronomicalObjects = static_cast<GLsizei>(_fullData.size() /
_nValuesPerAstronomicalObject);
const GLsizei nAstronomicalObjects = static_cast<GLsizei>(
_fullData.size() / _nValuesPerAstronomicalObject
);
glDrawArrays(GL_POINTS, 0, nAstronomicalObjects);
glBindVertexArray(0);
@@ -825,10 +829,10 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data,
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.0;
scale = 1.f;
break;
case Kilometer:
scale = 1e3;
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
@@ -850,6 +854,20 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data,
glm::vec4 textColor = _textColor;
textColor.a *= fadeInVariable;
textColor.a *= _opacity;
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
labelInfo.minSize = static_cast<int>(_textMinSize);
labelInfo.maxSize = static_cast<int>(_textMaxSize);
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
labelInfo.mvpMatrix = modelViewProjectionMatrix;
labelInfo.scale = pow(10.f, _textSize);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
glm::vec3 scaledPos(pair.first);
@@ -859,28 +877,19 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data,
scaledPos,
pair.second,
textColor,
pow(10.f, _textSize.value()),
static_cast<int>(_textMinSize),
static_cast<int>(_textMaxSize),
modelViewProjectionMatrix,
orthoRight,
orthoUp,
data.camera.positionVec3(),
data.camera.lookUpVectorWorldSpace(),
_renderOption.value()
labelInfo
);
}
}
void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.0;
scale = 1.f;
break;
case Kilometer:
scale = 1e3;
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
@@ -936,9 +945,7 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
);
orthoRight = glm::normalize(glm::cross(otherVector, cameraViewDirectionWorld));
}
glm::dvec3 orthoUp = glm::normalize(
glm::cross(cameraViewDirectionWorld, orthoRight)
);
glm::dvec3 orthoUp = glm::normalize(glm::cross(cameraViewDirectionWorld, orthoRight));
if (_hasSpeckFile) {
renderBillboards(
@@ -1043,10 +1050,7 @@ void RenderableBillboardsCloud::update(const UpdateData&) {
[path = _spriteTexturePath]() -> std::unique_ptr<ghoul::opengl::Texture> {
LINFO(fmt::format("Loaded texture from '{}'", absPath(path)));
std::unique_ptr<ghoul::opengl::Texture> t =
ghoul::io::TextureReader::ref().loadTexture(
absPath(path)
);
ghoul::io::TextureReader::ref().loadTexture(absPath(path));
t->uploadTexture();
t->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap);
return t;
@@ -1076,79 +1080,81 @@ bool RenderableBillboardsCloud::loadData() {
}
bool RenderableBillboardsCloud::loadSpeckData() {
if (!_hasSpeckFile) {
return true;
}
bool success = true;
if (_hasSpeckFile) {
const std::string& cachedFile = FileSys.cacheManager()->cachedFilename(
ghoul::filesystem::File(_speckFile),
"RenderableDUMeshes|" + identifier(),
ghoul::filesystem::CacheManager::Persistent::Yes
);
const std::string& cachedFile = FileSys.cacheManager()->cachedFilename(
ghoul::filesystem::File(_speckFile),
"RenderableDUMeshes|" + identifier(),
ghoul::filesystem::CacheManager::Persistent::Yes
);
const bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format(
"Cached file '{}' used for Speck file '{}'",
cachedFile, _speckFile
));
const bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format(
"Cached file '{}' used for Speck file '{}'",
cachedFile, _speckFile
));
success = loadCachedFile(cachedFile);
if (success) {
return true;
}
else {
FileSys.cacheManager()->removeCacheFile(_speckFile);
// Intentional fall-through to the 'else' to generate the cache
// file for the next run
}
success = loadCachedFile(cachedFile);
if (success) {
return true;
}
else {
LINFO(fmt::format("Cache for Speck file '{}' not found", _speckFile));
FileSys.cacheManager()->removeCacheFile(_speckFile);
// Intentional fall-through to the 'else' to generate the cache
// file for the next run
}
LINFO(fmt::format("Loading Speck file '{}'", _speckFile));
success = readSpeckFile();
if (!success) {
return false;
}
success &= saveCachedFile(cachedFile);
}
else {
LINFO(fmt::format("Cache for Speck file '{}' not found", _speckFile));
}
LINFO(fmt::format("Loading Speck file '{}'", _speckFile));
success = readSpeckFile();
if (!success) {
return false;
}
success &= saveCachedFile(cachedFile);
return success;
}
bool RenderableBillboardsCloud::loadLabelData() {
if (_labelFile.empty()) {
return true;
}
bool success = true;
if (!_labelFile.empty()) {
// I disabled the cache as it didn't work on Mac --- abock
const std::string& cachedFile = FileSys.cacheManager()->cachedFilename(
ghoul::filesystem::File(_labelFile),
ghoul::filesystem::CacheManager::Persistent::Yes
);
if (!_hasSpeckFile && !_hasColorMapFile) {
success = true;
}
const bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format(
"Cached file '{}' used for Label file '{}'",
cachedFile, _labelFile
));
// I disabled the cache as it didn't work on Mac --- abock
const std::string& cachedFile = FileSys.cacheManager()->cachedFilename(
ghoul::filesystem::File(_labelFile),
ghoul::filesystem::CacheManager::Persistent::Yes
);
if (!_hasSpeckFile && !_hasColorMapFile) {
success = true;
}
const bool hasCachedFile = FileSys.fileExists(cachedFile);
if (hasCachedFile) {
LINFO(fmt::format(
"Cached file '{}' used for Label file '{}'",
cachedFile, _labelFile
));
success &= loadCachedFile(cachedFile);
if (!success) {
FileSys.cacheManager()->removeCacheFile(_labelFile);
// Intentional fall-through to the 'else' to generate the cache
// file for the next run
}
success &= loadCachedFile(cachedFile);
if (!success) {
FileSys.cacheManager()->removeCacheFile(_labelFile);
// Intentional fall-through to the 'else' to generate the cache
// file for the next run
}
else {
LINFO(fmt::format("Cache for Label file '{}' not found", _labelFile));
LINFO(fmt::format("Loading Label file '{}'", _labelFile));
}
else {
LINFO(fmt::format("Cache for Label file '{}' not found", _labelFile));
LINFO(fmt::format("Loading Label file '{}'", _labelFile));
success &= readLabelFile();
if (!success) {
return false;
}
success &= readLabelFile();
if (!success) {
return false;
}
}
@@ -1387,102 +1393,94 @@ bool RenderableBillboardsCloud::readLabelFile() {
bool RenderableBillboardsCloud::loadCachedFile(const std::string& file) {
std::ifstream fileStream(file, std::ifstream::binary);
if (fileStream.good()) {
int8_t version = 0;
fileStream.read(reinterpret_cast<char*>(&version), sizeof(int8_t));
if (version != CurrentCacheVersion) {
LINFO("The format of the cached file has changed: deleting old cache");
fileStream.close();
FileSys.deleteFile(file);
return false;
}
int32_t nValues = 0;
fileStream.read(reinterpret_cast<char*>(&nValues), sizeof(int32_t));
fileStream.read(
reinterpret_cast<char*>(&_nValuesPerAstronomicalObject),
sizeof(int32_t)
);
_fullData.resize(nValues);
fileStream.read(reinterpret_cast<char*>(&_fullData[0]),
nValues * sizeof(_fullData[0]));
if (_hasColorMapFile) {
int32_t nItems = 0;
fileStream.read(reinterpret_cast<char*>(&nItems), sizeof(int32_t));
for (int i = 0; i < nItems; ++i) {
int32_t keySize = 0;
fileStream.read(reinterpret_cast<char*>(&keySize), sizeof(int32_t));
std::vector<char> buffer(keySize);
fileStream.read(buffer.data(), keySize);
std::string key(buffer.begin(), buffer.end());
int32_t value = 0;
fileStream.read(reinterpret_cast<char*>(&value), sizeof(int32_t));
_variableDataPositionMap.insert({ key, value });
}
}
bool success = fileStream.good();
return success;
}
else {
if (!fileStream.good()) {
LERROR(fmt::format("Error opening file '{}' for loading cache file", file));
return false;
}
int8_t version = 0;
fileStream.read(reinterpret_cast<char*>(&version), sizeof(int8_t));
if (version != CurrentCacheVersion) {
LINFO("The format of the cached file has changed: deleting old cache");
fileStream.close();
FileSys.deleteFile(file);
return false;
}
int32_t nValues = 0;
fileStream.read(reinterpret_cast<char*>(&nValues), sizeof(int32_t));
fileStream.read(
reinterpret_cast<char*>(&_nValuesPerAstronomicalObject),
sizeof(int32_t)
);
_fullData.resize(nValues);
fileStream.read(
reinterpret_cast<char*>(&_fullData[0]),
nValues * sizeof(_fullData[0])
);
if (_hasColorMapFile) {
int32_t nItems = 0;
fileStream.read(reinterpret_cast<char*>(&nItems), sizeof(int32_t));
for (int i = 0; i < nItems; ++i) {
int32_t keySize = 0;
fileStream.read(reinterpret_cast<char*>(&keySize), sizeof(int32_t));
std::vector<char> buffer(keySize);
fileStream.read(buffer.data(), keySize);
std::string key(buffer.begin(), buffer.end());
int32_t value = 0;
fileStream.read(reinterpret_cast<char*>(&value), sizeof(int32_t));
_variableDataPositionMap.insert({ key, value });
}
}
bool success = fileStream.good();
return success;
}
bool RenderableBillboardsCloud::saveCachedFile(const std::string& file) const {
std::ofstream fileStream(file, std::ofstream::binary);
if (fileStream.good()) {
fileStream.write(reinterpret_cast<const char*>(&CurrentCacheVersion),
sizeof(int8_t));
int32_t nValues = static_cast<int32_t>(_fullData.size());
if (nValues == 0) {
LERROR("Error writing cache: No values were loaded");
return false;
}
fileStream.write(reinterpret_cast<const char*>(&nValues), sizeof(int32_t));
int32_t nValuesPerAstronomicalObject = static_cast<int32_t>(
_nValuesPerAstronomicalObject
);
fileStream.write(
reinterpret_cast<const char*>(&nValuesPerAstronomicalObject),
sizeof(int32_t)
);
size_t nBytes = nValues * sizeof(_fullData[0]);
fileStream.write(reinterpret_cast<const char*>(&_fullData[0]), nBytes);
if (_hasColorMapFile) {
int32_t nItems = static_cast<int32_t>(_variableDataPositionMap.size());
fileStream.write(reinterpret_cast<const char*>(&nItems), sizeof(int32_t));
for (const std::pair<const std::string, int>& pair :
_variableDataPositionMap)
{
int32_t keySize = static_cast<int32_t>(pair.first.size());
fileStream.write(
reinterpret_cast<const char*>(&keySize),
sizeof(int32_t)
);
fileStream.write(pair.first.data(), keySize);
int32_t value = static_cast<int32_t>(pair.second);
fileStream.write(reinterpret_cast<const char*>(&value), sizeof(int32_t));
}
}
return fileStream.good();
}
else {
if (!fileStream.good()) {
LERROR(fmt::format("Error opening file '{}' for save cache file", file));
return false;
}
fileStream.write(reinterpret_cast<const char*>(&CurrentCacheVersion), sizeof(int8_t));
int32_t nValues = static_cast<int32_t>(_fullData.size());
if (nValues == 0) {
LERROR("Error writing cache: No values were loaded");
return false;
}
fileStream.write(reinterpret_cast<const char*>(&nValues), sizeof(int32_t));
int32_t nValuesPerAstronomicalObject = static_cast<int32_t>(
_nValuesPerAstronomicalObject
);
fileStream.write(
reinterpret_cast<const char*>(&nValuesPerAstronomicalObject),
sizeof(int32_t)
);
size_t nBytes = nValues * sizeof(_fullData[0]);
fileStream.write(reinterpret_cast<const char*>(&_fullData[0]), nBytes);
if (_hasColorMapFile) {
int32_t nItems = static_cast<int32_t>(_variableDataPositionMap.size());
fileStream.write(reinterpret_cast<const char*>(&nItems), sizeof(int32_t));
for (const std::pair<const std::string, int>& pair : _variableDataPositionMap) {
int32_t keySize = static_cast<int32_t>(pair.first.size());
fileStream.write(reinterpret_cast<const char*>(&keySize), sizeof(int32_t));
fileStream.write(pair.first.data(), keySize);
int32_t value = static_cast<int32_t>(pair.second);
fileStream.write(reinterpret_cast<const char*>(&value), sizeof(int32_t));
}
}
return fileStream.good();
}
void RenderableBillboardsCloud::createDataSlice() {
@@ -1501,7 +1499,7 @@ void RenderableBillboardsCloud::createDataSlice() {
colorMapInUse = _variableDataPositionMap[_colorOptionString];
glm::vec2 currentColorRange = _colorRangeData[_colorOption.value()];
float colorMapBinSize = (currentColorRange.y - currentColorRange.x) /
static_cast<float>(_colorMapData.size());
static_cast<float>(_colorMapData.size());
float bin = colorMapBinSize;
for (size_t i = 0; i < _colorMapData.size(); ++i) {
colorBins.push_back(bin);
@@ -1520,7 +1518,7 @@ void RenderableBillboardsCloud::createDataSlice() {
glm::vec4 position(glm::vec3(transformedPos), static_cast<float>(_unit));
if (_hasColorMapFile) {
for (auto j = 0; j < 4; ++j) {
for (int j = 0; j < 4; ++j) {
_slicedData.push_back(position[j]);
biggestCoord = biggestCoord < position[j] ? position[j] : biggestCoord;
}
@@ -1537,17 +1535,14 @@ void RenderableBillboardsCloud::createDataSlice() {
}
}
int colorIndex =
c == static_cast<int>(colorBins.size() - 1) ?
0 :
c + 1;
int colorIndex = c == static_cast<int>(colorBins.size() - 1) ? 0 : c + 1;
for (auto j = 0; j < 4; ++j) {
for (int j = 0; j < 4; ++j) {
_slicedData.push_back(_colorMapData[colorIndex][j]);
}
}
else {
for (auto j = 0; j < 4; ++j) {
for (int j = 0; j < 4; ++j) {
_slicedData.push_back(position[j]);
}
}
@@ -1566,8 +1561,7 @@ void RenderableBillboardsCloud::createPolygonTexture() {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Stopped using a buffer object for GL_PIXEL_UNPACK_BUFFER
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 256,
256, 0, GL_RGBA, GL_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 256, 256, 0, GL_RGBA, GL_BYTE, nullptr);
renderToTexture(_pTexture, 256, 256);
}
@@ -1613,7 +1607,7 @@ void RenderableBillboardsCloud::loadPolygonGeometryForRendering() {
const GLfloat vertex_data[] = {
// x y z w
0.0f, 0.0f, 0.0f, 1.0f,
0.f, 0.f, 0.f, 1.f,
};
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
@@ -1631,14 +1625,15 @@ void RenderableBillboardsCloud::loadPolygonGeometryForRendering() {
void RenderableBillboardsCloud::renderPolygonGeometry(GLuint vao) {
std::unique_ptr<ghoul::opengl::ProgramObject> program =
ghoul::opengl::ProgramObject::Build("RenderableBillboardsCloud_Polygon",
ghoul::opengl::ProgramObject::Build(
"RenderableBillboardsCloud_Polygon",
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_vs.glsl"),
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_fs.glsl"),
absPath("${MODULE_DIGITALUNIVERSE}/shaders/billboardpolygon_gs.glsl")
);
program->activate();
static const float black[] = { 0.0f, 0.0f, 0.0f, 0.0f };
static const float black[] = { 0.f, 0.f, 0.f, 0.f };
glClearBufferfv(GL_COLOR, 0, black);
program->setUniform("sides", _polygonSides);
@@ -64,6 +64,9 @@ namespace {
constexpr const char* GigaparsecUnit = "Gpc";
constexpr const char* GigalightyearUnit = "Gly";
constexpr const int RenderOptionViewDirection = 0;
constexpr const int RenderOptionPositionNormal = 1;
constexpr const int8_t CurrentCacheVersion = 1;
constexpr const double PARSEC = 0.308567756E17;
@@ -252,11 +255,11 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
glm::vec4(0.f),
glm::vec4(1.f)
)
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
, _drawElements(DrawElementsInfo, true)
, _drawLabels(DrawLabelInfo, false)
, _textMinSize(LabelMinSizeInfo, 8.0, 0.5, 24.0)
, _textMaxSize(LabelMaxSizeInfo, 500.0, 0.0, 1000.0)
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
, _textMaxSize(LabelMaxSizeInfo, 500.f, 0.f, 1000.f)
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
{
documentation::testSpecificationAndThrow(
@@ -272,13 +275,13 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(_drawElements);
}
_renderOption.addOption(0, "Camera View Direction");
_renderOption.addOption(1, "Camera Position Normal");
_renderOption.addOption(RenderOptionViewDirection, "Camera View Direction");
_renderOption.addOption(RenderOptionPositionNormal, "Camera Position Normal");
if (global::windowDelegate.isFisheyeRendering()) {
_renderOption.set(1);
_renderOption = RenderOptionPositionNormal;
}
else {
_renderOption.set(0);
_renderOption = RenderOptionViewDirection;
}
addProperty(_renderOption);
@@ -336,9 +339,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(_drawLabels);
if (dictionary.hasKey(LabelFileInfo.identifier)) {
_labelFile = absPath(dictionary.value<std::string>(
LabelFileInfo.identifier
));
_labelFile = absPath(dictionary.value<std::string>(LabelFileInfo.identifier));
_hasLabel = true;
if (dictionary.hasKey(TextColorInfo.identifier)) {
@@ -356,16 +357,12 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
addProperty(_textSize);
if (dictionary.hasKey(LabelMinSizeInfo.identifier)) {
_textMinSize = floor(
dictionary.value<float>(LabelMinSizeInfo.identifier)
);
_textMinSize = floor(dictionary.value<float>(LabelMinSizeInfo.identifier));
}
addProperty(_textMinSize);
if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) {
_textMaxSize = floor(
dictionary.value<float>(LabelMaxSizeInfo.identifier)
);
_textMaxSize = floor(dictionary.value<float>(LabelMaxSizeInfo.identifier));
}
addProperty(_textMaxSize);
}
@@ -381,23 +378,24 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
MeshColorInfo.identifier
);
for (int i = 0; i < static_cast<int>(colorDict.size()); ++i) {
_meshColorMap.insert({ i + 1,
colorDict.value<glm::vec3>(std::to_string(i + 1)) }
_meshColorMap.insert(
{ i + 1, colorDict.value<glm::vec3>(std::to_string(i + 1)) }
);
}
}
setRenderBin(Renderable::RenderBin::Opaque);
}
bool RenderableDUMeshes::isReady() const {
return (_program != nullptr) &&
(!_renderingMeshesMap.empty() || (!_labelData.empty()));
(!_renderingMeshesMap.empty() || (!_labelData.empty()));
}
void RenderableDUMeshes::initializeGL() {
_program = DigitalUniverseModule::ProgramObjectManager.request(
ProgramObjectName,
[]() -> std::unique_ptr<ghoul::opengl::ProgramObject> {
[]() {
return global::renderEngine.buildRenderProgram(
"RenderableDUMeshes",
absPath("${MODULE_DIGITALUNIVERSE}/shaders/dumesh_vs.glsl"),
@@ -473,9 +471,10 @@ void RenderableDUMeshes::renderMeshes(const RenderData&,
glGetIntegerv(GL_BLEND_SRC_RGB, &blendSrcRGB);
glEnablei(GL_BLEND, 0);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(false);
glEnable(GL_DEPTH_TEST);
_program->activate();
@@ -527,10 +526,10 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.0;
scale = 1.f;
break;
case Kilometer:
scale = 1e3;
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
@@ -549,6 +548,19 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
break;
}
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
labelInfo.minSize = static_cast<int>(_textMinSize);
labelInfo.maxSize = static_cast<int>(_textMaxSize);
labelInfo.cameraPos = data.camera.positionVec3();
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
labelInfo.renderType = _renderOption;
labelInfo.mvpMatrix = modelViewProjectionMatrix;
labelInfo.scale = pow(10.f, _textSize);
labelInfo.enableDepth = true;
labelInfo.enableFalseDepth = false;
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
glm::vec3 scaledPos(pair.first);
@@ -558,15 +570,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
scaledPos,
pair.second,
_textColor,
pow(10.f, _textSize.value()),
static_cast<int>(_textMinSize),
static_cast<int>(_textMaxSize),
modelViewProjectionMatrix,
orthoRight,
orthoUp,
data.camera.positionVec3(),
data.camera.lookUpVectorWorldSpace(),
_renderOption.value()
labelInfo
);
}
}
@@ -596,18 +600,17 @@ void RenderableDUMeshes::render(const RenderData& data, RendererTasks&) {
right = glm::cross(viewDirection, otherVector);
orthoRight = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(right, 0.0))
);
);
}
const glm::vec3 orthoUp = glm::normalize(
glm::vec3(worldToModelTransform * glm::vec4(up, 0.0))
);
if (_hasSpeckFile) {
renderMeshes(data, modelViewMatrix, projectionMatrix);
}
if (_drawLabels && _hasLabel) {
const glm::vec3 orthoUp = glm::normalize(
glm::vec3(worldToModelTransform * glm::dvec4(up, 0.0))
);
renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp);
}
}
@@ -645,16 +648,12 @@ bool RenderableDUMeshes::loadData() {
// else
// {
// LINFO("Cache for Speck file '" << _speckFile << "' not found");
LINFO(fmt::format("Loading Speck file '{}'", _speckFile));
LINFO(fmt::format("Loading Speck file '{}'", _speckFile));
success = readSpeckFile();
if (!success) {
return false;
}
// LINFO("Saving cache");
//success &= saveCachedFile(cachedFile);
// }
success = readSpeckFile();
if (!success) {
return false;
}
}
std::string labelFile = _labelFile;
@@ -680,12 +679,12 @@ bool RenderableDUMeshes::loadData() {
// }
// else {
// LINFO("Cache for Label file '" << labelFile << "' not found");
LINFO(fmt::format("Loading Label file '{}'", labelFile));
LINFO(fmt::format("Loading Label file '{}'", labelFile));
success &= readLabelFile();
if (!success) {
return false;
}
success &= readLabelFile();
if (!success) {
return false;
}
// }
}
@@ -717,7 +716,7 @@ bool RenderableDUMeshes::readSpeckFile() {
// Guard against wrong line endings (copying files from Windows to Mac) causes
// lines to have a final \r
if (!line.empty() && line.back() == '\r') {
line = line.substr(0, line.length() -1);
line = line.substr(0, line.length() - 1);
}
if (line.empty() || line[0] == '#') {
@@ -834,7 +833,7 @@ bool RenderableDUMeshes::readLabelFile() {
// Guard against wrong line endings (copying files from Windows to Mac) causes
// lines to have a final \r
if (!line.empty() && line.back() == '\r') {
line = line.substr(0, line.length() -1);
line = line.substr(0, line.length() - 1);
}
@@ -860,7 +859,6 @@ bool RenderableDUMeshes::readLabelFile() {
}
}
do {
std::vector<float> values(_nValuesPerAstronomicalObject);
@@ -869,7 +867,7 @@ bool RenderableDUMeshes::readLabelFile() {
// Guard against wrong line endings (copying files from Windows to Mac) causes
// lines to have a final \r
if (!line.empty() && line.back() == '\r') {
line = line.substr(0, line.length() -1);
line = line.substr(0, line.length() - 1);
}
if (line.empty()) {
@@ -907,115 +905,174 @@ bool RenderableDUMeshes::readLabelFile() {
bool RenderableDUMeshes::loadCachedFile(const std::string& file) {
std::ifstream fileStream(file, std::ifstream::binary);
if (fileStream.good()) {
int8_t version = 0;
fileStream.read(reinterpret_cast<char*>(&version), sizeof(int8_t));
if (version != CurrentCacheVersion) {
LINFO("The format of the cached file has changed: deleting old cache");
fileStream.close();
FileSys.deleteFile(file);
return false;
}
int32_t nValues = 0;
fileStream.read(reinterpret_cast<char*>(&nValues), sizeof(int32_t));
fileStream.read(
reinterpret_cast<char*>(&_nValuesPerAstronomicalObject),
sizeof(int32_t)
);
_fullData.resize(nValues);
fileStream.read(reinterpret_cast<char*>(&_fullData[0]),
nValues * sizeof(_fullData[0]));
bool success = fileStream.good();
return success;
}
else {
if (!fileStream.good()) {
LERROR(fmt::format("Error opening file '{}' for loading cache file", file));
return false;
}
int8_t version = 0;
fileStream.read(reinterpret_cast<char*>(&version), sizeof(int8_t));
if (version != CurrentCacheVersion) {
LINFO("The format of the cached file has changed: deleting old cache");
fileStream.close();
FileSys.deleteFile(file);
return false;
}
int32_t nValues = 0;
fileStream.read(reinterpret_cast<char*>(&nValues), sizeof(int32_t));
fileStream.read(
reinterpret_cast<char*>(&_nValuesPerAstronomicalObject),
sizeof(int32_t)
);
_fullData.resize(nValues);
fileStream.read(
reinterpret_cast<char*>(&_fullData[0]),
nValues * sizeof(_fullData[0])
);
bool success = fileStream.good();
return success;
}
bool RenderableDUMeshes::saveCachedFile(const std::string& file) const {
std::ofstream fileStream(file, std::ofstream::binary);
if (fileStream.good()) {
fileStream.write(reinterpret_cast<const char*>(&CurrentCacheVersion),
sizeof(int8_t));
const int32_t nValues = static_cast<int32_t>(_fullData.size());
if (nValues == 0) {
LERROR("Error writing cache: No values were loaded");
return false;
}
fileStream.write(reinterpret_cast<const char*>(&nValues), sizeof(int32_t));
const int32_t nValuesPerAstronomicalObject = static_cast<int32_t>(
_nValuesPerAstronomicalObject
);
fileStream.write(
reinterpret_cast<const char*>(&nValuesPerAstronomicalObject),
sizeof(int32_t)
);
const size_t nBytes = nValues * sizeof(_fullData[0]);
fileStream.write(reinterpret_cast<const char*>(&_fullData[0]), nBytes);
const bool success = fileStream.good();
return success;
}
else {
if (!fileStream.good()) {
LERROR(fmt::format("Error opening file '{}' for save cache file", file));
return false;
}
fileStream.write(
reinterpret_cast<const char*>(&CurrentCacheVersion),
sizeof(int8_t)
);
const int32_t nValues = static_cast<int32_t>(_fullData.size());
if (nValues == 0) {
LERROR("Error writing cache: No values were loaded");
return false;
}
fileStream.write(reinterpret_cast<const char*>(&nValues), sizeof(int32_t));
const int32_t nValuesPerAstronomicalObject = static_cast<int32_t>(
_nValuesPerAstronomicalObject
);
fileStream.write(
reinterpret_cast<const char*>(&nValuesPerAstronomicalObject),
sizeof(int32_t)
);
const size_t nBytes = nValues * sizeof(_fullData[0]);
fileStream.write(reinterpret_cast<const char*>(&_fullData[0]), nBytes);
const bool success = fileStream.good();
return success;
}
void RenderableDUMeshes::createMeshes() {
if (_dataIsDirty && _hasSpeckFile) {
LDEBUG("Creating planes");
if (!(_dataIsDirty && _hasSpeckFile)) {
return;
}
LDEBUG("Creating planes");
for (std::pair<const int, RenderingMesh>& p : _renderingMeshesMap) {
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.f;
break;
case Kilometer:
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
break;
case Kiloparsec:
scale = static_cast<float>(1e3 * PARSEC);
break;
case Megaparsec:
scale = static_cast<float>(1e6 * PARSEC);
break;
case Gigaparsec:
scale = static_cast<float>(1e9 * PARSEC);
break;
case GigalightYears:
scale = static_cast<float>(306391534.73091 * PARSEC);
break;
for (std::pair<const int, RenderingMesh>& p : _renderingMeshesMap) {
float scale = 0.f;
switch (_unit) {
case Meter:
scale = 1.f;
break;
case Kilometer:
scale = 1e3f;
break;
case Parsec:
scale = static_cast<float>(PARSEC);
break;
case Kiloparsec:
scale = static_cast<float>(1e3 * PARSEC);
break;
case Megaparsec:
scale = static_cast<float>(1e6 * PARSEC);
break;
case Gigaparsec:
scale = static_cast<float>(1e9 * PARSEC);
break;
case GigalightYears:
scale = static_cast<float>(306391534.73091 * PARSEC);
break;
}
for (GLfloat& v : p.second.vertices) {
v *= scale;
}
for (int i = 0; i < p.second.numU; ++i) {
GLuint vao;
glGenVertexArrays(1, &vao);
p.second.vaoArray.push_back(vao);
GLuint vbo;
glGenBuffers(1, &vbo);
p.second.vboArray.push_back(vbo);
glBindVertexArray(vao);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
//glBufferData(GL_ARRAY_BUFFER, it->second.numV * sizeof(GLfloat),
glBufferData(
GL_ARRAY_BUFFER,
p.second.vertices.size() * sizeof(GLfloat),
&p.second.vertices[0],
GL_STATIC_DRAW
);
// in_position
glEnableVertexAttribArray(0);
// U and V may not be given by the user
if (p.second.vertices.size() / (p.second.numU * p.second.numV) > 3) {
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 5,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i * p.second.numV)
);
// texture coords
glEnableVertexAttribArray(1);
glVertexAttribPointer(
1,
2,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 7,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i * p.second.numV)
);
}
for (GLfloat& v : p.second.vertices) {
v *= scale;
else { // no U and V:
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
0,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i * p.second.numV)
);
}
}
for (int i = 0; i < p.second.numU; ++i) {
GLuint vao;
glGenVertexArrays(1, &vao);
p.second.vaoArray.push_back(vao);
// Grid: we need columns
if (p.second.numU > 1) {
for (int i = 0; i < p.second.numV; ++i) {
GLuint cvao;
glGenVertexArrays(1, &cvao);
p.second.vaoArray.push_back(cvao);
GLuint vbo;
glGenBuffers(1, &vbo);
p.second.vboArray.push_back(vbo);
GLuint cvbo;
glGenBuffers(1, &cvbo);
p.second.vboArray.push_back(cvbo);
glBindVertexArray(vao);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
//glBufferData(GL_ARRAY_BUFFER, it->second.numV * sizeof(GLfloat),
glBindVertexArray(cvao);
glBindBuffer(GL_ARRAY_BUFFER, cvbo);
glBufferData(
GL_ARRAY_BUFFER,
p.second.vertices.size() * sizeof(GLfloat),
@@ -1031,8 +1088,8 @@ void RenderableDUMeshes::createMeshes() {
3,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 5,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i * p.second.numV)
p.second.numV * sizeof(GLfloat) * 5,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i)
);
// texture coords
@@ -1042,10 +1099,8 @@ void RenderableDUMeshes::createMeshes() {
2,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 7,
reinterpret_cast<GLvoid*>(
sizeof(GLfloat) * 3 * i * p.second.numV
)
p.second.numV * sizeof(GLfloat) * 7,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i)
);
}
else { // no U and V:
@@ -1054,81 +1109,17 @@ void RenderableDUMeshes::createMeshes() {
3,
GL_FLOAT,
GL_FALSE,
0,
reinterpret_cast<GLvoid*>(
sizeof(GLfloat) * 3 * i * p.second.numV
)
p.second.numV * sizeof(GLfloat) * 3,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i)
);
}
}
// Grid: we need columns
if (p.second.numU > 1) {
for (int i = 0; i < p.second.numV; ++i) {
GLuint cvao;
glGenVertexArrays(1, &cvao);
p.second.vaoArray.push_back(cvao);
GLuint cvbo;
glGenBuffers(1, &cvbo);
p.second.vboArray.push_back(cvbo);
glBindVertexArray(cvao);
glBindBuffer(GL_ARRAY_BUFFER, cvbo);
glBufferData(
GL_ARRAY_BUFFER,
p.second.vertices.size() * sizeof(GLfloat),
&p.second.vertices[0],
GL_STATIC_DRAW
);
// in_position
glEnableVertexAttribArray(0);
// U and V may not be given by the user
if (p.second.vertices.size() /
(p.second.numU * p.second.numV) > 3)
{
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
p.second.numV * sizeof(GLfloat) * 5,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * i)
);
// texture coords
glEnableVertexAttribArray(1);
glVertexAttribPointer(
1,
2,
GL_FLOAT,
GL_FALSE,
p.second.numV * sizeof(GLfloat) * 7,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i)
);
}
else { // no U and V:
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
p.second.numV * sizeof(GLfloat) * 3,
reinterpret_cast<GLvoid*>(sizeof(GLfloat) * 3 * i)
);
}
}
}
}
glBindVertexArray(0);
_dataIsDirty = false;
}
if (_hasLabel && _labelDataIsDirty) {
_labelDataIsDirty = false;
}
glBindVertexArray(0);
_dataIsDirty = false;
}
} // namespace openspace

Some files were not shown because too many files have changed in this diff Show More