From 23eed7f023f9b85a303e9785ef906ca211dafac8 Mon Sep 17 00:00:00 2001 From: Malin E Date: Wed, 3 Nov 2021 14:41:29 +0100 Subject: [PATCH 001/117] Move abstract function updateStateFromInput to the concrete classes --- include/openspace/interaction/camerainteractionstates.h | 2 -- include/openspace/interaction/joystickcamerastates.h | 3 ++- include/openspace/interaction/mousecamerastates.h | 2 +- include/openspace/interaction/scriptcamerastates.h | 2 +- include/openspace/interaction/websocketcamerastates.h | 3 ++- src/interaction/joystickcamerastates.cpp | 5 +++-- src/interaction/scriptcamerastates.cpp | 2 +- src/interaction/websocketcamerastates.cpp | 7 ++++--- src/navigation/orbitalnavigator.cpp | 6 +++--- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/openspace/interaction/camerainteractionstates.h b/include/openspace/interaction/camerainteractionstates.h index e619b1eaaf..6dc198e125 100644 --- a/include/openspace/interaction/camerainteractionstates.h +++ b/include/openspace/interaction/camerainteractionstates.h @@ -42,8 +42,6 @@ public: CameraInteractionStates(double sensitivity, double velocityScaleFactor); virtual ~CameraInteractionStates() = default; - virtual void updateStateFromInput(const InputState& inputState, double deltaTime) = 0; - void setRotationalFriction(double friction); void setHorizontalFriction(double friction); void setVerticalFriction(double friction); diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index f8f86f239b..ae0a3b0035 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -74,7 +74,8 @@ public: JoystickCameraStates(double sensitivity, double velocityScaleFactor); - void updateStateFromInput(const InputState& inputState, double deltaTime) override; + void updateStateFromInput( + const JoystickInputStates& joystickInputStates, double deltaTime); void setAxisMapping(int axis, AxisType mapping, AxisInvert shouldInvert = AxisInvert::No, diff --git a/include/openspace/interaction/mousecamerastates.h b/include/openspace/interaction/mousecamerastates.h index c1aae53864..f8a85b486a 100644 --- a/include/openspace/interaction/mousecamerastates.h +++ b/include/openspace/interaction/mousecamerastates.h @@ -33,7 +33,7 @@ class MouseCameraStates : public CameraInteractionStates { public: MouseCameraStates(double sensitivity, double velocityScaleFactor); - void updateStateFromInput(const InputState& inputState, double deltaTime) override; + void updateStateFromInput(const InputState& inputState, double deltaTime); void setInvertMouseButton(bool value); diff --git a/include/openspace/interaction/scriptcamerastates.h b/include/openspace/interaction/scriptcamerastates.h index df5fa5a612..41d06c8937 100644 --- a/include/openspace/interaction/scriptcamerastates.h +++ b/include/openspace/interaction/scriptcamerastates.h @@ -33,7 +33,7 @@ class ScriptCameraStates : public CameraInteractionStates { public: ScriptCameraStates(); - void updateStateFromInput(const InputState& inputState, double deltaTime) override; + void updateStateFromInput(double deltaTime); void addLocalRotation(const glm::dvec2& delta); void addGlobalRotation(const glm::dvec2& delta); diff --git a/include/openspace/interaction/websocketcamerastates.h b/include/openspace/interaction/websocketcamerastates.h index f36660a649..22b543ffc0 100644 --- a/include/openspace/interaction/websocketcamerastates.h +++ b/include/openspace/interaction/websocketcamerastates.h @@ -65,7 +65,8 @@ public: WebsocketCameraStates(double sensitivity, double velocityScaleFactor); - void updateStateFromInput(const InputState& inputState, double deltaTime) override; + void updateStateFromInput( + const WebsocketInputStates& websocketInputStates, double deltaTime); void setAxisMapping(int axis, AxisType mapping, AxisInvert shouldInvert = AxisInvert::No, diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index 91d89fe274..fd6a043046 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -37,7 +37,8 @@ JoystickCameraStates::JoystickCameraStates(double sensitivity, double velocitySc : CameraInteractionStates(sensitivity, velocityScaleFactor) {} -void JoystickCameraStates::updateStateFromInput(const InputState& inputState, +void JoystickCameraStates::updateStateFromInput( + const JoystickInputStates& joystickInputStates, double deltaTime) { std::pair globalRotation = { false, glm::dvec2(0.0) }; @@ -52,7 +53,7 @@ void JoystickCameraStates::updateStateFromInput(const InputState& inputState, continue; } - float rawValue = inputState.joystickAxis(i); + float rawValue = joystickInputStates.axis(i); float value = rawValue; if (t.isSticky) { diff --git a/src/interaction/scriptcamerastates.cpp b/src/interaction/scriptcamerastates.cpp index 863e630de3..fb05f1dc4c 100644 --- a/src/interaction/scriptcamerastates.cpp +++ b/src/interaction/scriptcamerastates.cpp @@ -30,7 +30,7 @@ namespace openspace::interaction { ScriptCameraStates::ScriptCameraStates() : CameraInteractionStates(1.0, 1.0) {} -void ScriptCameraStates::updateStateFromInput(const InputState&, double deltaTime) { +void ScriptCameraStates::updateStateFromInput(double deltaTime) { if (_localRotation != glm::dvec2(0.0)) { _localRotationState.velocity.set( _localRotation * _sensitivity, diff --git a/src/interaction/websocketcamerastates.cpp b/src/interaction/websocketcamerastates.cpp index eed4969513..4a219d4864 100644 --- a/src/interaction/websocketcamerastates.cpp +++ b/src/interaction/websocketcamerastates.cpp @@ -39,7 +39,8 @@ WebsocketCameraStates::WebsocketCameraStates(double sensitivity, : CameraInteractionStates(sensitivity, velocityScaleFactor) {} -void WebsocketCameraStates::updateStateFromInput(const InputState& inputState, +void WebsocketCameraStates::updateStateFromInput( + const WebsocketInputStates& websocketInputStates, double deltaTime) { std::pair globalRotation = { false, glm::dvec2(0.0) }; @@ -48,14 +49,14 @@ void WebsocketCameraStates::updateStateFromInput(const InputState& inputState, std::pair globalRoll = { false, glm::dvec2(0.0) }; std::pair localRotation = { false, glm::dvec2(0.0) }; - if (inputState.hasWebsocketStates()) { + if (!websocketInputStates.empty()) { for (int i = 0; i < WebsocketInputState::MaxAxes; ++i) { AxisInformation t = _axisMapping[i]; if (t.type == AxisType::None) { continue; } - float value = inputState.websocketAxis(i); + float value = websocketInputStates.axis(i); bool hasValue = std::fabs(value) > t.deadzone; if (!hasValue) { diff --git a/src/navigation/orbitalnavigator.cpp b/src/navigation/orbitalnavigator.cpp index fded5fca7f..70f52dcb2c 100644 --- a/src/navigation/orbitalnavigator.cpp +++ b/src/navigation/orbitalnavigator.cpp @@ -547,9 +547,9 @@ void OrbitalNavigator::updateStatesFromInput(const InputState& inputState, double deltaTime) { _mouseStates.updateStateFromInput(inputState, deltaTime); - _joystickStates.updateStateFromInput(inputState, deltaTime); - _websocketStates.updateStateFromInput(inputState, deltaTime); - _scriptStates.updateStateFromInput(inputState, deltaTime); + _joystickStates.updateStateFromInput(*global::joystickInputStates, deltaTime); + _websocketStates.updateStateFromInput(*global::websocketInputStates, deltaTime); + _scriptStates.updateStateFromInput(deltaTime); bool interactionHappened = _mouseStates.hasNonZeroVelocities() || _joystickStates.hasNonZeroVelocities() || From 8bddf38f02921247e62da21f817b50c1bd931e1a Mon Sep 17 00:00:00 2001 From: Malin E Date: Wed, 3 Nov 2021 15:28:37 +0100 Subject: [PATCH 002/117] Split InputState into MouseInputState and KeyboardInputState --- .../interaction/camerainteractionstates.h | 2 - .../interaction/keyboardinputstate.h | 51 ++++++++++++ .../openspace/interaction/mousecamerastates.h | 6 +- .../{inputstate.h => mouseinputstate.h} | 30 +------ .../openspace/navigation/navigationhandler.h | 9 ++- .../openspace/navigation/orbitalnavigator.h | 3 +- modules/webbrowser/src/eventhandler.cpp | 4 +- src/CMakeLists.txt | 6 +- src/interaction/camerainteractionstates.cpp | 2 - src/interaction/joystickcamerastates.cpp | 1 - ...{inputstate.cpp => keyboardinputstate.cpp} | 81 ++----------------- src/interaction/mousecamerastates.cpp | 30 +++---- src/interaction/mouseinputstate.cpp | 68 ++++++++++++++++ src/interaction/scriptcamerastates.cpp | 2 - src/interaction/websocketcamerastates.cpp | 1 - src/navigation/navigationhandler.cpp | 22 +++-- src/navigation/orbitalnavigator.cpp | 5 +- 17 files changed, 183 insertions(+), 140 deletions(-) create mode 100644 include/openspace/interaction/keyboardinputstate.h rename include/openspace/interaction/{inputstate.h => mouseinputstate.h} (76%) rename src/interaction/{inputstate.cpp => keyboardinputstate.cpp} (56%) create mode 100644 src/interaction/mouseinputstate.cpp diff --git a/include/openspace/interaction/camerainteractionstates.h b/include/openspace/interaction/camerainteractionstates.h index 6dc198e125..8e6e14b402 100644 --- a/include/openspace/interaction/camerainteractionstates.h +++ b/include/openspace/interaction/camerainteractionstates.h @@ -30,8 +30,6 @@ namespace openspace::interaction { -class InputState; - class CameraInteractionStates { public: /** diff --git a/include/openspace/interaction/keyboardinputstate.h b/include/openspace/interaction/keyboardinputstate.h new file mode 100644 index 0000000000..09cb15aca6 --- /dev/null +++ b/include/openspace/interaction/keyboardinputstate.h @@ -0,0 +1,51 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2021 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#ifndef __OPENSPACE_CORE___KEYBOARDINPUTSTATE___H__ +#define __OPENSPACE_CORE___KEYBOARDINPUTSTATE___H__ + +#include +#include + +namespace openspace::interaction { + +// This class represents the global input state of interaction devices +class KeyboardInputState { +public: + // Callback functions + void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); + + // Accessors + const std::vector>& pressedKeys() const; + bool isKeyPressed(std::pair keyModPair) const; + bool isKeyPressed(Key key) const; + +private: + // Input from keyboard + std::vector> _keysDown; +}; + +} // namespace openspace::interaction + +#endif // __OPENSPACE_CORE___KEYBOARDINPUTSTATE___H__ diff --git a/include/openspace/interaction/mousecamerastates.h b/include/openspace/interaction/mousecamerastates.h index f8a85b486a..fa420b5046 100644 --- a/include/openspace/interaction/mousecamerastates.h +++ b/include/openspace/interaction/mousecamerastates.h @@ -29,11 +29,15 @@ namespace openspace::interaction { +class MouseInputState; +class KeyboardInputState; + class MouseCameraStates : public CameraInteractionStates { public: MouseCameraStates(double sensitivity, double velocityScaleFactor); - void updateStateFromInput(const InputState& inputState, double deltaTime); + void updateStateFromInput(const MouseInputState& mouseinputState, + const KeyboardInputState& keyboardinputState, double deltaTime); void setInvertMouseButton(bool value); diff --git a/include/openspace/interaction/inputstate.h b/include/openspace/interaction/mouseinputstate.h similarity index 76% rename from include/openspace/interaction/inputstate.h rename to include/openspace/interaction/mouseinputstate.h index 5cb71905c7..b5ee977f59 100644 --- a/include/openspace/interaction/inputstate.h +++ b/include/openspace/interaction/mouseinputstate.h @@ -22,52 +22,30 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___INPUTSTATE___H__ -#define __OPENSPACE_CORE___INPUTSTATE___H__ +#ifndef __OPENSPACE_CORE___MOUSEINPUTSTATE___H__ +#define __OPENSPACE_CORE___MOUSEINPUTSTATE___H__ -#include -#include #include #include #include namespace openspace::interaction { -struct JoystickInputStates; -struct WebsocketInputStates; - // This class represents the global input state of interaction devices -class InputState { +class MouseInputState { public: // Callback functions - void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); void mouseButtonCallback(MouseButton button, MouseAction action); void mousePositionCallback(double mouseX, double mouseY); void mouseScrollWheelCallback(double mouseScrollDelta); // Accessors - const std::vector>& pressedKeys() const; - bool isKeyPressed(std::pair keyModPair) const; - bool isKeyPressed(Key key) const; - const std::vector& pressedMouseButtons() const; glm::dvec2 mousePosition() const; double mouseScrollDelta() const; bool isMouseButtonPressed(MouseButton mouseButton) const; - float joystickAxis(int i) const; - bool joystickButton(int i) const; - - WebsocketInputStates& websocketInputStates(); - float websocketAxis(int i) const; - bool websocketButton(int i) const; - bool hasWebsocketStates() const; - void resetWebsockets(); - private: - // Input from keyboard - std::vector> _keysDown; - // Input from mouse std::vector _mouseButtonsDown; glm::dvec2 _mousePosition = glm::dvec2(0.0); @@ -76,4 +54,4 @@ private: } // namespace openspace::interaction -#endif // __OPENSPACE_CORE___INPUTSTATE___H__ +#endif // __OPENSPACE_CORE___MOUSEINPUTSTATE___H__ diff --git a/include/openspace/navigation/navigationhandler.h b/include/openspace/navigation/navigationhandler.h index 8738c04caa..8cdee66abb 100644 --- a/include/openspace/navigation/navigationhandler.h +++ b/include/openspace/navigation/navigationhandler.h @@ -26,8 +26,9 @@ #define __OPENSPACE_CORE___NAVIGATIONHANDLER___H__ #include -#include #include +#include +#include #include #include #include @@ -81,7 +82,8 @@ public: // Accessors Camera* camera() const; const SceneGraphNode* anchorNode() const; - const InputState& inputState() const; + const MouseInputState& mouseInputState() const; + const KeyboardInputState& keyboardInputState() const; const OrbitalNavigator& orbitalNavigator() const; OrbitalNavigator& orbitalNavigator(); KeyframeNavigator& keyframeNavigator(); @@ -144,7 +146,8 @@ private: bool _playbackModeEnabled = false; - InputState _inputState; + MouseInputState _mouseInputState; + KeyboardInputState _keyboardInputState; Camera* _camera = nullptr; std::function _playbackEndCallback; diff --git a/include/openspace/navigation/orbitalnavigator.h b/include/openspace/navigation/orbitalnavigator.h index c964e1eef9..c0cdada814 100644 --- a/include/openspace/navigation/orbitalnavigator.h +++ b/include/openspace/navigation/orbitalnavigator.h @@ -59,7 +59,8 @@ class OrbitalNavigator : public properties::PropertyOwner { public: OrbitalNavigator(); - void updateStatesFromInput(const InputState& inputState, double deltaTime); + void updateStatesFromInput(const MouseInputState& mouseInputState, + const KeyboardInputState& keyboardInputState, double deltaTime); void updateCameraStateFromStates(double deltaTime); void updateCameraScalingFromAnchor(double deltaTime); void resetVelocities(); diff --git a/modules/webbrowser/src/eventhandler.cpp b/modules/webbrowser/src/eventhandler.cpp index 0b562d5aff..652958e5b9 100644 --- a/modules/webbrowser/src/eventhandler.cpp +++ b/modules/webbrowser/src/eventhandler.cpp @@ -28,8 +28,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -462,7 +462,7 @@ CefTouchEvent EventHandler::touchEvent(const TouchInput& input, event.y = windowPos.y; event.type = eventType; const std::vector>& keyMods = - global::navigationHandler->inputState().pressedKeys(); + global::navigationHandler->keyboardInputState().pressedKeys(); for (const std::pair& p : keyMods) { const KeyModifier mods = p.second; event.modifiers |= static_cast(mapToCefModifiers(mods)); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9fe2d9fbdd..71eb1261b2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,11 +50,12 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/interaction/actionmanager_lua.inl ${OPENSPACE_BASE_DIR}/src/interaction/camerainteractionstates.cpp ${OPENSPACE_BASE_DIR}/src/interaction/interactionmonitor.cpp - ${OPENSPACE_BASE_DIR}/src/interaction/inputstate.cpp + ${OPENSPACE_BASE_DIR}/src/interaction/mouseinputstate.cpp ${OPENSPACE_BASE_DIR}/src/interaction/joystickinputstate.cpp ${OPENSPACE_BASE_DIR}/src/interaction/joystickcamerastates.cpp ${OPENSPACE_BASE_DIR}/src/interaction/keybindingmanager.cpp ${OPENSPACE_BASE_DIR}/src/interaction/keybindingmanager_lua.inl + ${OPENSPACE_BASE_DIR}/src/interaction/keyboardinputstate.cpp ${OPENSPACE_BASE_DIR}/src/interaction/mousecamerastates.cpp ${OPENSPACE_BASE_DIR}/src/interaction/scriptcamerastates.cpp ${OPENSPACE_BASE_DIR}/src/interaction/externinteraction.cpp @@ -235,13 +236,14 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/interaction/delayedvariable.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/delayedvariable.inl ${OPENSPACE_BASE_DIR}/include/openspace/interaction/camerainteractionstates.h - ${OPENSPACE_BASE_DIR}/include/openspace/interaction/inputstate.h + ${OPENSPACE_BASE_DIR}/include/openspace/interaction/mouseinputstate.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/interactionmonitor.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/interpolator.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/interpolator.inl ${OPENSPACE_BASE_DIR}/include/openspace/interaction/joystickinputstate.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/joystickcamerastates.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/keybindingmanager.h + ${OPENSPACE_BASE_DIR}/include/openspace/interaction/keyboardinputstate.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/mousecamerastates.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/externinteraction.h ${OPENSPACE_BASE_DIR}/include/openspace/interaction/scriptcamerastates.h diff --git a/src/interaction/camerainteractionstates.cpp b/src/interaction/camerainteractionstates.cpp index 69566b459b..cba24d9cd1 100644 --- a/src/interaction/camerainteractionstates.cpp +++ b/src/interaction/camerainteractionstates.cpp @@ -24,8 +24,6 @@ #include -#include - namespace openspace::interaction { CameraInteractionStates::InteractionState::InteractionState(double scaleFactor) diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index fd6a043046..6e3c6de8f9 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/src/interaction/inputstate.cpp b/src/interaction/keyboardinputstate.cpp similarity index 56% rename from src/interaction/inputstate.cpp rename to src/interaction/keyboardinputstate.cpp index fb0c792cf8..67b8c59dca 100644 --- a/src/interaction/inputstate.cpp +++ b/src/interaction/keyboardinputstate.cpp @@ -22,17 +22,15 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include -#include -#include -#include -#include #include namespace openspace::interaction { -void InputState::keyboardCallback(Key key, KeyModifier modifier, KeyAction action) { +void KeyboardInputState::keyboardCallback(Key key, KeyModifier modifier, + KeyAction action) +{ if (action == KeyAction::Press) { _keysDown.emplace_back(key, modifier); } @@ -51,47 +49,15 @@ void InputState::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio } } -void InputState::mouseButtonCallback(MouseButton button, MouseAction action) { - if (action == MouseAction::Press) { - _mouseButtonsDown.push_back(button); - } - else if (action == MouseAction::Release) { - _mouseButtonsDown.erase( - std::remove(_mouseButtonsDown.begin(), _mouseButtonsDown.end(), button), - _mouseButtonsDown.end() - ); - } -} - -void InputState::mousePositionCallback(double mouseX, double mouseY) { - _mousePosition = glm::dvec2(mouseX, mouseY); -} - -void InputState::mouseScrollWheelCallback(double mouseScrollDelta) { - _mouseScrollDelta = mouseScrollDelta; -} - -const std::vector>& InputState::pressedKeys() const { +const std::vector>& KeyboardInputState::pressedKeys() const { return _keysDown; } -const std::vector& InputState::pressedMouseButtons() const { - return _mouseButtonsDown; -} - -glm::dvec2 InputState::mousePosition() const { - return _mousePosition; -} - -double InputState::mouseScrollDelta() const { - return _mouseScrollDelta; -} - -bool InputState::isKeyPressed(std::pair keyModPair) const { +bool KeyboardInputState::isKeyPressed(std::pair keyModPair) const { return std::find(_keysDown.begin(), _keysDown.end(), keyModPair) != _keysDown.end(); } -bool InputState::isKeyPressed(Key key) const { +bool KeyboardInputState::isKeyPressed(Key key) const { auto it = std::find_if( _keysDown.begin(), _keysDown.end(), @@ -102,37 +68,4 @@ bool InputState::isKeyPressed(Key key) const { return it != _keysDown.end(); } -bool InputState::isMouseButtonPressed(MouseButton mouseButton) const { - auto it = std::find(_mouseButtonsDown.begin(), _mouseButtonsDown.end(), mouseButton); - return it != _mouseButtonsDown.end(); -} - -float InputState::joystickAxis(int i) const { - return global::joystickInputStates->axis(i); -} - -bool InputState::joystickButton(int i) const { - return global::joystickInputStates->button(i, JoystickAction::Press); -} - -float InputState::websocketAxis(int i) const { - return global::websocketInputStates->axis(i); -} - -bool InputState::websocketButton(int i) const { - return global::websocketInputStates->button(i, WebsocketAction::Press); -} - -void InputState::resetWebsockets() { - using K = size_t; - using V = WebsocketInputState*; - for (const std::pair& p : *global::websocketInputStates) { - p.second->isConnected = false; - } -} - -bool InputState::hasWebsocketStates() const { - return !global::websocketInputStates->empty(); -} - } // namespace openspace::interaction diff --git a/src/interaction/mousecamerastates.cpp b/src/interaction/mousecamerastates.cpp index c2014d8a34..627ba2210f 100644 --- a/src/interaction/mousecamerastates.cpp +++ b/src/interaction/mousecamerastates.cpp @@ -24,7 +24,8 @@ #include -#include +#include +#include namespace { const double SENSITIVITY_ADJUSTMENT_INCREASE = 8.0; @@ -37,7 +38,8 @@ MouseCameraStates::MouseCameraStates(double sensitivity, double velocityScaleFac : CameraInteractionStates(sensitivity, velocityScaleFactor) {} -void MouseCameraStates::updateStateFromInput(const InputState& inputState, +void MouseCameraStates::updateStateFromInput(const MouseInputState& mouseinputState, + const KeyboardInputState& keyboardinputState, double deltaTime) { MouseButton primary = @@ -45,17 +47,17 @@ void MouseCameraStates::updateStateFromInput(const InputState& inputState, MouseButton secondary = _isMouseButtonInverted ? MouseButton::Button1 : MouseButton::Button2; - glm::dvec2 mousePosition = inputState.mousePosition(); + glm::dvec2 mousePosition = mouseinputState.mousePosition(); - bool primaryPressed = inputState.isMouseButtonPressed(primary); - bool secondaryPressed = inputState.isMouseButtonPressed(secondary); - bool button3Pressed = inputState.isMouseButtonPressed(MouseButton::Button3); - bool keyCtrlPressed = inputState.isKeyPressed(Key::LeftControl) | - inputState.isKeyPressed(Key::RightControl); - bool keyShiftPressed = inputState.isKeyPressed(Key::LeftShift) | - inputState.isKeyPressed(Key::RightShift); - bool keyAltPressed = inputState.isKeyPressed(Key::LeftAlt) | - inputState.isKeyPressed(Key::RightAlt); + bool primaryPressed = mouseinputState.isMouseButtonPressed(primary); + bool secondaryPressed = mouseinputState.isMouseButtonPressed(secondary); + bool button3Pressed = mouseinputState.isMouseButtonPressed(MouseButton::Button3); + bool keyCtrlPressed = keyboardinputState.isKeyPressed(Key::LeftControl) | + keyboardinputState.isKeyPressed(Key::RightControl); + bool keyShiftPressed = keyboardinputState.isKeyPressed(Key::LeftShift) | + keyboardinputState.isKeyPressed(Key::RightShift); + bool keyAltPressed = keyboardinputState.isKeyPressed(Key::LeftAlt) | + keyboardinputState.isKeyPressed(Key::RightAlt); // Update the mouse states if (primaryPressed && !keyShiftPressed && !keyAltPressed) { @@ -94,10 +96,10 @@ void MouseCameraStates::updateStateFromInput(const InputState& inputState, mousePosition; double sensitivity = _sensitivity; - if (inputState.isKeyPressed(Key::Z)) { + if (keyboardinputState.isKeyPressed(Key::Z)) { sensitivity *= SENSITIVITY_ADJUSTMENT_INCREASE; } - else if (inputState.isKeyPressed(Key::X)) { + else if (keyboardinputState.isKeyPressed(Key::X)) { sensitivity *= SENSITIVITY_ADJUSTMENT_DECREASE; } diff --git a/src/interaction/mouseinputstate.cpp b/src/interaction/mouseinputstate.cpp new file mode 100644 index 0000000000..899c69d303 --- /dev/null +++ b/src/interaction/mouseinputstate.cpp @@ -0,0 +1,68 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2021 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace::interaction { + +void MouseInputState::mouseButtonCallback(MouseButton button, MouseAction action) { + if (action == MouseAction::Press) { + _mouseButtonsDown.push_back(button); + } + else if (action == MouseAction::Release) { + _mouseButtonsDown.erase( + std::remove(_mouseButtonsDown.begin(), _mouseButtonsDown.end(), button), + _mouseButtonsDown.end() + ); + } +} + +void MouseInputState::mousePositionCallback(double mouseX, double mouseY) { + _mousePosition = glm::dvec2(mouseX, mouseY); +} + +void MouseInputState::mouseScrollWheelCallback(double mouseScrollDelta) { + _mouseScrollDelta = mouseScrollDelta; +} + +const std::vector& MouseInputState::pressedMouseButtons() const { + return _mouseButtonsDown; +} + +glm::dvec2 MouseInputState::mousePosition() const { + return _mousePosition; +} + +double MouseInputState::mouseScrollDelta() const { + return _mouseScrollDelta; +} + +bool MouseInputState::isMouseButtonPressed(MouseButton mouseButton) const { + auto it = std::find(_mouseButtonsDown.begin(), _mouseButtonsDown.end(), mouseButton); + return it != _mouseButtonsDown.end(); +} + +} // namespace openspace::interaction diff --git a/src/interaction/scriptcamerastates.cpp b/src/interaction/scriptcamerastates.cpp index fb05f1dc4c..dff322ad0f 100644 --- a/src/interaction/scriptcamerastates.cpp +++ b/src/interaction/scriptcamerastates.cpp @@ -24,8 +24,6 @@ #include -#include - namespace openspace::interaction { ScriptCameraStates::ScriptCameraStates() : CameraInteractionStates(1.0, 1.0) {} diff --git a/src/interaction/websocketcamerastates.cpp b/src/interaction/websocketcamerastates.cpp index 4a219d4864..411ad96257 100644 --- a/src/interaction/websocketcamerastates.cpp +++ b/src/interaction/websocketcamerastates.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index 10fd242a53..43da79c0dd 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -188,7 +188,11 @@ void NavigationHandler::updateCamera(double deltaTime) { JoystickInputState() ); } - _orbitalNavigator.updateStatesFromInput(_inputState, deltaTime); + _orbitalNavigator.updateStatesFromInput( + _mouseInputState, + _keyboardInputState, + deltaTime + ); _orbitalNavigator.updateCameraStateFromStates(deltaTime); updateCameraTransitions(); } @@ -351,25 +355,29 @@ Camera* NavigationHandler::camera() const { return _camera; } -const InputState& NavigationHandler::inputState() const { - return _inputState; +const MouseInputState& NavigationHandler::mouseInputState() const { + return _mouseInputState; +} + +const KeyboardInputState& NavigationHandler::keyboardInputState() const { + return _keyboardInputState; } void NavigationHandler::mouseButtonCallback(MouseButton button, MouseAction action) { if (!_disableMouseInputs) { - _inputState.mouseButtonCallback(button, action); + _mouseInputState.mouseButtonCallback(button, action); } } void NavigationHandler::mousePositionCallback(double x, double y) { if (!_disableMouseInputs) { - _inputState.mousePositionCallback(x, y); + _mouseInputState.mousePositionCallback(x, y); } } void NavigationHandler::mouseScrollWheelCallback(double pos) { if (!_disableMouseInputs) { - _inputState.mouseScrollWheelCallback(pos); + _mouseInputState.mouseScrollWheelCallback(pos); } } @@ -377,7 +385,7 @@ void NavigationHandler::keyboardCallback(Key key, KeyModifier modifier, KeyActio { // There is no need to disable the keyboard callback based on a property as the vast // majority of input is coming through Lua scripts anyway which are not blocked here - _inputState.keyboardCallback(key, modifier, action); + _keyboardInputState.keyboardCallback(key, modifier, action); } NavigationState NavigationHandler::navigationState() const { diff --git a/src/navigation/orbitalnavigator.cpp b/src/navigation/orbitalnavigator.cpp index 70f52dcb2c..49009d083f 100644 --- a/src/navigation/orbitalnavigator.cpp +++ b/src/navigation/orbitalnavigator.cpp @@ -543,10 +543,11 @@ void OrbitalNavigator::resetVelocities() { } } -void OrbitalNavigator::updateStatesFromInput(const InputState& inputState, +void OrbitalNavigator::updateStatesFromInput(const MouseInputState& mouseInputState, + const KeyboardInputState& keyboardInputState, double deltaTime) { - _mouseStates.updateStateFromInput(inputState, deltaTime); + _mouseStates.updateStateFromInput(mouseInputState, keyboardInputState, deltaTime); _joystickStates.updateStateFromInput(*global::joystickInputStates, deltaTime); _websocketStates.updateStateFromInput(*global::websocketInputStates, deltaTime); _scriptStates.updateStateFromInput(deltaTime); From 3526e14e66e1d1640918cd2d3d830292bd9958ac Mon Sep 17 00:00:00 2001 From: Malin E Date: Thu, 4 Nov 2021 13:19:43 +0100 Subject: [PATCH 003/117] Add support for several joysticks at the smae time --- .../interaction/joystickcamerastates.h | 58 ++-- .../interaction/joystickinputstate.h | 13 +- .../openspace/navigation/navigationhandler.h | 19 +- modules/imgui/src/guijoystickcomponent.cpp | 7 +- src/interaction/joystickcamerastates.cpp | 266 +++++++++++++----- src/interaction/joystickinputstate.cpp | 76 +++-- src/navigation/navigationhandler.cpp | 35 ++- src/navigation/navigationhandler_lua.inl | 51 ++-- 8 files changed, 359 insertions(+), 166 deletions(-) diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index ae0a3b0035..2ac5aa2f71 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -77,43 +77,55 @@ public: void updateStateFromInput( const JoystickInputStates& joystickInputStates, double deltaTime); - void setAxisMapping(int axis, AxisType mapping, + void setAxisMapping(const std::string& joystickName, int axis, AxisType mapping, AxisInvert shouldInvert = AxisInvert::No, AxisNormalize shouldNormalize = AxisNormalize::No, bool isSticky = false, double sensitivity = 0.0 ); - AxisInformation axisMapping(int axis) const; + AxisInformation axisMapping(const std::string& joystickName, int axis) const; - void setDeadzone(int axis, float deadzone); - float deadzone(int axis) const; + void setDeadzone(const std::string& joystickName, int axis, float deadzone); + float deadzone(const std::string& joystickName, int axis) const; - - void bindButtonCommand(int button, std::string command, JoystickAction action, - ButtonCommandRemote remote, std::string documentation); - void clearButtonCommand(int button); - std::vector buttonCommand(int button) const; + void bindButtonCommand(const std::string& joystickName, int button, + std::string command, JoystickAction action, ButtonCommandRemote remote, + std::string documentation); + void clearButtonCommand(const std::string& joystickName, int button); + std::vector buttonCommand(const std::string& joystickName, + int button) const; private: - // We use an array for the axes and a map for the buttons since the axis are going to - // be accessed much more often and thus have to be more efficient. And storing a few - // extra AxisInformation that are not used will not matter that much; finding an axis - // location in a potential map each frame, however, would + struct JoystickCameraState { + std::string joystickName; - std::array _axisMapping; + // We use an array for the axes and a map for the buttons since the axis are going to + // be accessed much more often and thus have to be more efficient. And storing a few + // extra AxisInformation that are not used will not matter that much; finding an axis + // location in a potential map each frame, however, would - // This array is used to store the old axis values from the previous frame, - // it is used to calculate the difference in the values in the case of a sticky axis - std::array _prevAxisValues; + std::array axisMapping; - struct ButtonInformation { - std::string command; - JoystickAction action; - ButtonCommandRemote synchronization; - std::string documentation; + // This array is used to store the old axis values from the previous frame, + // it is used to calculate the difference in the values in the case of a sticky axis + std::array prevAxisValues; + + struct ButtonInformation { + std::string command; + JoystickAction action; + ButtonCommandRemote synchronization; + std::string documentation; + }; + + std::multimap buttonMapping; }; - std::multimap _buttonMapping; + std::vector _joystickCameraStates; + + // Find the item in _joystickCameraStates that corresponds to the given joystickName + // return a pointer to the item, if not found then return nullptr + JoystickCameraState* getJoystickCameraState(const std::string& joystickName); + const JoystickCameraState* getJoystickCameraState(const std::string& joystickName) const; }; } // namespace openspace::interaction diff --git a/include/openspace/interaction/joystickinputstate.h b/include/openspace/interaction/joystickinputstate.h index e256f39552..adcfc028c3 100644 --- a/include/openspace/interaction/joystickinputstate.h +++ b/include/openspace/interaction/joystickinputstate.h @@ -72,11 +72,6 @@ struct JoystickInputState { /// \c nAxes values are defined values, the rest are undefined std::array axes; - /// The axis values can either go back to 0 when the joystick is released or it can - /// stay at the value it was before the joystick was released. - /// The latter is called a sticky axis, when the values don't go back to 0. - bool isSticky = false; - /// The number of buttons that this joystick possesses int nButtons = 0; /// The status of each button. Only the first \c nButtons values are defined, the rest @@ -88,6 +83,10 @@ struct JoystickInputState { /// derived from the available GLFW constants constexpr const int MaxJoysticks = 16; struct JoystickInputStates : public std::array { + /// The maximum number of joysticks that are supported by this system. This number is + /// derived from the available GLFW constants + static constexpr const int MaxNumJoysticks = 16; + /** * This function adds the contributions of all connected joysticks for the provided * \p axis. After adding each joysticks contribution, the result is clamped to [-1,1]. @@ -99,7 +98,7 @@ struct JoystickInputStates : public std::array * * \pre \p axis must be 0 or positive */ - float axis(int axis) const; + float axis(const std::string& joystickName, int axis) const; /** * This functions checks whether any connected joystick has its \p button in the @@ -113,7 +112,7 @@ struct JoystickInputStates : public std::array * * \pre \p button must be 0 or positive */ - bool button(int button, JoystickAction action) const; + bool button(const std::string& joystickName, int button, JoystickAction action) const; }; } // namespace openspace::interaction diff --git a/include/openspace/navigation/navigationhandler.h b/include/openspace/navigation/navigationhandler.h index 8cdee66abb..5fa4c105b4 100644 --- a/include/openspace/navigation/navigationhandler.h +++ b/include/openspace/navigation/navigationhandler.h @@ -98,7 +98,8 @@ public: void mousePositionCallback(double x, double y); void mouseScrollWheelCallback(double pos); - void setJoystickAxisMapping(int axis, JoystickCameraStates::AxisType mapping, + void setJoystickAxisMapping(const std::string& joystickName, + int axis, JoystickCameraStates::AxisType mapping, JoystickCameraStates::AxisInvert shouldInvert = JoystickCameraStates::AxisInvert::No, JoystickCameraStates::AxisNormalize shouldNormalize = @@ -106,16 +107,20 @@ public: bool isSticky = false, double sensitivity = 0.0 ); - JoystickCameraStates::AxisInformation joystickAxisMapping(int axis) const; + JoystickCameraStates::AxisInformation joystickAxisMapping( + const std::string& joystickName, int axis) const; - void setJoystickAxisDeadzone(int axis, float deadzone); - float joystickAxisDeadzone(int axis) const; + void setJoystickAxisDeadzone(const std::string& joystickName, int axis, + float deadzone); + float joystickAxisDeadzone(const std::string& joystickName, int axis) const; - void bindJoystickButtonCommand(int button, std::string command, JoystickAction action, + void bindJoystickButtonCommand(const std::string& joystickName, int button, + std::string command, JoystickAction action, JoystickCameraStates::ButtonCommandRemote remote, std::string documentation); - void clearJoystickButtonCommand(int button); - std::vector joystickButtonCommand(int button) const; + void clearJoystickButtonCommand(const std::string& joystickName, int button); + std::vector joystickButtonCommand(const std::string& joystickName, + int button) const; // Websockets void setWebsocketAxisMapping(int axis, WebsocketCameraStates::AxisType mapping, diff --git a/modules/imgui/src/guijoystickcomponent.cpp b/modules/imgui/src/guijoystickcomponent.cpp index b63fdb5ac4..2654d3a78d 100644 --- a/modules/imgui/src/guijoystickcomponent.cpp +++ b/modules/imgui/src/guijoystickcomponent.cpp @@ -26,7 +26,6 @@ #include #include -#include #include namespace { @@ -86,7 +85,7 @@ void GuiJoystickComponent::render() { ImGui::Text("%s", "Summed contributions"); ImGui::Text("%s", "Axes"); for (int i = 0; i < JoystickInputState::MaxAxes; ++i) { - float f = global::joystickInputStates->axis(i); + float f = global::joystickInputStates->axis("", i); ImGui::SliderFloat( std::to_string(i).c_str(), &f, @@ -98,8 +97,8 @@ void GuiJoystickComponent::render() { for (int i = 0; i < JoystickInputState::MaxButtons; ++i) { ImGui::RadioButton( std::to_string(i).c_str(), - global::joystickInputStates->button(i, JoystickAction::Press) || - global::joystickInputStates->button(i, JoystickAction::Repeat) + global::joystickInputStates->button("", i, JoystickAction::Press) || + global::joystickInputStates->button("", i, JoystickAction::Repeat) ); } diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index 6e3c6de8f9..2eadf18a61 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -26,10 +26,15 @@ #include #include +#include #include #include #include +namespace { + constexpr const char* _loggerCat = "JoystickCameraStates"; +} // namespace + namespace openspace::interaction { JoystickCameraStates::JoystickCameraStates(double sensitivity, double velocityScaleFactor) @@ -46,49 +51,61 @@ void JoystickCameraStates::updateStateFromInput( std::pair globalRoll = { false, glm::dvec2(0.0) }; std::pair localRotation = { false, glm::dvec2(0.0) }; - for (int i = 0; i < JoystickInputState::MaxAxes; ++i) { - AxisInformation t = _axisMapping[i]; - if (t.type == AxisType::None) { + for (const JoystickInputState& joystickInputState : joystickInputStates) { + if (joystickInputState.name.empty()) { continue; } - float rawValue = joystickInputStates.axis(i); - float value = rawValue; + JoystickCameraState* joystickCameraState = + getJoystickCameraState(joystickInputState.name); - if (t.isSticky) { - value = rawValue - _prevAxisValues[i]; - _prevAxisValues[i] = rawValue; - } - - if (std::fabs(value) <= t.deadzone) { + if (!joystickCameraState) { continue; } - if (t.normalize) { - value = (value + 1.f) / 2.f; - } + for (int i = 0; i < JoystickInputState::MaxAxes; ++i) { + AxisInformation t = joystickCameraState->axisMapping[i]; + if (t.type == AxisType::None) { + continue; + } - if (t.invert) { - value *= -1.f; - } + float rawValue = joystickInputStates.axis(joystickInputState.name, i); + float value = rawValue; - if (std::abs(t.sensitivity) > std::numeric_limits::epsilon()) { - value = static_cast(value * t.sensitivity * _sensitivity); - } - else { - value = static_cast(value * _sensitivity); - } + if (t.isSticky) { + value = rawValue - joystickCameraState->prevAxisValues[i]; + joystickCameraState->prevAxisValues[i] = rawValue; + } - switch (t.type) { + if (std::fabs(value) <= t.deadzone) { + continue; + } + + if (t.normalize) { + value = (value + 1.f) / 2.f; + } + + if (t.invert) { + value *= -1.f; + } + + if (std::abs(t.sensitivity) > std::numeric_limits::epsilon()) { + value = static_cast(value * t.sensitivity * _sensitivity); + } + else { + value = static_cast(value * _sensitivity); + } + + switch (t.type) { case AxisType::None: break; case AxisType::OrbitX: globalRotation.first = true; - globalRotation.second.x = value; + globalRotation.second.x += value; break; case AxisType::OrbitY: globalRotation.first = true; - globalRotation.second.y = value; + globalRotation.second.y += value; break; case AxisType::Zoom: case AxisType::ZoomIn: @@ -101,28 +118,47 @@ void JoystickCameraStates::updateStateFromInput( break; case AxisType::LocalRollX: localRoll.first = true; - localRoll.second.x = value; + localRoll.second.x += value; break; case AxisType::LocalRollY: localRoll.first = true; - localRoll.second.y = value; + localRoll.second.y += value; break; case AxisType::GlobalRollX: globalRoll.first = true; - globalRoll.second.x = value; + globalRoll.second.x += value; break; case AxisType::GlobalRollY: globalRoll.first = true; - globalRoll.second.y = value; + globalRoll.second.y += value; break; case AxisType::PanX: localRotation.first = true; - localRotation.second.x = value; + localRotation.second.x += value; break; case AxisType::PanY: localRotation.first = true; - localRotation.second.y = value; + localRotation.second.y += value; break; + } + } + + for (int i = 0; i < JoystickInputState::MaxButtons; ++i) { + auto itRange = joystickCameraState->buttonMapping.equal_range(i); + for (auto it = itRange.first; it != itRange.second; ++it) { + bool active =global::joystickInputStates->button( + joystickInputState.name, + i, + it->second.action + ); + + if (active) { + global::scriptEngine->queueScript( + it->second.command, + scripting::ScriptEngine::RemoteScripting(it->second.synchronization) + ); + } + } } } @@ -160,23 +196,10 @@ void JoystickCameraStates::updateStateFromInput( else { _localRotationState.velocity.decelerate(deltaTime); } - - for (int i = 0; i < JoystickInputState::MaxButtons; ++i) { - auto itRange = _buttonMapping.equal_range(i); - for (auto it = itRange.first; it != itRange.second; ++it) { - bool active = global::joystickInputStates->button(i, it->second.action); - - if (active) { - global::scriptEngine->queueScript( - it->second.command, - scripting::ScriptEngine::RemoteScripting(it->second.synchronization) - ); - } - } - } } -void JoystickCameraStates::setAxisMapping(int axis, AxisType mapping, +void JoystickCameraStates::setAxisMapping(const std::string& joystickName, + int axis, AxisType mapping, AxisInvert shouldInvert, AxisNormalize shouldNormalize, bool isSticky, @@ -184,48 +207,119 @@ void JoystickCameraStates::setAxisMapping(int axis, AxisType mapping, { ghoul_assert(axis < JoystickInputState::MaxAxes, "axis must be < MaxAxes"); - _axisMapping[axis].type = mapping; - _axisMapping[axis].invert = shouldInvert; - _axisMapping[axis].normalize = shouldNormalize; - _axisMapping[axis].isSticky = isSticky; - _axisMapping[axis].sensitivity = sensitivity; - - if (isSticky) { - global::joystickInputStates->at(axis).isSticky = true; + JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + if (!joystickCameraState) { + if (_joystickCameraStates.size() < JoystickInputStates::MaxNumJoysticks) { + _joystickCameraStates.push_back(JoystickCameraState()); + joystickCameraState = &_joystickCameraStates.back(); + joystickCameraState->joystickName = joystickName; + } + else { + LWARNING(fmt::format("Cannot add more joysticks, only {} joysticks are " + "supported", JoystickInputStates::MaxNumJoysticks)); + return; + } } - _prevAxisValues[axis] = global::joystickInputStates->axis(axis); + joystickCameraState->axisMapping[axis].type = mapping; + joystickCameraState->axisMapping[axis].invert = shouldInvert; + joystickCameraState->axisMapping[axis].normalize = shouldNormalize; + joystickCameraState->axisMapping[axis].isSticky = isSticky; + joystickCameraState->axisMapping[axis].sensitivity = sensitivity; + + joystickCameraState->prevAxisValues[axis] = + global::joystickInputStates->axis(joystickName, axis); } -JoystickCameraStates::AxisInformation JoystickCameraStates::axisMapping(int axis) const { - return _axisMapping[axis]; +JoystickCameraStates::AxisInformation JoystickCameraStates::axisMapping( + const std::string& joystickName, + int axis) const +{ + const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + if (!joystickCameraState) { + LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}' " + "(axisMapping)", joystickName)); + JoystickCameraStates::AxisInformation dummy; + return dummy; + } + + return joystickCameraState->axisMapping[axis]; } -void JoystickCameraStates::setDeadzone(int axis, float deadzone) { - _axisMapping[axis].deadzone = deadzone; +void JoystickCameraStates::setDeadzone(const std::string& joystickName, int axis, + float deadzone) +{ + JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + if (!joystickCameraState) { + if (_joystickCameraStates.size() < JoystickInputStates::MaxNumJoysticks) { + _joystickCameraStates.push_back(JoystickCameraState()); + joystickCameraState = &_joystickCameraStates.back(); + joystickCameraState->joystickName = joystickName; + } + else { + LWARNING(fmt::format("Cannot add more joysticks, only {} joysticks are " + "supported", JoystickInputStates::MaxNumJoysticks)); + return; + } + } + + joystickCameraState->axisMapping[axis].deadzone = deadzone; } -float JoystickCameraStates::deadzone(int axis) const { - return _axisMapping[axis].deadzone; +float JoystickCameraStates::deadzone(const std::string& joystickName, int axis) const { + const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + if (!joystickCameraState) { + LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}' (deadzone)", + joystickName)); + return 0.0f; + } + + return joystickCameraState->axisMapping[axis].deadzone; } -void JoystickCameraStates::bindButtonCommand(int button, std::string command, +void JoystickCameraStates::bindButtonCommand(const std::string& joystickName, + int button, std::string command, JoystickAction action, ButtonCommandRemote remote, std::string documentation) { - _buttonMapping.insert({ + JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + if (!joystickCameraState) { + if (_joystickCameraStates.size() < JoystickInputStates::MaxNumJoysticks) { + _joystickCameraStates.push_back(JoystickCameraState()); + joystickCameraState = &_joystickCameraStates.back(); + joystickCameraState->joystickName = joystickName; + } + else { + LWARNING(fmt::format("Cannot add more joysticks, only {} joysticks are " + "supported", JoystickInputStates::MaxNumJoysticks)); + return; + } + } + + joystickCameraState->buttonMapping.insert({ button, { std::move(command), action, remote, std::move(documentation) } }); } -void JoystickCameraStates::clearButtonCommand(int button) { - for (auto it = _buttonMapping.begin(); it != _buttonMapping.end();) { +void JoystickCameraStates::clearButtonCommand(const std::string& joystickName, + int button) +{ + JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + if (!joystickCameraState) { + LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}' " + "(clearButtonCommand)", joystickName)); + return; + } + + for (auto it = joystickCameraState->buttonMapping.begin(); + it != joystickCameraState->buttonMapping.end(); ) + { // If the current iterator is the button that we are looking for, delete it // (std::multimap::erase will return the iterator to the next element for us) if (it->first == button) { - it = _buttonMapping.erase(it); + it = joystickCameraState->buttonMapping.erase(it); } else { ++it; @@ -233,14 +327,48 @@ void JoystickCameraStates::clearButtonCommand(int button) { } } -std::vector JoystickCameraStates::buttonCommand(int button) const { +std::vector JoystickCameraStates::buttonCommand( + const std::string& joystickName, + int button) const +{ std::vector result; - auto itRange = _buttonMapping.equal_range(button); + const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + if (!joystickCameraState) { + LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}' " + "(buttonCommand)", joystickName)); + return result; + } + + auto itRange = joystickCameraState->buttonMapping.equal_range(button); for (auto it = itRange.first; it != itRange.second; ++it) { result.push_back(it->second.command); } return result; } +JoystickCameraStates::JoystickCameraState* JoystickCameraStates::getJoystickCameraState( + const std::string& joystickName) +{ + for (JoystickCameraState& joystickCameraState : _joystickCameraStates) { + if (joystickCameraState.joystickName == joystickName) { + return &joystickCameraState; + } + } + + return nullptr; +} + +const JoystickCameraStates::JoystickCameraState* JoystickCameraStates::getJoystickCameraState( + const std::string& joystickName) const +{ + for (const JoystickCameraState& joystickCameraState : _joystickCameraStates) { + if (joystickCameraState.joystickName == joystickName) { + return &joystickCameraState; + } + } + + return nullptr; +} + } // namespace openspace::interaction diff --git a/src/interaction/joystickinputstate.cpp b/src/interaction/joystickinputstate.cpp index 4a5537a353..9c0da27225 100644 --- a/src/interaction/joystickinputstate.cpp +++ b/src/interaction/joystickinputstate.cpp @@ -33,38 +33,68 @@ namespace openspace::interaction { -float JoystickInputStates::axis(int axis) const { +float JoystickInputStates::axis(const std::string& joystickName, int axis) const { ghoul_precondition(axis >= 0, "axis must be 0 or positive"); - float res = std::accumulate( - begin(), - end(), - 0.f, - [axis](float value, const JoystickInputState& state) { - if (state.isConnected) { - value += state.axes[axis]; + if(joystickName.empty()) { + float res = std::accumulate( + begin(), + end(), + 0.f, + [axis](float value, const JoystickInputState& state) { + if (state.isConnected) { + value += state.axes[axis]; + } + return value; } - return value; - } - ); + ); - // If multiple joysticks are connected, we might get values outside the -1,1 range by - // summing them up - glm::clamp(res, -1.f, 1.f); - return res; + // If multiple joysticks are connected, we might get values outside the -1,1 range by + // summing them up + glm::clamp(res, -1.f, 1.f); + return res; + } + + const JoystickInputState* state = nullptr; + for (auto it = begin(); it < end(); ++it) { + if (it->name == joystickName) { + state = &(*it); + } + } + + if (!state) { + return 0.0f; + } + + return state->axes[axis]; } -bool JoystickInputStates::button(int button, JoystickAction action) const { +bool JoystickInputStates::button(const std::string& joystickName, int button, JoystickAction action) const { ghoul_precondition(button >= 0, "button must be 0 or positive"); - bool res = std::any_of( - begin(), - end(), - [button, action](const JoystickInputState& state) { - return state.isConnected ? (state.buttons[button] == action) : false; + if(joystickName.empty()) { + bool res = std::any_of( + begin(), + end(), + [button, action](const JoystickInputState& state) { + return state.isConnected ? (state.buttons[button] == action) : false; + } + ); + return res; + } + + const JoystickInputState* state = nullptr; + for (auto it = begin(); it < end(); ++it) { + if (it->name == joystickName) { + state = &(*it); } - ); - return res; + } + + if (!state) { + return false; + } + + return state->isConnected ? (state->buttons[button] == action) : false; } } // namespace openspace::interaction diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index 43da79c0dd..8a2d67ae9f 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -498,7 +498,7 @@ void NavigationHandler::loadNavigationState(const std::string& filepath) { } } -void NavigationHandler::setJoystickAxisMapping(int axis, +void NavigationHandler::setJoystickAxisMapping(const std::string& joystickName, int axis, JoystickCameraStates::AxisType mapping, JoystickCameraStates::AxisInvert shouldInvert, JoystickCameraStates::AxisNormalize shouldNormalize, @@ -506,6 +506,7 @@ void NavigationHandler::setJoystickAxisMapping(int axis, double sensitivity) { _orbitalNavigator.joystickStates().setAxisMapping( + joystickName, axis, mapping, shouldInvert, @@ -530,25 +531,31 @@ void NavigationHandler::setWebsocketAxisMapping(int axis, JoystickCameraStates::AxisInformation -NavigationHandler::joystickAxisMapping(int axis) const +NavigationHandler::joystickAxisMapping(const std::string& joystickName, int axis) const { - return _orbitalNavigator.joystickStates().axisMapping(axis); + return _orbitalNavigator.joystickStates().axisMapping(joystickName, axis); } -void NavigationHandler::setJoystickAxisDeadzone(int axis, float deadzone) { - _orbitalNavigator.joystickStates().setDeadzone(axis, deadzone); +void NavigationHandler::setJoystickAxisDeadzone(const std::string& joystickName, int axis, + float deadzone) +{ + _orbitalNavigator.joystickStates().setDeadzone(joystickName, axis, deadzone); } -float NavigationHandler::joystickAxisDeadzone(int axis) const { - return _orbitalNavigator.joystickStates().deadzone(axis); +float NavigationHandler::joystickAxisDeadzone(const std::string& joystickName, + int axis) const +{ + return _orbitalNavigator.joystickStates().deadzone(joystickName, axis); } -void NavigationHandler::bindJoystickButtonCommand(int button, std::string command, +void NavigationHandler::bindJoystickButtonCommand(const std::string& joystickName, + int button, std::string command, JoystickAction action, JoystickCameraStates::ButtonCommandRemote remote, std::string documentation) { _orbitalNavigator.joystickStates().bindButtonCommand( + joystickName, button, std::move(command), action, @@ -557,12 +564,16 @@ void NavigationHandler::bindJoystickButtonCommand(int button, std::string comman ); } -void NavigationHandler::clearJoystickButtonCommand(int button) { - _orbitalNavigator.joystickStates().clearButtonCommand(button); +void NavigationHandler::clearJoystickButtonCommand(const std::string& joystickName, + int button) +{ + _orbitalNavigator.joystickStates().clearButtonCommand(joystickName, button); } -std::vector NavigationHandler::joystickButtonCommand(int button) const { - return _orbitalNavigator.joystickStates().buttonCommand(button); +std::vector NavigationHandler::joystickButtonCommand( + const std::string& joystickName, int button) const +{ + return _orbitalNavigator.joystickStates().buttonCommand(joystickName, button); } scripting::LuaLibrary NavigationHandler::luaLibrary() { diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index 02cb94216c..59795a2bf9 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -151,10 +151,11 @@ int retargetAim(lua_State* L) { } int bindJoystickAxis(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, { 2, 6 }, "lua::bindJoystickAxis"); - auto [axis, axisType, shouldInvert, shouldNormalize, isSticky, sensitivity] = + ghoul::lua::checkArgumentsAndThrow(L, { 3, 7 }, "lua::bindJoystickAxis"); + auto [joystickName, axis, axisType, shouldInvert, shouldNormalize, isSticky, + sensitivity] = ghoul::lua::values< - int, std::string, std::optional, std::optional, + std::string, int, std::string, std::optional, std::optional, std::optional, std::optional >(L); shouldInvert = shouldInvert.value_or(false); @@ -163,6 +164,7 @@ int bindJoystickAxis(lua_State* L) { sensitivity = sensitivity.value_or(0.0); global::navigationHandler->setJoystickAxisMapping( + joystickName, axis, ghoul::from_string(axisType), interaction::JoystickCameraStates::AxisInvert(*shouldInvert), @@ -174,11 +176,11 @@ int bindJoystickAxis(lua_State* L) { } int joystickAxis(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::joystickAxis"); - const int axis = ghoul::lua::value(L); + ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::joystickAxis"); + auto [joystickName, axis] = ghoul::lua::values(L); using AI = interaction::JoystickCameraStates::AxisInformation; - AI info = global::navigationHandler->joystickAxisMapping(axis); + AI info = global::navigationHandler->joystickAxisMapping(joystickName, axis); ghoul::lua::push( L, @@ -192,27 +194,32 @@ int joystickAxis(lua_State* L) { } int setJoystickAxisDeadzone(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::setJoystickAxisDeadzone"); - auto [axis, deadzone] = ghoul::lua::values(L); + ghoul::lua::checkArgumentsAndThrow(L, 3, "lua::setJoystickAxisDeadzone"); + auto [joystickName, axis, deadzone] = ghoul::lua::values(L); - global::navigationHandler->setJoystickAxisDeadzone(axis, deadzone); + global::navigationHandler->setJoystickAxisDeadzone(joystickName, axis, deadzone); return 0; } int joystickAxisDeadzone(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::joystickAxisDeadzone"); - const int axis = ghoul::lua::value(L); + ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::joystickAxisDeadzone"); + auto [joystickName, axis] = ghoul::lua::values(L); - const float deadzone = global::navigationHandler->joystickAxisDeadzone(axis); + const float deadzone = global::navigationHandler->joystickAxisDeadzone(joystickName, axis); ghoul::lua::push(L, deadzone); return 1; } int bindJoystickButton(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, { 3, 5 }, "lua::bindJoystickButton"); - auto [button, command, documentation, actionStr, isRemote] = + ghoul::lua::checkArgumentsAndThrow(L, { 4, 6 }, "lua::bindJoystickButton"); + auto [joystickName, button, command, documentation, actionStr, isRemote] = ghoul::lua::values< - int, std::string, std::string, std::optional, std::optional + std::string, + int, + std::string, + std::string, + std::optional, + std::optional >(L); actionStr = actionStr.value_or("Press"); isRemote = isRemote.value_or(true); @@ -221,6 +228,7 @@ int bindJoystickButton(lua_State* L) { ghoul::from_string(*actionStr); global::navigationHandler->bindJoystickButtonCommand( + joystickName, button, command, action, @@ -231,18 +239,19 @@ int bindJoystickButton(lua_State* L) { } int clearJoystickButton(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::clearJoystickButton"); - const int button = ghoul::lua::value(L); - global::navigationHandler->clearJoystickButtonCommand(button); + ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::clearJoystickButton"); + auto [joystickName, button] = ghoul::lua::values(L); + + global::navigationHandler->clearJoystickButtonCommand(joystickName, button); return 0; } int joystickButton(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::joystickButton"); - const int button = ghoul::lua::value(L); + ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::joystickButton"); + auto [joystickName, button] = ghoul::lua::values(L); const std::vector& cmds = - global::navigationHandler->joystickButtonCommand(button); + global::navigationHandler->joystickButtonCommand(joystickName, button); std::string cmd = std::accumulate( cmds.cbegin(), From 5ed69aea6b460d96126bb908b48abf86192a910c Mon Sep 17 00:00:00 2001 From: Malin E Date: Fri, 5 Nov 2021 13:03:10 +0100 Subject: [PATCH 004/117] Update joysitck assets * NOTE: Xbox and PS4 names have not yet been added --- .../util/joysticks/joystick_helper.asset | 20 ++++---- data/assets/util/joysticks/ps4.asset | 48 +++++++++++-------- .../joysticks/space-mouse-not-sticky.asset | 29 ++++++----- data/assets/util/joysticks/space-mouse.asset | 29 ++++++----- data/assets/util/joysticks/xbox.asset | 46 +++++++++++------- 5 files changed, 99 insertions(+), 73 deletions(-) diff --git a/data/assets/util/joysticks/joystick_helper.asset b/data/assets/util/joysticks/joystick_helper.asset index 106c9dc901..eadff7fa2f 100644 --- a/data/assets/util/joysticks/joystick_helper.asset +++ b/data/assets/util/joysticks/joystick_helper.asset @@ -4,7 +4,7 @@ Joystick.State = {} Joystick.State.IsInRollMode = false Joystick.State.Axis = {} -local bindLocalRoll = function(axis) +local bindLocalRoll = function(name, axis) return [[ -- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup if not Joystick.State.IsInRollMode then @@ -13,12 +13,12 @@ local bindLocalRoll = function(axis) end -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); Joystick.State.IsInRollMode = true ]] end -local bindGlobalRoll = function(axis) +local bindGlobalRoll = function(name, axis) return [[ -- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup if not Joystick.State.IsInRollMode then @@ -27,35 +27,35 @@ local bindGlobalRoll = function(axis) end -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); Joystick.State.IsInRollMode = true ]] end -local permaBindLocalRoll = function(axis) +local permaBindLocalRoll = function(name, axis) return [[ -- Save current axis state Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); ]] end -local permaBindGlobalRoll = function(axis) +local permaBindGlobalRoll = function(name, axis) return [[ -- Save current axis state Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); ]] end -local unbindRoll = function(axis) +local unbindRoll = function(name, axis) return [[ -- Reset previous state - openspace.navigation.bindJoystickAxis(]] .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); ]] end diff --git a/data/assets/util/joysticks/ps4.asset b/data/assets/util/joysticks/ps4.asset index e9f7aab684..d8135783ec 100644 --- a/data/assets/util/joysticks/ps4.asset +++ b/data/assets/util/joysticks/ps4.asset @@ -1,7 +1,7 @@ local propertyHelper = asset.require('../property_helper') local joystickHelper = asset.require('./joystick_helper') --- Allowed values for the second parameter of bindJoystickAxis: +-- Allowed values for the third parameter of bindJoystickAxis: -- "None" -- "Orbit X" -- "Orbit Y" @@ -14,13 +14,13 @@ local joystickHelper = asset.require('./joystick_helper') -- "GlobalRoll Y" -- "Pan X" -- "Pan Y" --- Third parameter determines whether the axis should be inverted --- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1] --- Fifth parameters determins if the axis should be "Sticky" or not. +-- Fourth parameter determines whether the axis should be inverted +-- Fifth parameter determines whether the axis should be normalized from [-1,1] to [0,1] +-- Sixth parameters determins if the axis should be "Sticky" or not. -- The axis values can either go back to 0 when the joystick is released or it can -- stay at the value it was before the joystick was released. -- The latter is called a sticky axis, when the values don't go back to 0. --- Sixth parameter is the sensitivity for the axis +-- Seventh parameter is the sensitivity for the axis local PS4Controller = { LeftThumbStick = { 0 , 1 }, @@ -49,59 +49,68 @@ local PS4Controller = { asset.onInitialize(function() local controller = PS4Controller; + local name = ""; - openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[1], 0.15) - openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[2], 0.15) - openspace.navigation.setAxisDeadZone(controller.RightThumbStick[1], 0.15) - openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], 0.15) - openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[1], "Orbit X"); - openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[2], "Orbit Y", true); - openspace.navigation.bindJoystickAxis(controller.RightThumbStick[1], "Pan X", true); - openspace.navigation.bindJoystickAxis(controller.RightThumbStick[2], "Pan Y", true); - openspace.navigation.bindJoystickAxis(controller.L2, "Zoom Out", false, true); - openspace.navigation.bindJoystickAxis(controller.R2, "Zoom In", false, true); + openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[1], "Orbit X"); + openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[2], "Orbit Y", true); + openspace.navigation.bindJoystickAxis(name, controller.RightThumbStick[1], "Pan X", true); + openspace.navigation.bindJoystickAxis(name, controller.RightThumbStick[2], "Pan Y", true); + openspace.navigation.bindJoystickAxis(name, controller.L2, "Zoom Out", false, true); + openspace.navigation.bindJoystickAxis(name, controller.R2, "Zoom In", false, true); openspace.navigation.bindJoystickButton( + name, controller.L1, - joystickHelper.bindLocalRoll(controller.RightThumbStick[1]), + joystickHelper.bindLocalRoll(name, controller.RightThumbStick[1]), "Switch to local roll mode" ) openspace.navigation.bindJoystickButton( + name, controller.L1, - joystickHelper.unbindRoll(controller.RightThumbStick[1]), + joystickHelper.unbindRoll(name, controller.RightThumbStick[1]), "Switch back to normal mode", "Release" ) openspace.navigation.bindJoystickButton( + name, controller.R1, - joystickHelper.bindGlobalRoll(controller.RightThumbStick[1]), + joystickHelper.bindGlobalRoll(name, controller.RightThumbStick[1]), "Switch to global roll mode" ) openspace.navigation.bindJoystickButton( + name, controller.R1, - joystickHelper.unbindRoll(controller.RightThumbStick[1]), + joystickHelper.unbindRoll(name, controller.RightThumbStick[1]), "Switch back to normal mode", "Release" ) openspace.navigation.bindJoystickButton( + name, controller.Cross, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'), "Toggle zoom friction" ) openspace.navigation.bindJoystickButton( + name, controller.Circle, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'), "Toggle rotational friction" ) openspace.navigation.bindJoystickButton( + name, controller.DPad.Left, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'), "Toggle roll friction" ) openspace.navigation.bindJoystickButton( + name, controller.Square, "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" .. "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');" .. @@ -109,6 +118,7 @@ asset.onInitialize(function() "Switch target to Earth" ) openspace.navigation.bindJoystickButton( + name, controller.Triangle, "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" .. "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Mars');" .. diff --git a/data/assets/util/joysticks/space-mouse-not-sticky.asset b/data/assets/util/joysticks/space-mouse-not-sticky.asset index 7140adae0b..a4a06154a7 100644 --- a/data/assets/util/joysticks/space-mouse-not-sticky.asset +++ b/data/assets/util/joysticks/space-mouse-not-sticky.asset @@ -1,7 +1,7 @@ local propertyHelper = asset.require('../property_helper') local joystickHelper = asset.require('./joystick_helper') --- Allowed values for the second parameter of bindJoystickAxis: +-- Allowed values for the third parameter of bindJoystickAxis: -- "None" -- "Orbit X" -- "Orbit Y" @@ -14,14 +14,14 @@ local joystickHelper = asset.require('./joystick_helper') -- "GlobalRoll Y" -- "Pan X" -- "Pan Y" --- Third parameter determines whether the axis should be inverted --- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1] --- Fifth parameters determins if the axis should be "Sticky" or not. +-- Fourth parameter determines whether the axis should be inverted +-- Fifth parameter determines whether the axis should be normalized from [-1,1] to [0,1] +-- Sixth parameters determins if the axis should be "Sticky" or not. -- The axis values can either go back to 0 when the joystick is released or it can -- stay at the value it was before the joystick was released. -- The latter is called a sticky axis, when the values don't go back to 0. -- This version of the SpaceMouse is NOT Sticky. --- Sixth parameter is the sensitivity for the axis +-- Seventh parameter is the sensitivity for the axis local SpaceMouse = { Push = {0, 1, 2}, -- left/right, back/forth, up/down @@ -33,23 +33,26 @@ local SpaceMouse = { asset.onInitialize(function() local controller = SpaceMouse; + local name = "SpaceNavigator"; - openspace.navigation.bindJoystickAxis(controller.Push[1], "Orbit X", false); - openspace.navigation.bindJoystickAxis(controller.Push[2], "Orbit Y", false); - openspace.navigation.bindJoystickAxis(controller.Twist[1], "Pan X", true); - openspace.navigation.bindJoystickAxis(controller.Tilt[2], "Pan Y", false); - openspace.navigation.bindJoystickAxis(controller.Push[3], "Zoom", false); - openspace.navigation.bindJoystickAxis(controller.Tilt[1], "LocalRoll X", false); + openspace.navigation.bindJoystickAxis(name, controller.Push[1], "Orbit X", false); + openspace.navigation.bindJoystickAxis(name, controller.Push[2], "Orbit Y", false); + openspace.navigation.bindJoystickAxis(name, controller.Twist[1], "Pan X", true); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[2], "Pan Y", false); + openspace.navigation.bindJoystickAxis(name, controller.Push[3], "Zoom", false); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[1], "LocalRoll X", false); openspace.navigation.bindJoystickButton( + name, controller.LeftButton, - joystickHelper.permaBindLocalRoll(controller.Tilt[1]), + joystickHelper.permaBindLocalRoll(name, controller.Tilt[1]), "Switch to local roll mode" ) openspace.navigation.bindJoystickButton( + name, controller.RightButton, - joystickHelper.permaBindGlobalRoll(controller.Tilt[1]), + joystickHelper.permaBindGlobalRoll(name, controller.Tilt[1]), "Switch to global roll mode" ) end) diff --git a/data/assets/util/joysticks/space-mouse.asset b/data/assets/util/joysticks/space-mouse.asset index 36152e9b06..96c1bf3a95 100644 --- a/data/assets/util/joysticks/space-mouse.asset +++ b/data/assets/util/joysticks/space-mouse.asset @@ -1,7 +1,7 @@ local propertyHelper = asset.require('../property_helper') local joystickHelper = asset.require('./joystick_helper') --- Allowed values for the second parameter of bindJoystickAxis: +-- Allowed values for the third parameter of bindJoystickAxis: -- "None" -- "Orbit X" -- "Orbit Y" @@ -14,14 +14,14 @@ local joystickHelper = asset.require('./joystick_helper') -- "GlobalRoll Y" -- "Pan X" -- "Pan Y" --- Third parameter determines whether the axis should be inverted --- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1] --- Fifth parameters determins if the axis should be "Sticky" or not. +-- Fourth parameter determines whether the axis should be inverted +-- Fifth parameter determines whether the axis should be normalized from [-1,1] to [0,1] +-- Sixth parameters determins if the axis should be "Sticky" or not. -- The axis values can either go back to 0 when the joystick is released or it can -- stay at the value it was before the joystick was released. -- The latter is called a sticky axis, when the values don't go back to 0. -- This version of the SpaceMouse IS Sticky. --- Sixth parameter is the sensitivity for the axis +-- Seventh parameter is the sensitivity for the axis local SpaceMouse = { Push = {0, 1, 2}, -- left/right, back/forth, up/down @@ -33,23 +33,26 @@ local SpaceMouse = { asset.onInitialize(function() local controller = SpaceMouse; + local name = "SpaceNavigator"; - openspace.navigation.bindJoystickAxis(controller.Push[1], "Orbit X", false, false, true, 40.0); - openspace.navigation.bindJoystickAxis(controller.Push[2], "Orbit Y", false, false, true, 40.0); - openspace.navigation.bindJoystickAxis(controller.Twist[1], "Pan X", true, false, true, 40.0); - openspace.navigation.bindJoystickAxis(controller.Tilt[2], "Pan Y", false, false, true, 35.0); - openspace.navigation.bindJoystickAxis(controller.Push[3], "Zoom", false, false, true, 40.0); - openspace.navigation.bindJoystickAxis(controller.Tilt[1], "LocalRoll X", false, false, true, 35.0); + openspace.navigation.bindJoystickAxis(name, controller.Push[1], "Orbit X", false, false, true, 40.0); + openspace.navigation.bindJoystickAxis(name, controller.Push[2], "Orbit Y", false, false, true, 40.0); + openspace.navigation.bindJoystickAxis(name, controller.Twist[1], "Pan X", true, false, true, 40.0); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[2], "Pan Y", false, false, true, 35.0); + openspace.navigation.bindJoystickAxis(name, controller.Push[3], "Zoom", false, false, true, 40.0); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[1], "LocalRoll X", false, false, true, 35.0); openspace.navigation.bindJoystickButton( + name, controller.LeftButton, - joystickHelper.permaBindLocalRoll(controller.Tilt[1]), + joystickHelper.permaBindLocalRoll(name, controller.Tilt[1]), "Switch to local roll mode" ) openspace.navigation.bindJoystickButton( + name, controller.RightButton, - joystickHelper.permaBindGlobalRoll(controller.Tilt[1]), + joystickHelper.permaBindGlobalRoll(name, controller.Tilt[1]), "Switch to global roll mode" ) end) diff --git a/data/assets/util/joysticks/xbox.asset b/data/assets/util/joysticks/xbox.asset index d252965ee1..bd67c5a56b 100644 --- a/data/assets/util/joysticks/xbox.asset +++ b/data/assets/util/joysticks/xbox.asset @@ -1,7 +1,7 @@ local propertyHelper = asset.require('../property_helper') local joystickHelper = asset.require('./joystick_helper') --- Allowed values for the second parameter of bindJoystickAxis: +-- Allowed values for the third parameter of bindJoystickAxis: -- "None" -- "Orbit X" -- "Orbit Y" @@ -14,13 +14,13 @@ local joystickHelper = asset.require('./joystick_helper') -- "GlobalRoll Y" -- "Pan X" -- "Pan Y" --- Third parameter determines whether the axis should be inverted --- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1] --- Fifth parameters determins if the axis should be "Sticky" or not. +-- Fourth parameter determines whether the axis should be inverted +-- Fifth parameter determines whether the axis should be normalized from [-1,1] to [0,1] +-- Sixth parameters determins if the axis should be "Sticky" or not. -- The axis values can either go back to 0 when the joystick is released or it can -- stay at the value it was before the joystick was released. -- The latter is called a sticky axis, when the values don't go back to 0. --- Sixth parameter is the sensitivity for the axis +-- Seventh parameter is the sensitivity for the axis local XBoxController = { LeftThumbStick = { 0 , 1 }, @@ -47,59 +47,68 @@ local XBoxController = { asset.onInitialize(function() local controller = XBoxController; + local name = ""; - openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[1], 0.15) - openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[2], 0.15) - openspace.navigation.setAxisDeadZone(controller.RightThumbStick[1], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], 0.15) openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.15) - openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[1], "Orbit X"); - openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[2], "Orbit Y", true); - openspace.navigation.bindJoystickAxis(controller.RightThumbStick[1], "Pan X", true); - openspace.navigation.bindJoystickAxis(controller.RightThumbStick[2], "Pan Y", true); - openspace.navigation.bindJoystickAxis(controller.LeftTrigger, "Zoom Out", false, true); - openspace.navigation.bindJoystickAxis(controller.RightTrigger, "Zoom In", false, true); + openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[1], "Orbit X"); + openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[2], "Orbit Y", true); + openspace.navigation.bindJoystickAxis(name, controller.RightThumbStick[1], "Pan X", true); + openspace.navigation.bindJoystickAxis(name, controller.RightThumbStick[2], "Pan Y", true); + openspace.navigation.bindJoystickAxis(name, controller.LeftTrigger, "Zoom Out", false, true); + openspace.navigation.bindJoystickAxis(name, controller.RightTrigger, "Zoom In", false, true); openspace.navigation.bindJoystickButton( + name, controller.LB, - joystickHelper.bindLocalRoll(controller.RightThumbStick[1]), + joystickHelper.bindLocalRoll(name, controller.RightThumbStick[1]), "Switch to local roll mode" ) openspace.navigation.bindJoystickButton( + name, controller.LB, - joystickHelper.unbindRoll(controller.RightThumbStick[1]), + joystickHelper.unbindRoll(name, controller.RightThumbStick[1]), "Switch back to normal mode", "Release" ) openspace.navigation.bindJoystickButton( + name, controller.RB, - joystickHelper.bindGlobalRoll(controller.RightThumbStick[1]), + joystickHelper.bindGlobalRoll(name, controller.RightThumbStick[1]), "Switch to global roll mode" ) openspace.navigation.bindJoystickButton( + name, controller.RB, - joystickHelper.unbindRoll(controller.RightThumbStick[1]), + joystickHelper.unbindRoll(name, controller.RightThumbStick[1]), "Switch back to normal mode", "Release" ) openspace.navigation.bindJoystickButton( + name, controller.A, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'), "Toggle zoom friction" ) openspace.navigation.bindJoystickButton( + name, controller.B, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'), "Toggle rotational friction" ) openspace.navigation.bindJoystickButton( + name, controller.DPad.Left, propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'), "Toggle roll friction" ) openspace.navigation.bindJoystickButton( + name, controller.X, "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" .. "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');" .. @@ -107,6 +116,7 @@ asset.onInitialize(function() "Switch target to Earth" ) openspace.navigation.bindJoystickButton( + name, controller.Y, "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" .. "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Mars');" .. From 2b4e1ae8fd749e4a47b597e19fbbb39ad7ca5224 Mon Sep 17 00:00:00 2001 From: Malin E Date: Thu, 11 Nov 2021 09:26:04 +0100 Subject: [PATCH 005/117] Update name in PS4 and Xbox assets --- data/assets/util/joysticks/ps4.asset | 2 +- data/assets/util/joysticks/xbox.asset | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/assets/util/joysticks/ps4.asset b/data/assets/util/joysticks/ps4.asset index d8135783ec..2c4dceebec 100644 --- a/data/assets/util/joysticks/ps4.asset +++ b/data/assets/util/joysticks/ps4.asset @@ -49,7 +49,7 @@ local PS4Controller = { asset.onInitialize(function() local controller = PS4Controller; - local name = ""; + local name = "Wireless Controller"; openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], 0.15) openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15) diff --git a/data/assets/util/joysticks/xbox.asset b/data/assets/util/joysticks/xbox.asset index bd67c5a56b..6b1f136e80 100644 --- a/data/assets/util/joysticks/xbox.asset +++ b/data/assets/util/joysticks/xbox.asset @@ -47,7 +47,7 @@ local XBoxController = { asset.onInitialize(function() local controller = XBoxController; - local name = ""; + local name = "Xbox Controller"; openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], 0.15) openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15) From a515f852345b8e9cd281aff140ecebe1bc996ee8 Mon Sep 17 00:00:00 2001 From: Malin E Date: Thu, 11 Nov 2021 09:27:54 +0100 Subject: [PATCH 006/117] Add ability to bind a joystick axis to a property value --- .../interaction/joystickcamerastates.h | 20 +- .../openspace/navigation/navigationhandler.h | 8 + src/interaction/joystickcamerastates.cpp | 206 ++++++++++-------- src/navigation/navigationhandler.cpp | 104 ++++++--- src/navigation/navigationhandler_lua.inl | 38 +++- 5 files changed, 257 insertions(+), 119 deletions(-) diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index 2ac5aa2f71..5c7d5a3171 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -49,7 +49,8 @@ public: GlobalRollX, GlobalRollY, PanX, - PanY + PanY, + Property }; BooleanType(AxisInvert); @@ -70,6 +71,12 @@ public: // Every axis can have their own sensitivity double sensitivity = 0.0; + + // The property info if the type is Property + std::string propertyUri; + float minValue = 0.f; + float maxValue = 1.f; + bool isRemote = true; }; JoystickCameraStates(double sensitivity, double velocityScaleFactor); @@ -83,6 +90,12 @@ public: bool isSticky = false, double sensitivity = 0.0 ); + void setAxisMappingProperty(const std::string& joystickName, int axis, + const std::string& propertyUri, float min = 0.f, float max = 1.f, + AxisInvert shouldInvert = AxisInvert::No, + bool isSticky = false, double sensitivity = 0.0, bool isRemote = true + ); + AxisInformation axisMapping(const std::string& joystickName, int axis) const; void setDeadzone(const std::string& joystickName, int axis, float deadzone); @@ -126,6 +139,10 @@ private: // return a pointer to the item, if not found then return nullptr JoystickCameraState* getJoystickCameraState(const std::string& joystickName); const JoystickCameraState* getJoystickCameraState(const std::string& joystickName) const; + + // Ues getJoystickCameraState(name) to find the joystickCameraState that + // corresponds to the given joystickName. If not found then add a new item if possible + JoystickCameraState* findOrAddJoystickCameraState(const std::string& joystickName); }; } // namespace openspace::interaction @@ -172,6 +189,7 @@ from_string(std::string_view string) if (string == "GlobalRoll Y") { return T::GlobalRollY; } if (string == "Pan X") { return T::PanX; } if (string == "Pan Y") { return T::PanY; } + if (string == "Property") { return T::Property; } throw RuntimeError("Unkonwn axis type '" + std::string(string) + "'"); } diff --git a/include/openspace/navigation/navigationhandler.h b/include/openspace/navigation/navigationhandler.h index 5fa4c105b4..3b2566b704 100644 --- a/include/openspace/navigation/navigationhandler.h +++ b/include/openspace/navigation/navigationhandler.h @@ -107,6 +107,14 @@ public: bool isSticky = false, double sensitivity = 0.0 ); + void setJoystickAxisMappingProperty(const std::string& joystickName, + int axis, const std::string& propertyUri, + float min = 0.f, float max = 1.f, + JoystickCameraStates::AxisInvert shouldInvert = + JoystickCameraStates::AxisInvert::No, + bool isSticky = false, double sensitivity = 0.0, bool isRemote = true + ); + JoystickCameraStates::AxisInformation joystickAxisMapping( const std::string& joystickName, int axis) const; diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index 2eadf18a61..74ad9adaab 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -81,12 +81,16 @@ void JoystickCameraStates::updateStateFromInput( continue; } - if (t.normalize) { + if (t.invert) { + value *= -1.f; + } + + if (t.normalize || t.type == AxisType::Property) { value = (value + 1.f) / 2.f; } - if (t.invert) { - value *= -1.f; + if (t.type == AxisType::Property) { + value = value * (t.maxValue - t.minValue) + t.minValue; } if (std::abs(t.sensitivity) > std::numeric_limits::epsilon()) { @@ -97,56 +101,65 @@ void JoystickCameraStates::updateStateFromInput( } switch (t.type) { - case AxisType::None: - break; - case AxisType::OrbitX: - globalRotation.first = true; - globalRotation.second.x += value; - break; - case AxisType::OrbitY: - globalRotation.first = true; - globalRotation.second.y += value; - break; - case AxisType::Zoom: - case AxisType::ZoomIn: - zoom.first = true; - zoom.second += value; - break; - case AxisType::ZoomOut: - zoom.first = true; - zoom.second -= value; - break; - case AxisType::LocalRollX: - localRoll.first = true; - localRoll.second.x += value; - break; - case AxisType::LocalRollY: - localRoll.first = true; - localRoll.second.y += value; - break; - case AxisType::GlobalRollX: - globalRoll.first = true; - globalRoll.second.x += value; - break; - case AxisType::GlobalRollY: - globalRoll.first = true; - globalRoll.second.y += value; - break; - case AxisType::PanX: - localRotation.first = true; - localRotation.second.x += value; - break; - case AxisType::PanY: - localRotation.first = true; - localRotation.second.y += value; - break; + case AxisType::None: + break; + case AxisType::OrbitX: + globalRotation.first = true; + globalRotation.second.x += value; + break; + case AxisType::OrbitY: + globalRotation.first = true; + globalRotation.second.y += value; + break; + case AxisType::Zoom: + case AxisType::ZoomIn: + zoom.first = true; + zoom.second += value; + break; + case AxisType::ZoomOut: + zoom.first = true; + zoom.second -= value; + break; + case AxisType::LocalRollX: + localRoll.first = true; + localRoll.second.x += value; + break; + case AxisType::LocalRollY: + localRoll.first = true; + localRoll.second.y += value; + break; + case AxisType::GlobalRollX: + globalRoll.first = true; + globalRoll.second.x += value; + break; + case AxisType::GlobalRollY: + globalRoll.first = true; + globalRoll.second.y += value; + break; + case AxisType::PanX: + localRotation.first = true; + localRotation.second.x += value; + break; + case AxisType::PanY: + localRotation.first = true; + localRotation.second.y += value; + break; + case AxisType::Property: + std::string script = "openspace.setPropertyValue(\"" + + t.propertyUri + "\", " + std::to_string(value) + ");"; + + global::scriptEngine->queueScript( + script, + scripting::ScriptEngine::RemoteScripting(t.isRemote) + ); + break; } } for (int i = 0; i < JoystickInputState::MaxButtons; ++i) { auto itRange = joystickCameraState->buttonMapping.equal_range(i); for (auto it = itRange.first; it != itRange.second; ++it) { - bool active =global::joystickInputStates->button( + bool active = global::joystickInputStates->button( joystickInputState.name, i, it->second.action @@ -207,18 +220,9 @@ void JoystickCameraStates::setAxisMapping(const std::string& joystickName, { ghoul_assert(axis < JoystickInputState::MaxAxes, "axis must be < MaxAxes"); - JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + JoystickCameraState* joystickCameraState = findOrAddJoystickCameraState(joystickName); if (!joystickCameraState) { - if (_joystickCameraStates.size() < JoystickInputStates::MaxNumJoysticks) { - _joystickCameraStates.push_back(JoystickCameraState()); - joystickCameraState = &_joystickCameraStates.back(); - joystickCameraState->joystickName = joystickName; - } - else { - LWARNING(fmt::format("Cannot add more joysticks, only {} joysticks are " - "supported", JoystickInputStates::MaxNumJoysticks)); - return; - } + return; } joystickCameraState->axisMapping[axis].type = mapping; @@ -231,14 +235,40 @@ void JoystickCameraStates::setAxisMapping(const std::string& joystickName, global::joystickInputStates->axis(joystickName, axis); } +void JoystickCameraStates::setAxisMappingProperty(const std::string& joystickName, + int axis, + const std::string& propertyUri, + float min, float max, + AxisInvert shouldInvert, + bool isSticky, double sensitivity, + bool isRemote) +{ + ghoul_assert(axis < JoystickInputState::MaxAxes, "axis must be < MaxAxes"); + + JoystickCameraState* joystickCameraState = findOrAddJoystickCameraState(joystickName); + if (!joystickCameraState) { + return; + } + + joystickCameraState->axisMapping[axis].type = AxisType::Property; + joystickCameraState->axisMapping[axis].invert = shouldInvert; + joystickCameraState->axisMapping[axis].isSticky = isSticky; + joystickCameraState->axisMapping[axis].sensitivity = sensitivity; + joystickCameraState->axisMapping[axis].propertyUri = propertyUri; + joystickCameraState->axisMapping[axis].minValue = min; + joystickCameraState->axisMapping[axis].maxValue = max; + joystickCameraState->axisMapping[axis].isRemote = isRemote; + + joystickCameraState->prevAxisValues[axis] = + global::joystickInputStates->axis(joystickName, axis); +} + JoystickCameraStates::AxisInformation JoystickCameraStates::axisMapping( const std::string& joystickName, int axis) const { const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); if (!joystickCameraState) { - LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}' " - "(axisMapping)", joystickName)); JoystickCameraStates::AxisInformation dummy; return dummy; } @@ -249,18 +279,9 @@ JoystickCameraStates::AxisInformation JoystickCameraStates::axisMapping( void JoystickCameraStates::setDeadzone(const std::string& joystickName, int axis, float deadzone) { - JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + JoystickCameraState* joystickCameraState = findOrAddJoystickCameraState(joystickName); if (!joystickCameraState) { - if (_joystickCameraStates.size() < JoystickInputStates::MaxNumJoysticks) { - _joystickCameraStates.push_back(JoystickCameraState()); - joystickCameraState = &_joystickCameraStates.back(); - joystickCameraState->joystickName = joystickName; - } - else { - LWARNING(fmt::format("Cannot add more joysticks, only {} joysticks are " - "supported", JoystickInputStates::MaxNumJoysticks)); - return; - } + return; } joystickCameraState->axisMapping[axis].deadzone = deadzone; @@ -269,8 +290,6 @@ void JoystickCameraStates::setDeadzone(const std::string& joystickName, int axis float JoystickCameraStates::deadzone(const std::string& joystickName, int axis) const { const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); if (!joystickCameraState) { - LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}' (deadzone)", - joystickName)); return 0.0f; } @@ -283,18 +302,9 @@ void JoystickCameraStates::bindButtonCommand(const std::string& joystickName, ButtonCommandRemote remote, std::string documentation) { - JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + JoystickCameraState* joystickCameraState = findOrAddJoystickCameraState(joystickName); if (!joystickCameraState) { - if (_joystickCameraStates.size() < JoystickInputStates::MaxNumJoysticks) { - _joystickCameraStates.push_back(JoystickCameraState()); - joystickCameraState = &_joystickCameraStates.back(); - joystickCameraState->joystickName = joystickName; - } - else { - LWARNING(fmt::format("Cannot add more joysticks, only {} joysticks are " - "supported", JoystickInputStates::MaxNumJoysticks)); - return; - } + return; } joystickCameraState->buttonMapping.insert({ @@ -308,8 +318,6 @@ void JoystickCameraStates::clearButtonCommand(const std::string& joystickName, { JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); if (!joystickCameraState) { - LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}' " - "(clearButtonCommand)", joystickName)); return; } @@ -334,8 +342,6 @@ std::vector JoystickCameraStates::buttonCommand( std::vector result; const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); if (!joystickCameraState) { - LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}' " - "(buttonCommand)", joystickName)); return result; } @@ -358,8 +364,8 @@ JoystickCameraStates::JoystickCameraState* JoystickCameraStates::getJoystickCame return nullptr; } -const JoystickCameraStates::JoystickCameraState* JoystickCameraStates::getJoystickCameraState( - const std::string& joystickName) const +const JoystickCameraStates::JoystickCameraState* + JoystickCameraStates::getJoystickCameraState(const std::string& joystickName) const { for (const JoystickCameraState& joystickCameraState : _joystickCameraStates) { if (joystickCameraState.joystickName == joystickName) { @@ -367,8 +373,28 @@ const JoystickCameraStates::JoystickCameraState* JoystickCameraStates::getJoysti } } + LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}'", joystickName)); return nullptr; } +JoystickCameraStates::JoystickCameraState* + JoystickCameraStates::findOrAddJoystickCameraState(const std::string& joystickName) +{ + JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); + if (!joystickCameraState) { + if (_joystickCameraStates.size() < JoystickInputStates::MaxNumJoysticks) { + _joystickCameraStates.push_back(JoystickCameraState()); + joystickCameraState = &_joystickCameraStates.back(); + joystickCameraState->joystickName = joystickName; + } + else { + LWARNING(fmt::format("Cannot add more joysticks, only {} joysticks are " + "supported", JoystickInputStates::MaxNumJoysticks)); + return nullptr; + } + } + return joystickCameraState; +} + } // namespace openspace::interaction diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index 8a2d67ae9f..4d840c07f4 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -516,6 +516,27 @@ void NavigationHandler::setJoystickAxisMapping(const std::string& joystickName, ); } +void NavigationHandler::setJoystickAxisMappingProperty(const std::string& joystickName, + int axis, + const std::string& propertyUri, + float min, float max, + JoystickCameraStates::AxisInvert shouldInvert, + bool isSticky, double sensitivity, + bool isRemote) +{ + _orbitalNavigator.joystickStates().setAxisMappingProperty( + joystickName, + axis, + propertyUri, + min, + max, + shouldInvert, + isSticky, + sensitivity, + isRemote + ); +} + void NavigationHandler::setWebsocketAxisMapping(int axis, WebsocketCameraStates::AxisType mapping, WebsocketCameraStates::AxisInvert shouldInvert, @@ -638,57 +659,88 @@ scripting::LuaLibrary NavigationHandler::luaLibrary() { "bindJoystickAxis", &luascriptfunctions::bindJoystickAxis, {}, - "int, axisType [, isInverted, isNormalized]", - "Binds the axis identified by the first argument to be used as the type " - "identified by the second argument. If 'isInverted' is 'true', the axis " - "value is inverted, if 'isNormalized' is true the axis value is " - "normalized from [-1, 1] to [0,1]." + "name, axis, axisType [, isInverted, isNormalized, isSticky, sensitivity]", + "Finds the input joystick with the given 'name' and binds the axis " + "identified by the second argument to be used as the type identified by " + "the third argument. If 'isInverted' is 'true', the axis value is " + "inverted, if 'isNormalized' is true the axis value is normalized from " + "[-1, 1] to [0,1]. If 'isSticky' is 'true', the value is calculated " + "relative to the previous value. If 'sensitivity' is given then that " + "value will affect the sensitivity of the axis together with " + "the global sensitivity." + }, + { + "bindJoystickAxisProperty", + &luascriptfunctions::bindJoystickAxisProperty, + {}, + "name, axis, propertyUri [, min, max, isInverted, isSticky, sensitivity, " + "isRemote]", + "Finds the input joystick with the given 'name' and binds the axis " + "identified by the second argument to be bound to the property " + "identified by the third argument. 'min' and 'max' is the minimum and " + "the maximum allowed value for the given property and the axis value is " + "rescaled from [-1, 1] to [min, max], default is [0, 1]. If 'isInverted' " + "is 'true', the axis value is inverted. If 'isSticky' is 'true', the " + "value is calculated relative to the previous value. If 'sensitivity' is " + "given then that value will affect the sensitivity of the axis together " + "with the global sensitivity. The last argument determines whether the " + "property change is going to be executed locally or remotely, where the " + "latter is the default." }, { "joystickAxis", &luascriptfunctions::joystickAxis, {}, - "int", - "Returns the joystick axis information for the passed axis. The " - "information that is returned is the current axis binding as a string, " - "whether the values are inverted as bool, and whether the value are " - "normalized as a bool" + "name, axis", + "Finds the input joystick with the given 'name' and returns the joystick " + "axis information for the passed axis. The information that is returned " + "is the current axis binding as a string, whether the values are " + "inverted as bool, whether the value are normalized as a bool, whether " + "the axis is sticky as bool, the sensitivity as number, the property uri " + "bound to the axis as string (empty is type is not Property), the min " + "and max values for the property as numbers and whether the property " + "change will be executed remotly as bool." }, { "setAxisDeadZone", &luascriptfunctions::setJoystickAxisDeadzone, {}, - "int, float", - "Sets the deadzone for a particular joystick axis which means that any " - "input less than this value is completely ignored." + "name, axis, float", + "Finds the input joystick with the given 'name' and sets the deadzone " + "for a particular joystick axis, which means that any input less than " + "this value is completely ignored." }, { "bindJoystickButton", &luascriptfunctions::bindJoystickButton, {}, - "int, string [, string, bool]", - "Binds a Lua script to be executed when the joystick button identified " - "by the first argument is triggered. The third argument determines when " - "the script should be executed, this defaults to 'pressed', which means " - "that the script is run when the user presses the button. The last " - "argument determines whether the command is going to be executable " - "locally or remotely. The latter being the default." + "name, button, string [, string, string, bool]", + "Finds the input joystick with the given 'name' and binds a Lua script " + "given by the third argument to be executed when the joystick button " + "identified by the second argument is triggered. The fifth argument " + "determines when the script should be executed, this defaults to " + "'Press', which means that the script is run when the user presses the " + "button. The fourth arguemnt is the documentation of the script in the " + "third argument. The sixth argument determines whether the command is " + "going to be executable locally or remotely, where the latter is the " + "default." }, { "clearJoystickButton", &luascriptfunctions::clearJoystickButton, {}, - "int", - "Removes all commands that are currently bound to the button identified " - "by the first argument" + "name, button", + "Finds the input joystick with the given 'name' and removes all commands " + "that are currently bound to the button identified by the second argument." }, { "joystickButton", &luascriptfunctions::joystickButton, {}, - "int", - "Returns the script that is currently bound to be executed when the " - "provided button is pressed" + "name, button", + "Finds the input joystick with the given 'name' and returns the script " + "that is currently bound to be executed when the provided button is " + "pressed." }, { "addGlobalRotation", diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index 59795a2bf9..d47b0a8318 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -175,6 +175,36 @@ int bindJoystickAxis(lua_State* L) { return 0; } +int bindJoystickAxisProperty(lua_State* L) { + ghoul::lua::checkArgumentsAndThrow(L, { 3, 9 }, "lua::bindJoystickAxisProperty"); + auto [joystickName, axis, propertyUri, min, max, shouldInvert, isSticky, sensitivity, + isRemote] = + ghoul::lua::values< + std::string, int, std::string, std::optional, std::optional, + std::optional, std::optional, std::optional, + std::optional + >(L); + min = min.value_or(0.f); + max = max.value_or(1.f); + shouldInvert = shouldInvert.value_or(false); + isSticky = isSticky.value_or(false); + sensitivity = sensitivity.value_or(0.0); + isRemote = isRemote.value_or(true); + + global::navigationHandler->setJoystickAxisMappingProperty( + joystickName, + axis, + propertyUri, + *min, + *max, + interaction::JoystickCameraStates::AxisInvert(*shouldInvert), + *isSticky, + *sensitivity, + *isRemote + ); + return 0; +} + int joystickAxis(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::joystickAxis"); auto [joystickName, axis] = ghoul::lua::values(L); @@ -188,9 +218,13 @@ int joystickAxis(lua_State* L) { static_cast(info.invert), static_cast(info.normalize), info.isSticky, - info.sensitivity + info.sensitivity, + info.propertyUri, + info.minValue, + info.maxValue, + info.isRemote ); - return 5; + return 9; } int setJoystickAxisDeadzone(lua_State* L) { From 3fdae48092021576a246efd12e59abc61748cac9 Mon Sep 17 00:00:00 2001 From: Malin E Date: Fri, 12 Nov 2021 11:46:17 +0100 Subject: [PATCH 007/117] Exchange normalisation property for joysticks to JoystickType * Joysticks can either be "JoystickLike" or "TriggerLike", where the triggers are normalized and have the deadzone close to -1 instead to 0 * Solves issue with zoom friction not to turn off for controllers --- .../util/joysticks/joystick_helper.asset | 18 +++++----- data/assets/util/joysticks/ps4.asset | 9 +++-- .../joysticks/space-mouse-not-sticky.asset | 3 +- data/assets/util/joysticks/space-mouse.asset | 15 ++++---- data/assets/util/joysticks/xbox.asset | 11 +++--- .../interaction/joystickcamerastates.h | 34 +++++++++++++++++-- .../openspace/navigation/navigationhandler.h | 4 +-- src/interaction/joystickcamerastates.cpp | 13 ++++--- src/navigation/navigationhandler.cpp | 26 +++++++------- src/navigation/navigationhandler_lua.inl | 13 ++++--- 10 files changed, 93 insertions(+), 53 deletions(-) diff --git a/data/assets/util/joysticks/joystick_helper.asset b/data/assets/util/joysticks/joystick_helper.asset index eadff7fa2f..be4cba6789 100644 --- a/data/assets/util/joysticks/joystick_helper.asset +++ b/data/assets/util/joysticks/joystick_helper.asset @@ -9,11 +9,11 @@ local bindLocalRoll = function(name, axis) -- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup if not Joystick.State.IsInRollMode then -- Save current axis state - Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) + Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) end -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); Joystick.State.IsInRollMode = true ]] end @@ -23,11 +23,11 @@ local bindGlobalRoll = function(name, axis) -- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup if not Joystick.State.IsInRollMode then -- Save current axis state - Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) + Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) end -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); Joystick.State.IsInRollMode = true ]] end @@ -35,27 +35,27 @@ end local permaBindLocalRoll = function(name, axis) return [[ -- Save current axis state - Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) + Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); ]] end local permaBindGlobalRoll = function(name, axis) return [[ -- Save current axis state - Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) + Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); ]] end local unbindRoll = function(name, axis) return [[ -- Reset previous state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); ]] end diff --git a/data/assets/util/joysticks/ps4.asset b/data/assets/util/joysticks/ps4.asset index 2c4dceebec..6fc628911f 100644 --- a/data/assets/util/joysticks/ps4.asset +++ b/data/assets/util/joysticks/ps4.asset @@ -15,7 +15,8 @@ local joystickHelper = asset.require('./joystick_helper') -- "Pan X" -- "Pan Y" -- Fourth parameter determines whether the axis should be inverted --- Fifth parameter determines whether the axis should be normalized from [-1,1] to [0,1] +-- Fifth parameter determines whether the axis behaves like a joystick or a Trigger. +-- Allowed values are "JoystickLike" and "TriggerLike", the first one is the default -- Sixth parameters determins if the axis should be "Sticky" or not. -- The axis values can either go back to 0 when the joystick is released or it can -- stay at the value it was before the joystick was released. @@ -55,13 +56,15 @@ asset.onInitialize(function() openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15) openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], 0.15) openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.L2, 0.05) + openspace.navigation.setAxisDeadZone(name, controller.R2, 0.05) openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[1], "Orbit X"); openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[2], "Orbit Y", true); openspace.navigation.bindJoystickAxis(name, controller.RightThumbStick[1], "Pan X", true); openspace.navigation.bindJoystickAxis(name, controller.RightThumbStick[2], "Pan Y", true); - openspace.navigation.bindJoystickAxis(name, controller.L2, "Zoom Out", false, true); - openspace.navigation.bindJoystickAxis(name, controller.R2, "Zoom In", false, true); + openspace.navigation.bindJoystickAxis(name, controller.L2, "Zoom Out", false, "TriggerLike"); + openspace.navigation.bindJoystickAxis(name, controller.R2, "Zoom In", false, "TriggerLike"); openspace.navigation.bindJoystickButton( name, diff --git a/data/assets/util/joysticks/space-mouse-not-sticky.asset b/data/assets/util/joysticks/space-mouse-not-sticky.asset index a4a06154a7..869db86050 100644 --- a/data/assets/util/joysticks/space-mouse-not-sticky.asset +++ b/data/assets/util/joysticks/space-mouse-not-sticky.asset @@ -15,7 +15,8 @@ local joystickHelper = asset.require('./joystick_helper') -- "Pan X" -- "Pan Y" -- Fourth parameter determines whether the axis should be inverted --- Fifth parameter determines whether the axis should be normalized from [-1,1] to [0,1] +-- Fifth parameter determines whether the axis behaves like a joystick or a Trigger. +-- Allowed values are "JoystickLike" and "TriggerLike", the first one is the default -- Sixth parameters determins if the axis should be "Sticky" or not. -- The axis values can either go back to 0 when the joystick is released or it can -- stay at the value it was before the joystick was released. diff --git a/data/assets/util/joysticks/space-mouse.asset b/data/assets/util/joysticks/space-mouse.asset index 96c1bf3a95..6a3b0cbdc0 100644 --- a/data/assets/util/joysticks/space-mouse.asset +++ b/data/assets/util/joysticks/space-mouse.asset @@ -15,7 +15,8 @@ local joystickHelper = asset.require('./joystick_helper') -- "Pan X" -- "Pan Y" -- Fourth parameter determines whether the axis should be inverted --- Fifth parameter determines whether the axis should be normalized from [-1,1] to [0,1] +-- Fifth parameter determines whether the axis behaves like a joystick or a Trigger. +-- Allowed values are "JoystickLike" and "TriggerLike", the first one is the default -- Sixth parameters determins if the axis should be "Sticky" or not. -- The axis values can either go back to 0 when the joystick is released or it can -- stay at the value it was before the joystick was released. @@ -35,12 +36,12 @@ asset.onInitialize(function() local controller = SpaceMouse; local name = "SpaceNavigator"; - openspace.navigation.bindJoystickAxis(name, controller.Push[1], "Orbit X", false, false, true, 40.0); - openspace.navigation.bindJoystickAxis(name, controller.Push[2], "Orbit Y", false, false, true, 40.0); - openspace.navigation.bindJoystickAxis(name, controller.Twist[1], "Pan X", true, false, true, 40.0); - openspace.navigation.bindJoystickAxis(name, controller.Tilt[2], "Pan Y", false, false, true, 35.0); - openspace.navigation.bindJoystickAxis(name, controller.Push[3], "Zoom", false, false, true, 40.0); - openspace.navigation.bindJoystickAxis(name, controller.Tilt[1], "LocalRoll X", false, false, true, 35.0); + openspace.navigation.bindJoystickAxis(name, controller.Push[1], "Orbit X", false, "JoystickLike", true, 40.0); + openspace.navigation.bindJoystickAxis(name, controller.Push[2], "Orbit Y", false, "JoystickLike", true, 40.0); + openspace.navigation.bindJoystickAxis(name, controller.Twist[1], "Pan X", true, "JoystickLike", true, 40.0); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[2], "Pan Y", false, "JoystickLike", true, 35.0); + openspace.navigation.bindJoystickAxis(name, controller.Push[3], "Zoom", false, "JoystickLike", true, 40.0); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[1], "LocalRoll X", "JoystickLike", false, true, 35.0); openspace.navigation.bindJoystickButton( name, diff --git a/data/assets/util/joysticks/xbox.asset b/data/assets/util/joysticks/xbox.asset index 6b1f136e80..7659c3969b 100644 --- a/data/assets/util/joysticks/xbox.asset +++ b/data/assets/util/joysticks/xbox.asset @@ -15,7 +15,8 @@ local joystickHelper = asset.require('./joystick_helper') -- "Pan X" -- "Pan Y" -- Fourth parameter determines whether the axis should be inverted --- Fifth parameter determines whether the axis should be normalized from [-1,1] to [0,1] +-- Fifth parameter determines whether the axis behaves like a joystick or a Trigger. +-- Allowed values are "JoystickLike" and "TriggerLike", the first one is the default -- Sixth parameters determins if the axis should be "Sticky" or not. -- The axis values can either go back to 0 when the joystick is released or it can -- stay at the value it was before the joystick was released. @@ -52,14 +53,16 @@ asset.onInitialize(function() openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], 0.15) openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15) openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], 0.15) - openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], 0.15) + openspace.navigation.setAxisDeadZone(name, controller.LeftTrigger, 0.05) + openspace.navigation.setAxisDeadZone(name, controller.RightTrigger, 0.05) openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[1], "Orbit X"); openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[2], "Orbit Y", true); openspace.navigation.bindJoystickAxis(name, controller.RightThumbStick[1], "Pan X", true); openspace.navigation.bindJoystickAxis(name, controller.RightThumbStick[2], "Pan Y", true); - openspace.navigation.bindJoystickAxis(name, controller.LeftTrigger, "Zoom Out", false, true); - openspace.navigation.bindJoystickAxis(name, controller.RightTrigger, "Zoom In", false, true); + openspace.navigation.bindJoystickAxis(name, controller.LeftTrigger, "Zoom Out", false, "TriggerLike"); + openspace.navigation.bindJoystickAxis(name, controller.RightTrigger, "Zoom In", false, "TriggerLike"); openspace.navigation.bindJoystickButton( name, diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index 5c7d5a3171..7460a04a13 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -53,14 +53,18 @@ public: Property }; + enum class JoystickType { + JoystickLike = 0, + TriggerLike + }; + BooleanType(AxisInvert); - BooleanType(AxisNormalize); BooleanType(ButtonCommandRemote); struct AxisInformation { AxisType type = AxisType::None; AxisInvert invert = AxisInvert::No; - AxisNormalize normalize = AxisNormalize::No; + JoystickType joystickType = JoystickType::JoystickLike; // The axis values can either go back to 0 when the joystick is released or it can // stay at the value it was before the joystick was released. @@ -86,7 +90,7 @@ public: void setAxisMapping(const std::string& joystickName, int axis, AxisType mapping, AxisInvert shouldInvert = AxisInvert::No, - AxisNormalize shouldNormalize = AxisNormalize::No, + JoystickType joystickType = JoystickType::JoystickLike, bool isSticky = false, double sensitivity = 0.0 ); @@ -194,6 +198,30 @@ from_string(std::string_view string) throw RuntimeError("Unkonwn axis type '" + std::string(string) + "'"); } +template <> +inline std::string to_string( + const openspace::interaction::JoystickCameraStates::JoystickType& value) +{ + using T = openspace::interaction::JoystickCameraStates::JoystickType; + switch (value) { + case T::JoystickLike: return "JoystickLike"; + case T::TriggerLike: return "TriggerLike"; + default: return ""; + } +} + +template <> +constexpr openspace::interaction::JoystickCameraStates::JoystickType +from_string(std::string_view string) +{ + using T = openspace::interaction::JoystickCameraStates::JoystickType; + + if (string == "JoystickLike") { return T::JoystickLike; } + if (string == "TriggerLike") { return T::TriggerLike; } + + throw RuntimeError("Unkonwn joystick type '" + std::string(string) + "'"); +} + } // namespace ghoul #endif // __OPENSPACE_CORE___JOYSTICKCAMERASTATES___H__ diff --git a/include/openspace/navigation/navigationhandler.h b/include/openspace/navigation/navigationhandler.h index 3b2566b704..a87bcaa7a5 100644 --- a/include/openspace/navigation/navigationhandler.h +++ b/include/openspace/navigation/navigationhandler.h @@ -102,8 +102,8 @@ public: int axis, JoystickCameraStates::AxisType mapping, JoystickCameraStates::AxisInvert shouldInvert = JoystickCameraStates::AxisInvert::No, - JoystickCameraStates::AxisNormalize shouldNormalize = - JoystickCameraStates::AxisNormalize::No, + JoystickCameraStates::JoystickType joystickType = + JoystickCameraStates::JoystickType::JoystickLike, bool isSticky = false, double sensitivity = 0.0 ); diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index 74ad9adaab..cf34496ae6 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -77,7 +77,10 @@ void JoystickCameraStates::updateStateFromInput( joystickCameraState->prevAxisValues[i] = rawValue; } - if (std::fabs(value) <= t.deadzone) { + if ((t.joystickType == JoystickType::JoystickLike && + std::fabs(value) <= t.deadzone) || + (t.joystickType == JoystickType::TriggerLike && value <= -1 + t.deadzone)) + { continue; } @@ -85,7 +88,9 @@ void JoystickCameraStates::updateStateFromInput( value *= -1.f; } - if (t.normalize || t.type == AxisType::Property) { + if (t.joystickType == JoystickType::TriggerLike || + t.type == AxisType::Property) + { value = (value + 1.f) / 2.f; } @@ -214,7 +219,7 @@ void JoystickCameraStates::updateStateFromInput( void JoystickCameraStates::setAxisMapping(const std::string& joystickName, int axis, AxisType mapping, AxisInvert shouldInvert, - AxisNormalize shouldNormalize, + JoystickType joystickType, bool isSticky, double sensitivity) { @@ -227,7 +232,7 @@ void JoystickCameraStates::setAxisMapping(const std::string& joystickName, joystickCameraState->axisMapping[axis].type = mapping; joystickCameraState->axisMapping[axis].invert = shouldInvert; - joystickCameraState->axisMapping[axis].normalize = shouldNormalize; + joystickCameraState->axisMapping[axis].joystickType = joystickType; joystickCameraState->axisMapping[axis].isSticky = isSticky; joystickCameraState->axisMapping[axis].sensitivity = sensitivity; diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index b645c6a4cc..fad7bc1c57 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -501,7 +501,7 @@ void NavigationHandler::loadNavigationState(const std::string& filepath) { void NavigationHandler::setJoystickAxisMapping(const std::string& joystickName, int axis, JoystickCameraStates::AxisType mapping, JoystickCameraStates::AxisInvert shouldInvert, - JoystickCameraStates::AxisNormalize shouldNormalize, + JoystickCameraStates::JoystickType joystickType, bool isSticky, double sensitivity) { @@ -510,7 +510,7 @@ void NavigationHandler::setJoystickAxisMapping(const std::string& joystickName, axis, mapping, shouldInvert, - shouldNormalize, + joystickType, isSticky, sensitivity ); @@ -652,15 +652,15 @@ scripting::LuaLibrary NavigationHandler::luaLibrary() { { "bindJoystickAxis", &luascriptfunctions::bindJoystickAxis, - "name, axis, axisType [, isInverted, isNormalized, isSticky, sensitivity]", + "name, axis, axisType [, isInverted, joystickType, isSticky, sensitivity]", "Finds the input joystick with the given 'name' and binds the axis " "identified by the second argument to be used as the type identified by " "the third argument. If 'isInverted' is 'true', the axis value is " - "inverted, if 'isNormalized' is true the axis value is normalized from " - "[-1, 1] to [0,1]. If 'isSticky' is 'true', the value is calculated " - "relative to the previous value. If 'sensitivity' is given then that " - "value will affect the sensitivity of the axis together with " - "the global sensitivity." + "inverted. 'joystickType' is if the joystick behaves more like a " + "joystick or a trigger, where the first is the default. If 'isSticky' is " + "'true', the value is calculated relative to the previous value. If " + "'sensitivity' is given then that value will affect the sensitivity of " + "the axis together with the global sensitivity." }, { "bindJoystickAxisProperty", @@ -686,11 +686,11 @@ scripting::LuaLibrary NavigationHandler::luaLibrary() { "Finds the input joystick with the given 'name' and returns the joystick " "axis information for the passed axis. The information that is returned " "is the current axis binding as a string, whether the values are " - "inverted as bool, whether the value are normalized as a bool, whether " - "the axis is sticky as bool, the sensitivity as number, the property uri " - "bound to the axis as string (empty is type is not Property), the min " - "and max values for the property as numbers and whether the property " - "change will be executed remotly as bool." + "inverted as bool, the joystick type as a string, whether the axis is " + "sticky as bool, the sensitivity as number, the property uri bound to " + "the axis as string (empty is type is not Property), the min and max " + "values for the property as numbers and whether the property change will " + "be executed remotly as bool." }, { "setAxisDeadZone", diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index d47b0a8318..c4be5cb1c8 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -152,23 +152,22 @@ int retargetAim(lua_State* L) { int bindJoystickAxis(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, { 3, 7 }, "lua::bindJoystickAxis"); - auto [joystickName, axis, axisType, shouldInvert, shouldNormalize, isSticky, + auto [joystickName, axis, axisType, shouldInvert, joystickType, isSticky, sensitivity] = ghoul::lua::values< - std::string, int, std::string, std::optional, std::optional, - std::optional, std::optional + std::string, int, std::string, std::optional, + std::optional, std::optional, std::optional >(L); - shouldInvert = shouldInvert.value_or(false); - shouldNormalize = shouldNormalize.value_or(false); isSticky = isSticky.value_or(false); sensitivity = sensitivity.value_or(0.0); + joystickType = joystickType.value_or("JoystickLike"); global::navigationHandler->setJoystickAxisMapping( joystickName, axis, ghoul::from_string(axisType), interaction::JoystickCameraStates::AxisInvert(*shouldInvert), - interaction::JoystickCameraStates::AxisNormalize(*shouldNormalize), + ghoul::from_string(*joystickType), *isSticky, *sensitivity ); @@ -216,7 +215,7 @@ int joystickAxis(lua_State* L) { L, ghoul::to_string(info.type), static_cast(info.invert), - static_cast(info.normalize), + ghoul::to_string(info.joystickType), info.isSticky, info.sensitivity, info.propertyUri, From 3d3db47d76015c403e3ea3e886a5476aa776758b Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Fri, 12 Nov 2021 14:07:07 +0100 Subject: [PATCH 008/117] Small include updates to adapt to inputstate changes --- include/openspace/navigation/orbitalnavigator.h | 4 ++-- modules/server/include/topics/flightcontrollertopic.h | 1 - modules/server/src/topics/flightcontrollertopic.cpp | 1 - src/navigation/orbitalnavigator.cpp | 2 ++ 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/openspace/navigation/orbitalnavigator.h b/include/openspace/navigation/orbitalnavigator.h index c0cdada814..977f6ed74b 100644 --- a/include/openspace/navigation/orbitalnavigator.h +++ b/include/openspace/navigation/orbitalnavigator.h @@ -41,7 +41,6 @@ #include #include #include - #include namespace openspace { @@ -53,7 +52,8 @@ namespace openspace { namespace openspace::interaction { -class InputState; +class MouseInputState; +class KeyboardInputState; class OrbitalNavigator : public properties::PropertyOwner { public: diff --git a/modules/server/include/topics/flightcontrollertopic.h b/modules/server/include/topics/flightcontrollertopic.h index a6aa91bca4..418acfe038 100644 --- a/modules/server/include/topics/flightcontrollertopic.h +++ b/modules/server/include/topics/flightcontrollertopic.h @@ -30,7 +30,6 @@ #include namespace openspace::interaction { - struct WebsocketInputStates; struct WebsocketInputState; } diff --git a/modules/server/src/topics/flightcontrollertopic.cpp b/modules/server/src/topics/flightcontrollertopic.cpp index bdc139e7dc..684e2be7be 100644 --- a/modules/server/src/topics/flightcontrollertopic.cpp +++ b/modules/server/src/topics/flightcontrollertopic.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/navigation/orbitalnavigator.cpp b/src/navigation/orbitalnavigator.cpp index 49009d083f..a971dc029e 100644 --- a/src/navigation/orbitalnavigator.cpp +++ b/src/navigation/orbitalnavigator.cpp @@ -23,6 +23,8 @@ ****************************************************************************************/ #include +#include +#include #include #include #include From f591ba21956deba07d206aec36b553e0b3c639f7 Mon Sep 17 00:00:00 2001 From: Malin E Date: Mon, 15 Nov 2021 11:25:12 +0100 Subject: [PATCH 009/117] Fix roll for controllers --- .../util/joysticks/joystick_helper.asset | 22 +++++++++++-------- data/assets/util/joysticks/space-mouse.asset | 2 +- .../interaction/joystickcamerastates.h | 1 + 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/data/assets/util/joysticks/joystick_helper.asset b/data/assets/util/joysticks/joystick_helper.asset index be4cba6789..4ee29af58b 100644 --- a/data/assets/util/joysticks/joystick_helper.asset +++ b/data/assets/util/joysticks/joystick_helper.asset @@ -9,11 +9,11 @@ local bindLocalRoll = function(name, axis) -- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup if not Joystick.State.IsInRollMode then -- Save current axis state - Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) + Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity, Joystick.State.Axis.PropertyUri, Joystick.State.Axis.MinValue, Joystick.State.Axis.MaxValue, Joystick.State.Axis.IsRemote = openspace.navigation.joystickAxis("]] .. name .. "\", " .. axis .. [[); end -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis("]] .. name .. "\", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); Joystick.State.IsInRollMode = true ]] end @@ -23,11 +23,11 @@ local bindGlobalRoll = function(name, axis) -- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup if not Joystick.State.IsInRollMode then -- Save current axis state - Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) + Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity, Joystick.State.Axis.PropertyUri, Joystick.State.Axis.MinValue, Joystick.State.Axis.MaxValue, Joystick.State.Axis.IsRemote = openspace.navigation.joystickAxis("]] .. name .. "\", " .. axis .. [[); end -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis("]] .. name .. "\", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); Joystick.State.IsInRollMode = true ]] end @@ -35,27 +35,31 @@ end local permaBindLocalRoll = function(name, axis) return [[ -- Save current axis state - Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) + Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity, Joystick.State.Axis.PropertyUri, Joystick.State.Axis.MinValue, Joystick.State.Axis.MaxValue, Joystick.State.Axis.IsRemote = openspace.navigation.joystickAxis("]] .. name .. "\", " .. axis .. [[); -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis("]] .. name .. "\", " .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); ]] end local permaBindGlobalRoll = function(name, axis) return [[ -- Save current axis state - Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[) + Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity, Joystick.State.Axis.PropertyUri, Joystick.State.Axis.MinValue, Joystick.State.Axis.MaxValue, Joystick.State.Axis.IsRemote = openspace.navigation.joystickAxis("]] .. name .. "\", " .. axis .. [[); -- Set new axis state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + openspace.navigation.bindJoystickAxis("]] .. name .. "\", " .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); ]] end local unbindRoll = function(name, axis) return [[ -- Reset previous state - openspace.navigation.bindJoystickAxis(]] .. name .. ", " .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + if(Joystick.State.Axis.Type == "Property") then + openspace.navigation.bindJoystickAxisProperty("]] .. name .. "\", " .. axis .. [[, Joystick.State.Axis.PropertyUri, Joystick.State.Axis.MinValue, Joystick.State.Axis.MaxValue, Joystick.State.Axis.Inverted, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity, Joystick.State.Axis.IsRemote); + else + openspace.navigation.bindJoystickAxis("]] .. name .. "\", " .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); + end ]] end diff --git a/data/assets/util/joysticks/space-mouse.asset b/data/assets/util/joysticks/space-mouse.asset index 6a3b0cbdc0..afc55055b6 100644 --- a/data/assets/util/joysticks/space-mouse.asset +++ b/data/assets/util/joysticks/space-mouse.asset @@ -41,7 +41,7 @@ asset.onInitialize(function() openspace.navigation.bindJoystickAxis(name, controller.Twist[1], "Pan X", true, "JoystickLike", true, 40.0); openspace.navigation.bindJoystickAxis(name, controller.Tilt[2], "Pan Y", false, "JoystickLike", true, 35.0); openspace.navigation.bindJoystickAxis(name, controller.Push[3], "Zoom", false, "JoystickLike", true, 40.0); - openspace.navigation.bindJoystickAxis(name, controller.Tilt[1], "LocalRoll X", "JoystickLike", false, true, 35.0); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[1], "LocalRoll X", false, "JoystickLike", true, 35.0); openspace.navigation.bindJoystickButton( name, diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index 7460a04a13..b02eed8b4b 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -171,6 +171,7 @@ inline std::string to_string( case T::GlobalRollY: return "GlobalRoll Y"; case T::PanX: return "Pan X"; case T::PanY: return "Pan Y"; + case T::Property: return "Property"; default: return ""; } } From 5ae9bfcd1494a3c8aeb7f813e262b8f08f71d8e2 Mon Sep 17 00:00:00 2001 From: Malin E Date: Mon, 15 Nov 2021 12:56:38 +0100 Subject: [PATCH 010/117] Fix shouldInvert default value for joysticks --- .../assets/util/joysticks/space-mouse-not-sticky.asset | 10 +++++----- src/navigation/navigationhandler_lua.inl | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/data/assets/util/joysticks/space-mouse-not-sticky.asset b/data/assets/util/joysticks/space-mouse-not-sticky.asset index 869db86050..d185635e68 100644 --- a/data/assets/util/joysticks/space-mouse-not-sticky.asset +++ b/data/assets/util/joysticks/space-mouse-not-sticky.asset @@ -36,12 +36,12 @@ asset.onInitialize(function() local controller = SpaceMouse; local name = "SpaceNavigator"; - openspace.navigation.bindJoystickAxis(name, controller.Push[1], "Orbit X", false); - openspace.navigation.bindJoystickAxis(name, controller.Push[2], "Orbit Y", false); + openspace.navigation.bindJoystickAxis(name, controller.Push[1], "Orbit X"); + openspace.navigation.bindJoystickAxis(name, controller.Push[2], "Orbit Y"); openspace.navigation.bindJoystickAxis(name, controller.Twist[1], "Pan X", true); - openspace.navigation.bindJoystickAxis(name, controller.Tilt[2], "Pan Y", false); - openspace.navigation.bindJoystickAxis(name, controller.Push[3], "Zoom", false); - openspace.navigation.bindJoystickAxis(name, controller.Tilt[1], "LocalRoll X", false); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[2], "Pan Y"); + openspace.navigation.bindJoystickAxis(name, controller.Push[3], "Zoom"); + openspace.navigation.bindJoystickAxis(name, controller.Tilt[1], "LocalRoll X"); openspace.navigation.bindJoystickButton( name, diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index c4be5cb1c8..db77f248af 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -158,6 +158,7 @@ int bindJoystickAxis(lua_State* L) { std::string, int, std::string, std::optional, std::optional, std::optional, std::optional >(L); + shouldInvert = shouldInvert.value_or(false); isSticky = isSticky.value_or(false); sensitivity = sensitivity.value_or(0.0); joystickType = joystickType.value_or("JoystickLike"); From 78b1f2c6e12f7b2836602d3b09228b6f0117a4f5 Mon Sep 17 00:00:00 2001 From: Malin E Date: Wed, 17 Nov 2021 16:57:05 +0100 Subject: [PATCH 011/117] Remove support for sticky axis and sensitivity to Property type --- data/assets/util/joysticks/joystick_helper.asset | 2 +- .../openspace/interaction/joystickcamerastates.h | 3 +-- include/openspace/navigation/navigationhandler.h | 3 +-- src/interaction/joystickcamerastates.cpp | 14 ++++++-------- src/navigation/navigationhandler.cpp | 12 +++--------- src/navigation/navigationhandler_lua.inl | 10 ++-------- 6 files changed, 14 insertions(+), 30 deletions(-) diff --git a/data/assets/util/joysticks/joystick_helper.asset b/data/assets/util/joysticks/joystick_helper.asset index 4ee29af58b..66e376d1f9 100644 --- a/data/assets/util/joysticks/joystick_helper.asset +++ b/data/assets/util/joysticks/joystick_helper.asset @@ -56,7 +56,7 @@ local unbindRoll = function(name, axis) return [[ -- Reset previous state if(Joystick.State.Axis.Type == "Property") then - openspace.navigation.bindJoystickAxisProperty("]] .. name .. "\", " .. axis .. [[, Joystick.State.Axis.PropertyUri, Joystick.State.Axis.MinValue, Joystick.State.Axis.MaxValue, Joystick.State.Axis.Inverted, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity, Joystick.State.Axis.IsRemote); + openspace.navigation.bindJoystickAxisProperty("]] .. name .. "\", " .. axis .. [[, Joystick.State.Axis.PropertyUri, Joystick.State.Axis.MinValue, Joystick.State.Axis.MaxValue, Joystick.State.Axis.Inverted, Joystick.State.Axis.IsRemote); else openspace.navigation.bindJoystickAxis("]] .. name .. "\", " .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.JoystickType, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity); end diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index b02eed8b4b..d0b2d74039 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -96,8 +96,7 @@ public: void setAxisMappingProperty(const std::string& joystickName, int axis, const std::string& propertyUri, float min = 0.f, float max = 1.f, - AxisInvert shouldInvert = AxisInvert::No, - bool isSticky = false, double sensitivity = 0.0, bool isRemote = true + AxisInvert shouldInvert = AxisInvert::No, bool isRemote = true ); AxisInformation axisMapping(const std::string& joystickName, int axis) const; diff --git a/include/openspace/navigation/navigationhandler.h b/include/openspace/navigation/navigationhandler.h index a87bcaa7a5..3a6bbeac36 100644 --- a/include/openspace/navigation/navigationhandler.h +++ b/include/openspace/navigation/navigationhandler.h @@ -111,8 +111,7 @@ public: int axis, const std::string& propertyUri, float min = 0.f, float max = 1.f, JoystickCameraStates::AxisInvert shouldInvert = - JoystickCameraStates::AxisInvert::No, - bool isSticky = false, double sensitivity = 0.0, bool isRemote = true + JoystickCameraStates::AxisInvert::No, bool isRemote = true ); JoystickCameraStates::AxisInformation joystickAxisMapping( diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index cf34496ae6..9d4b5ea4df 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -97,12 +97,13 @@ void JoystickCameraStates::updateStateFromInput( if (t.type == AxisType::Property) { value = value * (t.maxValue - t.minValue) + t.minValue; } - - if (std::abs(t.sensitivity) > std::numeric_limits::epsilon()) { - value = static_cast(value * t.sensitivity * _sensitivity); - } else { - value = static_cast(value * _sensitivity); + if (std::abs(t.sensitivity) > std::numeric_limits::epsilon()) { + value = static_cast(value * t.sensitivity * _sensitivity); + } + else { + value = static_cast(value * _sensitivity); + } } switch (t.type) { @@ -245,7 +246,6 @@ void JoystickCameraStates::setAxisMappingProperty(const std::string& joystickNam const std::string& propertyUri, float min, float max, AxisInvert shouldInvert, - bool isSticky, double sensitivity, bool isRemote) { ghoul_assert(axis < JoystickInputState::MaxAxes, "axis must be < MaxAxes"); @@ -257,8 +257,6 @@ void JoystickCameraStates::setAxisMappingProperty(const std::string& joystickNam joystickCameraState->axisMapping[axis].type = AxisType::Property; joystickCameraState->axisMapping[axis].invert = shouldInvert; - joystickCameraState->axisMapping[axis].isSticky = isSticky; - joystickCameraState->axisMapping[axis].sensitivity = sensitivity; joystickCameraState->axisMapping[axis].propertyUri = propertyUri; joystickCameraState->axisMapping[axis].minValue = min; joystickCameraState->axisMapping[axis].maxValue = max; diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index fad7bc1c57..439bcd503e 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -521,7 +521,6 @@ void NavigationHandler::setJoystickAxisMappingProperty(const std::string& joysti const std::string& propertyUri, float min, float max, JoystickCameraStates::AxisInvert shouldInvert, - bool isSticky, double sensitivity, bool isRemote) { _orbitalNavigator.joystickStates().setAxisMappingProperty( @@ -531,8 +530,6 @@ void NavigationHandler::setJoystickAxisMappingProperty(const std::string& joysti min, max, shouldInvert, - isSticky, - sensitivity, isRemote ); } @@ -672,12 +669,9 @@ scripting::LuaLibrary NavigationHandler::luaLibrary() { "identified by the third argument. 'min' and 'max' is the minimum and " "the maximum allowed value for the given property and the axis value is " "rescaled from [-1, 1] to [min, max], default is [0, 1]. If 'isInverted' " - "is 'true', the axis value is inverted. If 'isSticky' is 'true', the " - "value is calculated relative to the previous value. If 'sensitivity' is " - "given then that value will affect the sensitivity of the axis together " - "with the global sensitivity. The last argument determines whether the " - "property change is going to be executed locally or remotely, where the " - "latter is the default." + "is 'true', the axis value is inverted. The last argument determines " + "whether the property change is going to be executed locally or " + "remotely, where the latter is the default." }, { "joystickAxis", diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index db77f248af..9be6957ce2 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -177,18 +177,14 @@ int bindJoystickAxis(lua_State* L) { int bindJoystickAxisProperty(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, { 3, 9 }, "lua::bindJoystickAxisProperty"); - auto [joystickName, axis, propertyUri, min, max, shouldInvert, isSticky, sensitivity, - isRemote] = + auto [joystickName, axis, propertyUri, min, max, shouldInvert, isRemote] = ghoul::lua::values< std::string, int, std::string, std::optional, std::optional, - std::optional, std::optional, std::optional, - std::optional + std::optional, std::optional >(L); min = min.value_or(0.f); max = max.value_or(1.f); shouldInvert = shouldInvert.value_or(false); - isSticky = isSticky.value_or(false); - sensitivity = sensitivity.value_or(0.0); isRemote = isRemote.value_or(true); global::navigationHandler->setJoystickAxisMappingProperty( @@ -198,8 +194,6 @@ int bindJoystickAxisProperty(lua_State* L) { *min, *max, interaction::JoystickCameraStates::AxisInvert(*shouldInvert), - *isSticky, - *sensitivity, *isRemote ); return 0; From 8299e4db22ea145a059727ae954d632a3ad35c09 Mon Sep 17 00:00:00 2001 From: Malin E Date: Tue, 30 Nov 2021 10:46:44 +0100 Subject: [PATCH 012/117] Address PR comments --- .../interaction/joystickcamerastates.h | 26 ++++--- .../openspace/navigation/navigationhandler.h | 6 +- src/interaction/joystickcamerastates.cpp | 73 +++++++++---------- src/interaction/joystickinputstate.cpp | 6 +- src/navigation/navigationhandler.cpp | 12 +-- src/navigation/navigationhandler_lua.inl | 6 +- 6 files changed, 67 insertions(+), 62 deletions(-) diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index d0b2d74039..2c96b58a5c 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -54,7 +54,7 @@ public: }; enum class JoystickType { - JoystickLike = 0, + JoystickLike, TriggerLike }; @@ -88,14 +88,14 @@ public: void updateStateFromInput( const JoystickInputStates& joystickInputStates, double deltaTime); - void setAxisMapping(const std::string& joystickName, int axis, AxisType mapping, + void setAxisMapping(std::string joystickName, int axis, AxisType mapping, AxisInvert shouldInvert = AxisInvert::No, JoystickType joystickType = JoystickType::JoystickLike, bool isSticky = false, double sensitivity = 0.0 ); - void setAxisMappingProperty(const std::string& joystickName, int axis, - const std::string& propertyUri, float min = 0.f, float max = 1.f, + void setAxisMappingProperty(std::string joystickName, int axis, + std::string propertyUri, float min = 0.f, float max = 1.f, AxisInvert shouldInvert = AxisInvert::No, bool isRemote = true ); @@ -119,7 +119,6 @@ private: // be accessed much more often and thus have to be more efficient. And storing a few // extra AxisInformation that are not used will not matter that much; finding an axis // location in a potential map each frame, however, would - std::array axisMapping; // This array is used to store the old axis values from the previous frame, @@ -127,9 +126,16 @@ private: std::array prevAxisValues; struct ButtonInformation { + // The script that is run when the button is activated std::string command; + + // When is the button considered activated JoystickAction action; + + // If the script should be syncronised to other remote sessions or not ButtonCommandRemote synchronization; + + // Short documentation on what the script of this button does std::string documentation; }; @@ -140,8 +146,8 @@ private: // Find the item in _joystickCameraStates that corresponds to the given joystickName // return a pointer to the item, if not found then return nullptr - JoystickCameraState* getJoystickCameraState(const std::string& joystickName); - const JoystickCameraState* getJoystickCameraState(const std::string& joystickName) const; + JoystickCameraState* joystickCameraState(const std::string& joystickName); + const JoystickCameraState* joystickCameraState(const std::string& joystickName) const; // Ues getJoystickCameraState(name) to find the joystickCameraState that // corresponds to the given joystickName. If not found then add a new item if possible @@ -204,9 +210,9 @@ inline std::string to_string( { using T = openspace::interaction::JoystickCameraStates::JoystickType; switch (value) { - case T::JoystickLike: return "JoystickLike"; - case T::TriggerLike: return "TriggerLike"; - default: return ""; + case T::JoystickLike: return "JoystickLike"; + case T::TriggerLike: return "TriggerLike"; + default: return ""; } } diff --git a/include/openspace/navigation/navigationhandler.h b/include/openspace/navigation/navigationhandler.h index 3a6bbeac36..f66e765ac5 100644 --- a/include/openspace/navigation/navigationhandler.h +++ b/include/openspace/navigation/navigationhandler.h @@ -98,7 +98,7 @@ public: void mousePositionCallback(double x, double y); void mouseScrollWheelCallback(double pos); - void setJoystickAxisMapping(const std::string& joystickName, + void setJoystickAxisMapping(std::string joystickName, int axis, JoystickCameraStates::AxisType mapping, JoystickCameraStates::AxisInvert shouldInvert = JoystickCameraStates::AxisInvert::No, @@ -107,8 +107,8 @@ public: bool isSticky = false, double sensitivity = 0.0 ); - void setJoystickAxisMappingProperty(const std::string& joystickName, - int axis, const std::string& propertyUri, + void setJoystickAxisMappingProperty(std::string joystickName, + int axis, std::string propertyUri, float min = 0.f, float max = 1.f, JoystickCameraStates::AxisInvert shouldInvert = JoystickCameraStates::AxisInvert::No, bool isRemote = true diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index 9d4b5ea4df..22a9c6f53e 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -56,15 +56,14 @@ void JoystickCameraStates::updateStateFromInput( continue; } - JoystickCameraState* joystickCameraState = - getJoystickCameraState(joystickInputState.name); + JoystickCameraState* joystick = joystickCameraState(joystickInputState.name); - if (!joystickCameraState) { + if (!joystick) { continue; } for (int i = 0; i < JoystickInputState::MaxAxes; ++i) { - AxisInformation t = joystickCameraState->axisMapping[i]; + AxisInformation t = joystick->axisMapping[i]; if (t.type == AxisType::None) { continue; } @@ -73,13 +72,13 @@ void JoystickCameraStates::updateStateFromInput( float value = rawValue; if (t.isSticky) { - value = rawValue - joystickCameraState->prevAxisValues[i]; - joystickCameraState->prevAxisValues[i] = rawValue; + value = rawValue - joystick->prevAxisValues[i]; + joystick->prevAxisValues[i] = rawValue; } if ((t.joystickType == JoystickType::JoystickLike && - std::fabs(value) <= t.deadzone) || - (t.joystickType == JoystickType::TriggerLike && value <= -1 + t.deadzone)) + std::abs(value) <= t.deadzone) || + (t.joystickType == JoystickType::TriggerLike && value <= -1.f + t.deadzone)) { continue; } @@ -151,8 +150,8 @@ void JoystickCameraStates::updateStateFromInput( localRotation.second.y += value; break; case AxisType::Property: - std::string script = "openspace.setPropertyValue(\"" + - t.propertyUri + "\", " + std::to_string(value) + ");"; + std::string script = fmt::format("openspace.setPropertyValue('{}', {});", + t.propertyUri, value); global::scriptEngine->queueScript( script, @@ -163,7 +162,7 @@ void JoystickCameraStates::updateStateFromInput( } for (int i = 0; i < JoystickInputState::MaxButtons; ++i) { - auto itRange = joystickCameraState->buttonMapping.equal_range(i); + auto itRange = joystick->buttonMapping.equal_range(i); for (auto it = itRange.first; it != itRange.second; ++it) { bool active = global::joystickInputStates->button( joystickInputState.name, @@ -217,7 +216,7 @@ void JoystickCameraStates::updateStateFromInput( } } -void JoystickCameraStates::setAxisMapping(const std::string& joystickName, +void JoystickCameraStates::setAxisMapping(std::string joystickName, int axis, AxisType mapping, AxisInvert shouldInvert, JoystickType joystickType, @@ -241,9 +240,9 @@ void JoystickCameraStates::setAxisMapping(const std::string& joystickName, global::joystickInputStates->axis(joystickName, axis); } -void JoystickCameraStates::setAxisMappingProperty(const std::string& joystickName, +void JoystickCameraStates::setAxisMappingProperty(std::string joystickName, int axis, - const std::string& propertyUri, + std::string propertyUri, float min, float max, AxisInvert shouldInvert, bool isRemote) @@ -270,13 +269,13 @@ JoystickCameraStates::AxisInformation JoystickCameraStates::axisMapping( const std::string& joystickName, int axis) const { - const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); - if (!joystickCameraState) { + const JoystickCameraState* joystick = joystickCameraState(joystickName); + if (!joystick) { JoystickCameraStates::AxisInformation dummy; return dummy; } - return joystickCameraState->axisMapping[axis]; + return joystick->axisMapping[axis]; } void JoystickCameraStates::setDeadzone(const std::string& joystickName, int axis, @@ -291,12 +290,12 @@ void JoystickCameraStates::setDeadzone(const std::string& joystickName, int axis } float JoystickCameraStates::deadzone(const std::string& joystickName, int axis) const { - const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); - if (!joystickCameraState) { - return 0.0f; + const JoystickCameraState* joystick = joystickCameraState(joystickName); + if (!joystick) { + return 0.f; } - return joystickCameraState->axisMapping[axis].deadzone; + return joystick->axisMapping[axis].deadzone; } void JoystickCameraStates::bindButtonCommand(const std::string& joystickName, @@ -319,18 +318,18 @@ void JoystickCameraStates::bindButtonCommand(const std::string& joystickName, void JoystickCameraStates::clearButtonCommand(const std::string& joystickName, int button) { - JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); - if (!joystickCameraState) { + JoystickCameraState* joystick = joystickCameraState(joystickName); + if (!joystick) { return; } - for (auto it = joystickCameraState->buttonMapping.begin(); - it != joystickCameraState->buttonMapping.end(); ) + for (auto it = joystick->buttonMapping.begin(); + it != joystick->buttonMapping.end(); ) { // If the current iterator is the button that we are looking for, delete it // (std::multimap::erase will return the iterator to the next element for us) if (it->first == button) { - it = joystickCameraState->buttonMapping.erase(it); + it = joystick->buttonMapping.erase(it); } else { ++it; @@ -343,19 +342,19 @@ std::vector JoystickCameraStates::buttonCommand( int button) const { std::vector result; - const JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); - if (!joystickCameraState) { + const JoystickCameraState* joystick = joystickCameraState(joystickName); + if (!joystick) { return result; } - auto itRange = joystickCameraState->buttonMapping.equal_range(button); + auto itRange = joystick->buttonMapping.equal_range(button); for (auto it = itRange.first; it != itRange.second; ++it) { result.push_back(it->second.command); } return result; } -JoystickCameraStates::JoystickCameraState* JoystickCameraStates::getJoystickCameraState( +JoystickCameraStates::JoystickCameraState* JoystickCameraStates::joystickCameraState( const std::string& joystickName) { for (JoystickCameraState& joystickCameraState : _joystickCameraStates) { @@ -368,7 +367,7 @@ JoystickCameraStates::JoystickCameraState* JoystickCameraStates::getJoystickCame } const JoystickCameraStates::JoystickCameraState* - JoystickCameraStates::getJoystickCameraState(const std::string& joystickName) const +JoystickCameraStates::joystickCameraState(const std::string& joystickName) const { for (const JoystickCameraState& joystickCameraState : _joystickCameraStates) { if (joystickCameraState.joystickName == joystickName) { @@ -381,14 +380,14 @@ const JoystickCameraStates::JoystickCameraState* } JoystickCameraStates::JoystickCameraState* - JoystickCameraStates::findOrAddJoystickCameraState(const std::string& joystickName) +JoystickCameraStates::findOrAddJoystickCameraState(const std::string& joystickName) { - JoystickCameraState* joystickCameraState = getJoystickCameraState(joystickName); - if (!joystickCameraState) { + JoystickCameraState* joystick = joystickCameraState(joystickName); + if (!joystick) { if (_joystickCameraStates.size() < JoystickInputStates::MaxNumJoysticks) { _joystickCameraStates.push_back(JoystickCameraState()); - joystickCameraState = &_joystickCameraStates.back(); - joystickCameraState->joystickName = joystickName; + joystick = &_joystickCameraStates.back(); + joystick->joystickName = joystickName; } else { LWARNING(fmt::format("Cannot add more joysticks, only {} joysticks are " @@ -396,7 +395,7 @@ JoystickCameraStates::JoystickCameraState* return nullptr; } } - return joystickCameraState; + return joystick; } diff --git a/src/interaction/joystickinputstate.cpp b/src/interaction/joystickinputstate.cpp index 9c0da27225..170a40e296 100644 --- a/src/interaction/joystickinputstate.cpp +++ b/src/interaction/joystickinputstate.cpp @@ -36,7 +36,7 @@ namespace openspace::interaction { float JoystickInputStates::axis(const std::string& joystickName, int axis) const { ghoul_precondition(axis >= 0, "axis must be 0 or positive"); - if(joystickName.empty()) { + if (joystickName.empty()) { float res = std::accumulate( begin(), end(), @@ -63,7 +63,7 @@ float JoystickInputStates::axis(const std::string& joystickName, int axis) const } if (!state) { - return 0.0f; + return 0.f; } return state->axes[axis]; @@ -72,7 +72,7 @@ float JoystickInputStates::axis(const std::string& joystickName, int axis) const bool JoystickInputStates::button(const std::string& joystickName, int button, JoystickAction action) const { ghoul_precondition(button >= 0, "button must be 0 or positive"); - if(joystickName.empty()) { + if (joystickName.empty()) { bool res = std::any_of( begin(), end(), diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index 439bcd503e..7f5ae8854e 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -498,7 +498,7 @@ void NavigationHandler::loadNavigationState(const std::string& filepath) { } } -void NavigationHandler::setJoystickAxisMapping(const std::string& joystickName, int axis, +void NavigationHandler::setJoystickAxisMapping(std::string joystickName, int axis, JoystickCameraStates::AxisType mapping, JoystickCameraStates::AxisInvert shouldInvert, JoystickCameraStates::JoystickType joystickType, @@ -506,7 +506,7 @@ void NavigationHandler::setJoystickAxisMapping(const std::string& joystickName, double sensitivity) { _orbitalNavigator.joystickStates().setAxisMapping( - joystickName, + std::move(joystickName), axis, mapping, shouldInvert, @@ -516,17 +516,17 @@ void NavigationHandler::setJoystickAxisMapping(const std::string& joystickName, ); } -void NavigationHandler::setJoystickAxisMappingProperty(const std::string& joystickName, +void NavigationHandler::setJoystickAxisMappingProperty(std::string joystickName, int axis, - const std::string& propertyUri, + std::string propertyUri, float min, float max, JoystickCameraStates::AxisInvert shouldInvert, bool isRemote) { _orbitalNavigator.joystickStates().setAxisMappingProperty( - joystickName, + std::move(joystickName), axis, - propertyUri, + std::move(propertyUri), min, max, shouldInvert, diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index 9be6957ce2..0b7faca565 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -164,7 +164,7 @@ int bindJoystickAxis(lua_State* L) { joystickType = joystickType.value_or("JoystickLike"); global::navigationHandler->setJoystickAxisMapping( - joystickName, + std::move(joystickName), axis, ghoul::from_string(axisType), interaction::JoystickCameraStates::AxisInvert(*shouldInvert), @@ -188,9 +188,9 @@ int bindJoystickAxisProperty(lua_State* L) { isRemote = isRemote.value_or(true); global::navigationHandler->setJoystickAxisMappingProperty( - joystickName, + std::move(joystickName), axis, - propertyUri, + std::move(propertyUri), *min, *max, interaction::JoystickCameraStates::AxisInvert(*shouldInvert), From cc0a7b05cec66a32b53c1aaf48b46e6f1bc1fa30 Mon Sep 17 00:00:00 2001 From: Malin E Date: Tue, 30 Nov 2021 12:11:08 +0100 Subject: [PATCH 013/117] Add example asset for binding property to joystick --- data/assets/examples/joystickProperty.asset | 84 +++++++++++++++++++++ src/navigation/navigationhandler_lua.inl | 2 +- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 data/assets/examples/joystickProperty.asset diff --git a/data/assets/examples/joystickProperty.asset b/data/assets/examples/joystickProperty.asset new file mode 100644 index 0000000000..a3a7ad6a12 --- /dev/null +++ b/data/assets/examples/joystickProperty.asset @@ -0,0 +1,84 @@ +-- Allowed values for the third parameter of bindJoystickAxis: +-- "None" +-- "Orbit X" +-- "Orbit Y" +-- "Zoom" -- both in and out +-- "Zoom In" +-- "Zoom Out" +-- "LocalRoll X" +-- "LocalRoll Y" +-- "GlobalRoll X" +-- "GlobalRoll Y" +-- "Pan X" +-- "Pan Y" +-- Fourth parameter determines whether the axis should be inverted +-- Fifth parameter determines whether the axis behaves like a joystick or a Trigger. +-- Allowed values are "JoystickLike" and "TriggerLike", the first one is the default +-- Sixth parameters determins if the axis should be "Sticky" or not. +-- The axis values can either go back to 0 when the joystick is released or it can +-- stay at the value it was before the joystick was released. +-- The latter is called a sticky axis, when the values don't go back to 0. +-- Seventh parameter is the sensitivity for the axis + + +-- Parameters for bindJoystickAxisProperty: +-- First - Name of the joystick that should be bound +-- Second - Which axis should be bound of this joystick +-- Third - The property uri +-- Fourth - (optional) The smallest value that you wnat to allow this property on the joystick +-- Fifth - (optional) The largest value that you wnat to allow this property on the joystick +-- Sixth - (optional) Determines whether the axis should be inverted +-- Seventh - (optional) Should this property change be sent to other connected remote sessions + +local XBoxController = { + LeftThumbStick = { 0 , 1 }, + RightThumbStick = { 2, 3 }, + LeftTrigger = 4, + RightTrigger = 5, + A = 0, + B = 1, + X = 2, + Y = 3, + LB = 4, + RB = 5, + Select = 6, + Start = 7, + LeftStickButton = 8, + RightStickButton = 9, + DPad = { + Up = 10, + Right = 11, + Down = 12, + Left = 13 + } +} + +isPropertyBound = true; + +local freezeValue = function(name, axis, min, max) + return [[ + if isPropertyBound then + openspace.navigation.bindJoystickAxis(']] .. name .. "', " .. axis .. [[, "None"); + isPropertyBound = false; + else + openspace.navigation.bindJoystickAxisProperty(']] .. name .. "', " .. axis .. [[, 'Scene.Earth.Scale.Scale', ]] .. min ..", " .. max.. [[); + isPropertyBound = true; + end + ]] +end + +asset.onInitialize(function() + local controller = XBoxController; + local name = "Xbox Controller"; + + -- Bind Right trigger to Earth Scale + openspace.navigation.bindJoystickAxisProperty(name, controller.RightTrigger, "Scene.Earth.Scale.Scale", 0.1, 100); + + -- Bind 'A' button to freeze current value + openspace.navigation.bindJoystickButton( + name, + controller.A, + freezeValue(name, controller.RightTrigger, 0.1, 100), + "Freeze current scale for Earth. Or release it to the trigger again." + ) +end) diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index 0b7faca565..85a9034d78 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -176,7 +176,7 @@ int bindJoystickAxis(lua_State* L) { } int bindJoystickAxisProperty(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, { 3, 9 }, "lua::bindJoystickAxisProperty"); + ghoul::lua::checkArgumentsAndThrow(L, { 3, 7 }, "lua::bindJoystickAxisProperty"); auto [joystickName, axis, propertyUri, min, max, shouldInvert, isRemote] = ghoul::lua::values< std::string, int, std::string, std::optional, std::optional, From 8766ba1242b00bf255b34224325cf8fa240db453 Mon Sep 17 00:00:00 2001 From: Malin E Date: Tue, 30 Nov 2021 17:22:46 +0100 Subject: [PATCH 014/117] Remove local variable in example --- data/assets/examples/joystickProperty.asset | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/data/assets/examples/joystickProperty.asset b/data/assets/examples/joystickProperty.asset index a3a7ad6a12..a5aedceace 100644 --- a/data/assets/examples/joystickProperty.asset +++ b/data/assets/examples/joystickProperty.asset @@ -53,10 +53,16 @@ local XBoxController = { } } -isPropertyBound = true; - local freezeValue = function(name, axis, min, max) return [[ + local joystickType = openspace.navigation.joystickAxis(']] .. name .. "', " .. axis .. [[); + local isPropertyBound = true; + if joystickType == "None" then + isPropertyBound = false; + else + isPropertyBound = true; + end + if isPropertyBound then openspace.navigation.bindJoystickAxis(']] .. name .. "', " .. axis .. [[, "None"); isPropertyBound = false; From 332850999ade212b3ee093a88308f9d550121d4a Mon Sep 17 00:00:00 2001 From: Malin E Date: Mon, 6 Dec 2021 15:59:39 +0100 Subject: [PATCH 015/117] Add osc files --- ext/osc/CMakeLists.txt | 53 ++ ext/osc/LICENSE | 34 + ext/osc/ip/IpEndpointName.cpp | 88 ++ ext/osc/ip/IpEndpointName.h | 83 ++ ext/osc/ip/NetworkingUtils.h | 56 ++ ext/osc/ip/PacketListener.h | 50 ++ ext/osc/ip/TimerListener.h | 47 ++ ext/osc/ip/UdpSocket.h | 177 ++++ ext/osc/ip/posix/NetworkingUtils.cpp | 64 ++ ext/osc/ip/posix/UdpSocket.cpp | 605 +++++++++++++ ext/osc/ip/win32/NetworkingUtils.cpp | 95 +++ ext/osc/ip/win32/UdpSocket.cpp | 574 +++++++++++++ ext/osc/osc/MessageMappingOscPacketListener.h | 80 ++ ext/osc/osc/OscException.h | 62 ++ ext/osc/osc/OscHostEndianness.h | 127 +++ ext/osc/osc/OscOutboundPacketStream.cpp | 683 +++++++++++++++ ext/osc/osc/OscOutboundPacketStream.h | 155 ++++ ext/osc/osc/OscPacketListener.h | 79 ++ ext/osc/osc/OscPrintReceivedElements.cpp | 261 ++++++ ext/osc/osc/OscPrintReceivedElements.h | 54 ++ ext/osc/osc/OscReceivedElements.cpp | 796 ++++++++++++++++++ ext/osc/osc/OscReceivedElements.h | 548 ++++++++++++ ext/osc/osc/OscTypes.cpp | 52 ++ ext/osc/osc/OscTypes.h | 240 ++++++ 24 files changed, 5063 insertions(+) create mode 100644 ext/osc/CMakeLists.txt create mode 100644 ext/osc/LICENSE create mode 100644 ext/osc/ip/IpEndpointName.cpp create mode 100644 ext/osc/ip/IpEndpointName.h create mode 100644 ext/osc/ip/NetworkingUtils.h create mode 100644 ext/osc/ip/PacketListener.h create mode 100644 ext/osc/ip/TimerListener.h create mode 100644 ext/osc/ip/UdpSocket.h create mode 100644 ext/osc/ip/posix/NetworkingUtils.cpp create mode 100644 ext/osc/ip/posix/UdpSocket.cpp create mode 100644 ext/osc/ip/win32/NetworkingUtils.cpp create mode 100644 ext/osc/ip/win32/UdpSocket.cpp create mode 100644 ext/osc/osc/MessageMappingOscPacketListener.h create mode 100644 ext/osc/osc/OscException.h create mode 100644 ext/osc/osc/OscHostEndianness.h create mode 100644 ext/osc/osc/OscOutboundPacketStream.cpp create mode 100644 ext/osc/osc/OscOutboundPacketStream.h create mode 100644 ext/osc/osc/OscPacketListener.h create mode 100644 ext/osc/osc/OscPrintReceivedElements.cpp create mode 100644 ext/osc/osc/OscPrintReceivedElements.h create mode 100644 ext/osc/osc/OscReceivedElements.cpp create mode 100644 ext/osc/osc/OscReceivedElements.h create mode 100644 ext/osc/osc/OscTypes.cpp create mode 100644 ext/osc/osc/OscTypes.h diff --git a/ext/osc/CMakeLists.txt b/ext/osc/CMakeLists.txt new file mode 100644 index 0000000000..27c30e8a18 --- /dev/null +++ b/ext/osc/CMakeLists.txt @@ -0,0 +1,53 @@ +cmake_minimum_required(VERSION 2.6) +PROJECT(Oscpack) +message(STATUS "Generating oscpack project") + +# separate versions of NetworkingUtils.cpp and UdpSocket.cpp are provided for Win32 and POSIX +# the IpSystemTypePath selects the correct ones based on the current platform + +IF(WIN32) + set(IpSystemTypePath ip/win32) +ELSE(WIN32) + set(IpSystemTypePath ip/posix) +ENDIF(WIN32) + +ADD_LIBRARY(oscpack + ip/IpEndpointName.h + ip/IpEndpointName.cpp + ip/NetworkingUtils.h + ${IpSystemTypePath}/NetworkingUtils.cpp + ip/UdpSocket.h + ${IpSystemTypePath}/UdpSocket.cpp + ip/PacketListener.h + ip/TimerListener.h + osc/OscTypes.h + osc/OscTypes.cpp + osc/OscHostEndianness.h + osc/OscException.h + osc/OscPacketListener.h + osc/MessageMappingOscPacketListener.h + osc/OscReceivedElements.h + osc/OscReceivedElements.cpp + osc/OscPrintReceivedElements.h + osc/OscPrintReceivedElements.cpp + osc/OscOutboundPacketStream.h + osc/OscOutboundPacketStream.cpp +) + +TARGET_INCLUDE_DIRECTORIES(oscpack PUBLIC ${CMAKE_SOURCE_DIR}) + +IF(WIN32) + target_link_libraries(oscpack PUBLIC Ws2_32 winmm) +ENDIF(WIN32) + +if(MSVC) + # Force to always compile with W4 + if(CMAKE_CXX_FLAGS MATCHES /W[0-4]) + string(REGEX REPLACE /W[0-4] /W4 CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + else() + set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} /W4) + endif() +elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + # Update if necessary + set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-long-long -pedantic) +endif() diff --git a/ext/osc/LICENSE b/ext/osc/LICENSE new file mode 100644 index 0000000000..ebaaac1977 --- /dev/null +++ b/ext/osc/LICENSE @@ -0,0 +1,34 @@ +oscpack -- Open Sound Control (OSC) packet manipulation library +http://www.rossbencina.com/code/oscpack + +Copyright (c) 2004-2013 Ross Bencina + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files +(the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### + +The text above constitutes the entire oscpack license; however, +the oscpack developer(s) also make the following non-binding requests: + +Any person wishing to distribute modifications to the Software is +requested to send the modifications to the original developer so that +they can be incorporated into the canonical version. It is also +requested that these non-binding requests be included whenever the +above license is reproduced. \ No newline at end of file diff --git a/ext/osc/ip/IpEndpointName.cpp b/ext/osc/ip/IpEndpointName.cpp new file mode 100644 index 0000000000..50b0262216 --- /dev/null +++ b/ext/osc/ip/IpEndpointName.cpp @@ -0,0 +1,88 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#include "IpEndpointName.h" + +#include + +#include "NetworkingUtils.h" + + +unsigned long IpEndpointName::GetHostByName( const char *s ) +{ + return ::GetHostByName(s); +} + + +void IpEndpointName::AddressAsString( char *s ) const +{ + if( address == ANY_ADDRESS ){ + std::sprintf( s, "" ); + }else{ + std::sprintf( s, "%d.%d.%d.%d", + (int)((address >> 24) & 0xFF), + (int)((address >> 16) & 0xFF), + (int)((address >> 8) & 0xFF), + (int)(address & 0xFF) ); + } +} + + +void IpEndpointName::AddressAndPortAsString( char *s ) const +{ + if( port == ANY_PORT ){ + if( address == ANY_ADDRESS ){ + std::sprintf( s, ":" ); + }else{ + std::sprintf( s, "%d.%d.%d.%d:", + (int)((address >> 24) & 0xFF), + (int)((address >> 16) & 0xFF), + (int)((address >> 8) & 0xFF), + (int)(address & 0xFF) ); + } + }else{ + if( address == ANY_ADDRESS ){ + std::sprintf( s, ":%d", port ); + }else{ + std::sprintf( s, "%d.%d.%d.%d:%d", + (int)((address >> 24) & 0xFF), + (int)((address >> 16) & 0xFF), + (int)((address >> 8) & 0xFF), + (int)(address & 0xFF), + (int)port ); + } + } +} diff --git a/ext/osc/ip/IpEndpointName.h b/ext/osc/ip/IpEndpointName.h new file mode 100644 index 0000000000..c83e1c3cfe --- /dev/null +++ b/ext/osc/ip/IpEndpointName.h @@ -0,0 +1,83 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_IPENDPOINTNAME_H +#define INCLUDED_OSCPACK_IPENDPOINTNAME_H + + +class IpEndpointName{ + static unsigned long GetHostByName( const char *s ); +public: + static const unsigned long ANY_ADDRESS = 0xFFFFFFFF; + static const int ANY_PORT = -1; + + IpEndpointName() + : address( ANY_ADDRESS ), port( ANY_PORT ) {} + IpEndpointName( int port_ ) + : address( ANY_ADDRESS ), port( port_ ) {} + IpEndpointName( unsigned long ipAddress_, int port_ ) + : address( ipAddress_ ), port( port_ ) {} + IpEndpointName( const char *addressName, int port_=ANY_PORT ) + : address( GetHostByName( addressName ) ) + , port( port_ ) {} + IpEndpointName( int addressA, int addressB, int addressC, int addressD, int port_=ANY_PORT ) + : address( ( (addressA << 24) | (addressB << 16) | (addressC << 8) | addressD ) ) + , port( port_ ) {} + + // address and port are maintained in host byte order here + unsigned long address; + int port; + + bool IsMulticastAddress() const { return ((address >> 24) & 0xFF) >= 224 && ((address >> 24) & 0xFF) <= 239; } + + enum { ADDRESS_STRING_LENGTH=17 }; + void AddressAsString( char *s ) const; + + enum { ADDRESS_AND_PORT_STRING_LENGTH=23}; + void AddressAndPortAsString( char *s ) const; +}; + +inline bool operator==( const IpEndpointName& lhs, const IpEndpointName& rhs ) +{ + return (lhs.address == rhs.address && lhs.port == rhs.port ); +} + +inline bool operator!=( const IpEndpointName& lhs, const IpEndpointName& rhs ) +{ + return !(lhs == rhs); +} + +#endif /* INCLUDED_OSCPACK_IPENDPOINTNAME_H */ diff --git a/ext/osc/ip/NetworkingUtils.h b/ext/osc/ip/NetworkingUtils.h new file mode 100644 index 0000000000..a83612aeda --- /dev/null +++ b/ext/osc/ip/NetworkingUtils.h @@ -0,0 +1,56 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_NETWORKINGUTILS_H +#define INCLUDED_OSCPACK_NETWORKINGUTILS_H + + +// in general NetworkInitializer is only used internally, but if you're +// application creates multiple sockets from different threads at runtime you +// should instantiate one of these in main just to make sure the networking +// layer is initialized. +class NetworkInitializer{ +public: + NetworkInitializer(); + ~NetworkInitializer(); +}; + + +// return ip address of host name in host byte order +unsigned long GetHostByName( const char *name ); + + +#endif /* INCLUDED_OSCPACK_NETWORKINGUTILS_H */ diff --git a/ext/osc/ip/PacketListener.h b/ext/osc/ip/PacketListener.h new file mode 100644 index 0000000000..6c26b32996 --- /dev/null +++ b/ext/osc/ip/PacketListener.h @@ -0,0 +1,50 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_PACKETLISTENER_H +#define INCLUDED_OSCPACK_PACKETLISTENER_H + + +class IpEndpointName; + +class PacketListener{ +public: + virtual ~PacketListener() {} + virtual void ProcessPacket( const char *data, int size, + const IpEndpointName& remoteEndpoint ) = 0; +}; + +#endif /* INCLUDED_OSCPACK_PACKETLISTENER_H */ diff --git a/ext/osc/ip/TimerListener.h b/ext/osc/ip/TimerListener.h new file mode 100644 index 0000000000..59b4040600 --- /dev/null +++ b/ext/osc/ip/TimerListener.h @@ -0,0 +1,47 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_TIMERLISTENER_H +#define INCLUDED_OSCPACK_TIMERLISTENER_H + + +class TimerListener{ +public: + virtual ~TimerListener() {} + virtual void TimerExpired() = 0; +}; + +#endif /* INCLUDED_OSCPACK_TIMERLISTENER_H */ diff --git a/ext/osc/ip/UdpSocket.h b/ext/osc/ip/UdpSocket.h new file mode 100644 index 0000000000..fd18a7a8e0 --- /dev/null +++ b/ext/osc/ip/UdpSocket.h @@ -0,0 +1,177 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_UDPSOCKET_H +#define INCLUDED_OSCPACK_UDPSOCKET_H + +#include // size_t + +#include "NetworkingUtils.h" +#include "IpEndpointName.h" + + +class PacketListener; +class TimerListener; + +class UdpSocket; + +class SocketReceiveMultiplexer{ + class Implementation; + Implementation *impl_; + + friend class UdpSocket; + +public: + SocketReceiveMultiplexer(); + ~SocketReceiveMultiplexer(); + + // only call the attach/detach methods _before_ calling Run + + // only one listener per socket, each socket at most once + void AttachSocketListener( UdpSocket *socket, PacketListener *listener ); + void DetachSocketListener( UdpSocket *socket, PacketListener *listener ); + + void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ); + void AttachPeriodicTimerListener( + int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ); + void DetachPeriodicTimerListener( TimerListener *listener ); + + void Run(); // loop and block processing messages indefinitely + void RunUntilSigInt(); + void Break(); // call this from a listener to exit once the listener returns + void AsynchronousBreak(); // call this from another thread or signal handler to exit the Run() state +}; + + +class UdpSocket{ + class Implementation; + Implementation *impl_; + + friend class SocketReceiveMultiplexer::Implementation; + +public: + + // Ctor throws std::runtime_error if there's a problem + // initializing the socket. + UdpSocket(); + virtual ~UdpSocket(); + + // Enable broadcast addresses (e.g. x.x.x.255) + // Sets SO_BROADCAST socket option. + void SetEnableBroadcast( bool enableBroadcast ); + + // Enable multiple listeners for a single port on same + // network interface* + // Sets SO_REUSEADDR (also SO_REUSEPORT on OS X). + // [*] The exact behavior of SO_REUSEADDR and + // SO_REUSEPORT is undefined for some common cases + // and may have drastically different behavior on different + // operating systems. + void SetAllowReuse( bool allowReuse ); + + + // The socket is created in an unbound, unconnected state + // such a socket can only be used to send to an arbitrary + // address using SendTo(). To use Send() you need to first + // connect to a remote endpoint using Connect(). To use + // ReceiveFrom you need to first bind to a local endpoint + // using Bind(). + + // Retrieve the local endpoint name when sending to 'to' + IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const; + + // Connect to a remote endpoint which is used as the target + // for calls to Send() + void Connect( const IpEndpointName& remoteEndpoint ); + void Send( const char *data, std::size_t size ); + void SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ); + + + // Bind a local endpoint to receive incoming data. Endpoint + // can be 'any' for the system to choose an endpoint + void Bind( const IpEndpointName& localEndpoint ); + bool IsBound() const; + + std::size_t ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ); +}; + + +// convenience classes for transmitting and receiving +// they just call Connect and/or Bind in the ctor. +// note that you can still use a receive socket +// for transmitting etc + +class UdpTransmitSocket : public UdpSocket{ +public: + UdpTransmitSocket() = default; + UdpTransmitSocket( const IpEndpointName& remoteEndpoint ) + { Connect( remoteEndpoint ); } +}; + + +class UdpReceiveSocket : public UdpSocket{ +public: + UdpReceiveSocket( const IpEndpointName& localEndpoint ) + { Bind( localEndpoint ); } +}; + + +// UdpListeningReceiveSocket provides a simple way to bind one listener +// to a single socket without having to manually set up a SocketReceiveMultiplexer + +class UdpListeningReceiveSocket : public UdpSocket{ + SocketReceiveMultiplexer mux_; + PacketListener *listener_; +public: + UdpListeningReceiveSocket( const IpEndpointName& localEndpoint, PacketListener *listener ) + : listener_( listener ) + { + Bind( localEndpoint ); + mux_.AttachSocketListener( this, listener_ ); + } + + ~UdpListeningReceiveSocket() + { mux_.DetachSocketListener( this, listener_ ); } + + // see SocketReceiveMultiplexer above for the behaviour of these methods... + void Run() { mux_.Run(); } + void RunUntilSigInt() { mux_.RunUntilSigInt(); } + void Break() { mux_.Break(); } + void AsynchronousBreak() { mux_.AsynchronousBreak(); } +}; + + +#endif /* INCLUDED_OSCPACK_UDPSOCKET_H */ diff --git a/ext/osc/ip/posix/NetworkingUtils.cpp b/ext/osc/ip/posix/NetworkingUtils.cpp new file mode 100644 index 0000000000..00011c98d3 --- /dev/null +++ b/ext/osc/ip/posix/NetworkingUtils.cpp @@ -0,0 +1,64 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#include "modules/sonification/ext/osc/ip/NetworkingUtils.h" + +#include +#include +#include + +#include + + + +NetworkInitializer::NetworkInitializer() {} + +NetworkInitializer::~NetworkInitializer() {} + + +unsigned long GetHostByName( const char *name ) +{ + unsigned long result = 0; + + struct hostent *h = gethostbyname( name ); + if( h ){ + struct in_addr a; + std::memcpy( &a, h->h_addr_list[0], h->h_length ); + result = ntohl(a.s_addr); + } + + return result; +} diff --git a/ext/osc/ip/posix/UdpSocket.cpp b/ext/osc/ip/posix/UdpSocket.cpp new file mode 100644 index 0000000000..e1fcb375da --- /dev/null +++ b/ext/osc/ip/posix/UdpSocket.cpp @@ -0,0 +1,605 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#include "ip/UdpSocket.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include // for sockaddr_in + +#include +#include +#include +#include + +#include +#include +#include // for memset +#include +#include + +#include "modules/sonification/ext/osc/ip/PacketListener.h" +#include "modules/sonification/ext/osc/ip/TimerListener.h" + + +#if defined(__APPLE__) && !defined(_SOCKLEN_T) +// pre system 10.3 didn't have socklen_t +typedef ssize_t socklen_t; +#endif + + +static void SockaddrFromIpEndpointName( struct sockaddr_in& sockAddr, const IpEndpointName& endpoint ) +{ + std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) ); + sockAddr.sin_family = AF_INET; + + sockAddr.sin_addr.s_addr = + (endpoint.address == IpEndpointName::ANY_ADDRESS) + ? INADDR_ANY + : htonl( endpoint.address ); + + sockAddr.sin_port = + (endpoint.port == IpEndpointName::ANY_PORT) + ? 0 + : htons( endpoint.port ); +} + + +static IpEndpointName IpEndpointNameFromSockaddr( const struct sockaddr_in& sockAddr ) +{ + return IpEndpointName( + (sockAddr.sin_addr.s_addr == INADDR_ANY) + ? IpEndpointName::ANY_ADDRESS + : ntohl( sockAddr.sin_addr.s_addr ), + (sockAddr.sin_port == 0) + ? IpEndpointName::ANY_PORT + : ntohs( sockAddr.sin_port ) + ); +} + + +class UdpSocket::Implementation{ + bool isBound_; + bool isConnected_; + + int socket_; + struct sockaddr_in connectedAddr_; + struct sockaddr_in sendToAddr_; + +public: + + Implementation() + : isBound_( false ) + , isConnected_( false ) + , socket_( -1 ) + { + if( (socket_ = socket( AF_INET, SOCK_DGRAM, 0 )) == -1 ){ + throw std::runtime_error("unable to create udp socket\n"); + } + + std::memset( &sendToAddr_, 0, sizeof(sendToAddr_) ); + sendToAddr_.sin_family = AF_INET; + } + + ~Implementation() + { + if (socket_ != -1) close(socket_); + } + + void SetEnableBroadcast( bool enableBroadcast ) + { + int broadcast = (enableBroadcast) ? 1 : 0; // int on posix + setsockopt(socket_, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast)); + } + + void SetAllowReuse( bool allowReuse ) + { + int reuseAddr = (allowReuse) ? 1 : 0; // int on posix + setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &reuseAddr, sizeof(reuseAddr)); + +#ifdef __APPLE__ + // needed also for OS X - enable multiple listeners for a single port on same network interface + int reusePort = (allowReuse) ? 1 : 0; // int on posix + setsockopt(socket_, SOL_SOCKET, SO_REUSEPORT, &reusePort, sizeof(reusePort)); +#endif + } + + IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const + { + assert( isBound_ ); + + // first connect the socket to the remote server + + struct sockaddr_in connectSockAddr; + SockaddrFromIpEndpointName( connectSockAddr, remoteEndpoint ); + + if (connect(socket_, (struct sockaddr *)&connectSockAddr, sizeof(connectSockAddr)) < 0) { + throw std::runtime_error("unable to connect udp socket\n"); + } + + // get the address + + struct sockaddr_in sockAddr; + std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) ); + socklen_t length = sizeof(sockAddr); + if (getsockname(socket_, (struct sockaddr *)&sockAddr, &length) < 0) { + throw std::runtime_error("unable to getsockname\n"); + } + + if( isConnected_ ){ + // reconnect to the connected address + + if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) { + throw std::runtime_error("unable to connect udp socket\n"); + } + + }else{ + // unconnect from the remote address + + struct sockaddr_in unconnectSockAddr; + std::memset( (char *)&unconnectSockAddr, 0, sizeof(unconnectSockAddr ) ); + unconnectSockAddr.sin_family = AF_UNSPEC; + // address fields are zero + int connectResult = connect(socket_, (struct sockaddr *)&unconnectSockAddr, sizeof(unconnectSockAddr)); + if ( connectResult < 0 && errno != EAFNOSUPPORT ) { + throw std::runtime_error("unable to un-connect udp socket\n"); + } + } + + return IpEndpointNameFromSockaddr( sockAddr ); + } + + void Connect( const IpEndpointName& remoteEndpoint ) + { + SockaddrFromIpEndpointName( connectedAddr_, remoteEndpoint ); + + if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) { + throw std::runtime_error("unable to connect udp socket\n"); + } + + isConnected_ = true; + } + + void Send( const char *data, std::size_t size ) + { + assert( isConnected_ ); + + int iResult = send( socket_, data, size, 0 ); + if(iResult == SOCKET_ERROR) { + printf("send failed with error: %d\n", WSAGetLastError()); + } + } + + void SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ) + { + sendToAddr_.sin_addr.s_addr = htonl( remoteEndpoint.address ); + sendToAddr_.sin_port = htons( remoteEndpoint.port ); + + sendto( socket_, data, size, 0, (sockaddr*)&sendToAddr_, sizeof(sendToAddr_) ); + } + + void Bind( const IpEndpointName& localEndpoint ) + { + struct sockaddr_in bindSockAddr; + SockaddrFromIpEndpointName( bindSockAddr, localEndpoint ); + + if (bind(socket_, (struct sockaddr *)&bindSockAddr, sizeof(bindSockAddr)) < 0) { + throw std::runtime_error("unable to bind udp socket\n"); + } + + isBound_ = true; + } + + bool IsBound() const { return isBound_; } + + std::size_t ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ) + { + assert( isBound_ ); + + struct sockaddr_in fromAddr; + socklen_t fromAddrLen = sizeof(fromAddr); + + ssize_t result = recvfrom(socket_, data, size, 0, + (struct sockaddr *) &fromAddr, (socklen_t*)&fromAddrLen); + if( result < 0 ) + return 0; + + remoteEndpoint.address = ntohl(fromAddr.sin_addr.s_addr); + remoteEndpoint.port = ntohs(fromAddr.sin_port); + + return (std::size_t)result; + } + + int Socket() { return socket_; } +}; + +UdpSocket::UdpSocket() +{ + impl_ = new Implementation(); +} + +UdpSocket::~UdpSocket() +{ + delete impl_; +} + +void UdpSocket::SetEnableBroadcast( bool enableBroadcast ) +{ + impl_->SetEnableBroadcast( enableBroadcast ); +} + +void UdpSocket::SetAllowReuse( bool allowReuse ) +{ + impl_->SetAllowReuse( allowReuse ); +} + +IpEndpointName UdpSocket::LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const +{ + return impl_->LocalEndpointFor( remoteEndpoint ); +} + +void UdpSocket::Connect( const IpEndpointName& remoteEndpoint ) +{ + impl_->Connect( remoteEndpoint ); +} + +void UdpSocket::Send( const char *data, std::size_t size ) +{ + impl_->Send( data, size ); +} + +void UdpSocket::SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ) +{ + impl_->SendTo( remoteEndpoint, data, size ); +} + +void UdpSocket::Bind( const IpEndpointName& localEndpoint ) +{ + impl_->Bind( localEndpoint ); +} + +bool UdpSocket::IsBound() const +{ + return impl_->IsBound(); +} + +std::size_t UdpSocket::ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ) +{ + return impl_->ReceiveFrom( remoteEndpoint, data, size ); +} + + +struct AttachedTimerListener{ + AttachedTimerListener( int id, int p, TimerListener *tl ) + : initialDelayMs( id ) + , periodMs( p ) + , listener( tl ) {} + int initialDelayMs; + int periodMs; + TimerListener *listener; +}; + + +static bool CompareScheduledTimerCalls( + const std::pair< double, AttachedTimerListener > & lhs, const std::pair< double, AttachedTimerListener > & rhs ) +{ + return lhs.first < rhs.first; +} + + +SocketReceiveMultiplexer *multiplexerInstanceToAbortWithSigInt_ = 0; + +extern "C" /*static*/ void InterruptSignalHandler( int ); +/*static*/ void InterruptSignalHandler( int ) +{ + multiplexerInstanceToAbortWithSigInt_->AsynchronousBreak(); + signal( SIGINT, SIG_DFL ); +} + + +class SocketReceiveMultiplexer::Implementation{ + std::vector< std::pair< PacketListener*, UdpSocket* > > socketListeners_; + std::vector< AttachedTimerListener > timerListeners_; + + volatile bool break_; + int breakPipe_[2]; // [0] is the reader descriptor and [1] the writer + + double GetCurrentTimeMs() const + { + struct timeval t; + + gettimeofday( &t, 0 ); + + return ((double)t.tv_sec*1000.) + ((double)t.tv_usec / 1000.); + } + +public: + Implementation() + { + if( pipe(breakPipe_) != 0 ) + throw std::runtime_error( "creation of asynchronous break pipes failed\n" ); + } + + ~Implementation() + { + close( breakPipe_[0] ); + close( breakPipe_[1] ); + } + + void AttachSocketListener( UdpSocket *socket, PacketListener *listener ) + { + assert( std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ) == socketListeners_.end() ); + // we don't check that the same socket has been added multiple times, even though this is an error + socketListeners_.push_back( std::make_pair( listener, socket ) ); + } + + void DetachSocketListener( UdpSocket *socket, PacketListener *listener ) + { + std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = + std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ); + assert( i != socketListeners_.end() ); + + socketListeners_.erase( i ); + } + + void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ) + { + timerListeners_.push_back( AttachedTimerListener( periodMilliseconds, periodMilliseconds, listener ) ); + } + + void AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ) + { + timerListeners_.push_back( AttachedTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ) ); + } + + void DetachPeriodicTimerListener( TimerListener *listener ) + { + std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin(); + while( i != timerListeners_.end() ){ + if( i->listener == listener ) + break; + ++i; + } + + assert( i != timerListeners_.end() ); + + timerListeners_.erase( i ); + } + + void Run() + { + break_ = false; + char *data = 0; + + try{ + + // configure the master fd_set for select() + + fd_set masterfds, tempfds; + FD_ZERO( &masterfds ); + FD_ZERO( &tempfds ); + + // in addition to listening to the inbound sockets we + // also listen to the asynchronous break pipe, so that AsynchronousBreak() + // can break us out of select() from another thread. + FD_SET( breakPipe_[0], &masterfds ); + int fdmax = breakPipe_[0]; + + for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin(); + i != socketListeners_.end(); ++i ){ + + if( fdmax < i->second->impl_->Socket() ) + fdmax = i->second->impl_->Socket(); + FD_SET( i->second->impl_->Socket(), &masterfds ); + } + + + // configure the timer queue + double currentTimeMs = GetCurrentTimeMs(); + + // expiry time ms, listener + std::vector< std::pair< double, AttachedTimerListener > > timerQueue_; + for( std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin(); + i != timerListeners_.end(); ++i ) + timerQueue_.push_back( std::make_pair( currentTimeMs + i->initialDelayMs, *i ) ); + std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls ); + + const int MAX_BUFFER_SIZE = 4098; + data = new char[ MAX_BUFFER_SIZE ]; + IpEndpointName remoteEndpoint; + + struct timeval timeout; + + while( !break_ ){ + tempfds = masterfds; + + struct timeval *timeoutPtr = 0; + if( !timerQueue_.empty() ){ + double timeoutMs = timerQueue_.front().first - GetCurrentTimeMs(); + if( timeoutMs < 0 ) + timeoutMs = 0; + + long timoutSecondsPart = (long)(timeoutMs * .001); + timeout.tv_sec = (time_t)timoutSecondsPart; + // 1000000 microseconds in a second + timeout.tv_usec = (suseconds_t)((timeoutMs - (timoutSecondsPart * 1000)) * 1000); + timeoutPtr = &timeout; + } + + if( select( fdmax + 1, &tempfds, 0, 0, timeoutPtr ) < 0 ){ + if( break_ ){ + break; + }else if( errno == EINTR ){ + // on returning an error, select() doesn't clear tempfds. + // so tempfds would remain all set, which would cause read( breakPipe_[0]... + // below to block indefinitely. therefore if select returns EINTR we restart + // the while() loop instead of continuing on to below. + continue; + }else{ + throw std::runtime_error("select failed\n"); + } + } + + if( FD_ISSET( breakPipe_[0], &tempfds ) ){ + // clear pending data from the asynchronous break pipe + char c; + read( breakPipe_[0], &c, 1 ); + } + + if( break_ ) + break; + + for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin(); + i != socketListeners_.end(); ++i ){ + + if( FD_ISSET( i->second->impl_->Socket(), &tempfds ) ){ + + std::size_t size = i->second->ReceiveFrom( remoteEndpoint, data, MAX_BUFFER_SIZE ); + if( size > 0 ){ + i->first->ProcessPacket( data, (int)size, remoteEndpoint ); + if( break_ ) + break; + } + } + } + + // execute any expired timers + currentTimeMs = GetCurrentTimeMs(); + bool resort = false; + for( std::vector< std::pair< double, AttachedTimerListener > >::iterator i = timerQueue_.begin(); + i != timerQueue_.end() && i->first <= currentTimeMs; ++i ){ + + i->second.listener->TimerExpired(); + if( break_ ) + break; + + i->first += i->second.periodMs; + resort = true; + } + if( resort ) + std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls ); + } + + delete [] data; + }catch(...){ + if( data ) + delete [] data; + throw; + } + } + + void Break() + { + break_ = true; + } + + void AsynchronousBreak() + { + break_ = true; + + // Send a termination message to the asynchronous break pipe, so select() will return + write( breakPipe_[1], "!", 1 ); + } +}; + + + +SocketReceiveMultiplexer::SocketReceiveMultiplexer() +{ + impl_ = new Implementation(); +} + +SocketReceiveMultiplexer::~SocketReceiveMultiplexer() +{ + delete impl_; +} + +void SocketReceiveMultiplexer::AttachSocketListener( UdpSocket *socket, PacketListener *listener ) +{ + impl_->AttachSocketListener( socket, listener ); +} + +void SocketReceiveMultiplexer::DetachSocketListener( UdpSocket *socket, PacketListener *listener ) +{ + impl_->DetachSocketListener( socket, listener ); +} + +void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ) +{ + impl_->AttachPeriodicTimerListener( periodMilliseconds, listener ); +} + +void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ) +{ + impl_->AttachPeriodicTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ); +} + +void SocketReceiveMultiplexer::DetachPeriodicTimerListener( TimerListener *listener ) +{ + impl_->DetachPeriodicTimerListener( listener ); +} + +void SocketReceiveMultiplexer::Run() +{ + impl_->Run(); +} + +void SocketReceiveMultiplexer::RunUntilSigInt() +{ + assert( multiplexerInstanceToAbortWithSigInt_ == 0 ); /* at present we support only one multiplexer instance running until sig int */ + multiplexerInstanceToAbortWithSigInt_ = this; + signal( SIGINT, InterruptSignalHandler ); + impl_->Run(); + signal( SIGINT, SIG_DFL ); + multiplexerInstanceToAbortWithSigInt_ = 0; +} + +void SocketReceiveMultiplexer::Break() +{ + impl_->Break(); +} + +void SocketReceiveMultiplexer::AsynchronousBreak() +{ + impl_->AsynchronousBreak(); +} + diff --git a/ext/osc/ip/win32/NetworkingUtils.cpp b/ext/osc/ip/win32/NetworkingUtils.cpp new file mode 100644 index 0000000000..91f866d8ce --- /dev/null +++ b/ext/osc/ip/win32/NetworkingUtils.cpp @@ -0,0 +1,95 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#include "ip/NetworkingUtils.h" + +#include // this must come first to prevent errors with MSVC7 +#include + +#include + + +static LONG initCount_ = 0; +static bool winsockInitialized_ = false; + +NetworkInitializer::NetworkInitializer() +{ + if( InterlockedIncrement( &initCount_ ) == 1 ){ + // there is a race condition here if one thread tries to access + // the library while another is still initializing it. + // i can't think of an easy way to fix it so i'm telling you here + // incase you need to init the library from two threads at once. + // this is why the header file advises to instantiate one of these + // in main() so that the initialization happens globally + + // initialize winsock + WSAData wsaData; + int nCode = WSAStartup(MAKEWORD(1, 1), &wsaData); + if( nCode != 0 ){ + //std::cout << "WSAStartup() failed with error code " << nCode << "\n"; + }else{ + winsockInitialized_ = true; + } + } +} + + +NetworkInitializer::~NetworkInitializer() +{ + if( InterlockedDecrement( &initCount_ ) == 0 ){ + if( winsockInitialized_ ){ + WSACleanup(); + winsockInitialized_ = false; + } + } +} + + +unsigned long GetHostByName( const char *name ) +{ + NetworkInitializer networkInitializer; + + unsigned long result = 0; + + struct hostent *h = gethostbyname( name ); + if( h ){ + struct in_addr a; + std::memcpy( &a, h->h_addr_list[0], h->h_length ); + result = ntohl(a.s_addr); + } + + return result; +} diff --git a/ext/osc/ip/win32/UdpSocket.cpp b/ext/osc/ip/win32/UdpSocket.cpp new file mode 100644 index 0000000000..4fd2b12cf1 --- /dev/null +++ b/ext/osc/ip/win32/UdpSocket.cpp @@ -0,0 +1,574 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ + +#include // this must come first to prevent errors with MSVC7 +#include +#include // for timeGetTime() + +#ifndef WINCE +#include +#endif + +#include +#include +#include // for memset +#include +#include + +#include "ip/UdpSocket.h" // usually I'd include the module header first + // but this is causing conflicts with BCB4 due to + // std::size_t usage. + +#include "ip/NetworkingUtils.h" +#include "ip/PacketListener.h" +#include "ip/TimerListener.h" + + +typedef int socklen_t; + + +static void SockaddrFromIpEndpointName( struct sockaddr_in& sockAddr, const IpEndpointName& endpoint ) +{ + std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) ); + sockAddr.sin_family = AF_INET; + + sockAddr.sin_addr.s_addr = + (endpoint.address == IpEndpointName::ANY_ADDRESS) + ? INADDR_ANY + : htonl( endpoint.address ); + + sockAddr.sin_port = + (endpoint.port == IpEndpointName::ANY_PORT) + ? (short)0 + : htons( (short)endpoint.port ); +} + + +static IpEndpointName IpEndpointNameFromSockaddr( const struct sockaddr_in& sockAddr ) +{ + return IpEndpointName( + (sockAddr.sin_addr.s_addr == INADDR_ANY) + ? IpEndpointName::ANY_ADDRESS + : ntohl( sockAddr.sin_addr.s_addr ), + (sockAddr.sin_port == 0) + ? IpEndpointName::ANY_PORT + : ntohs( sockAddr.sin_port ) + ); +} + + +class UdpSocket::Implementation{ + NetworkInitializer networkInitializer_; + + bool isBound_; + bool isConnected_; + + SOCKET socket_; + struct sockaddr_in connectedAddr_; + struct sockaddr_in sendToAddr_; + +public: + + Implementation() + : isBound_( false ) + , isConnected_( false ) + , socket_( INVALID_SOCKET ) + { + if( (socket_ = socket( AF_INET, SOCK_DGRAM, 0 )) == INVALID_SOCKET ){ + throw std::runtime_error("unable to create udp socket\n"); + } + + std::memset( &sendToAddr_, 0, sizeof(sendToAddr_) ); + sendToAddr_.sin_family = AF_INET; + } + + ~Implementation() + { + if (socket_ != INVALID_SOCKET) closesocket(socket_); + } + + void SetEnableBroadcast( bool enableBroadcast ) + { + char broadcast = (char)((enableBroadcast) ? 1 : 0); // char on win32 + setsockopt(socket_, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast)); + } + + void SetAllowReuse( bool allowReuse ) + { + // Note: SO_REUSEADDR is non-deterministic for listening sockets on Win32. See MSDN article: + // "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE" + // http://msdn.microsoft.com/en-us/library/ms740621%28VS.85%29.aspx + + char reuseAddr = (char)((allowReuse) ? 1 : 0); // char on win32 + setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &reuseAddr, sizeof(reuseAddr)); + } + + IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const + { + assert( isBound_ ); + + // first connect the socket to the remote server + + struct sockaddr_in connectSockAddr; + SockaddrFromIpEndpointName( connectSockAddr, remoteEndpoint ); + + if (connect(socket_, (struct sockaddr *)&connectSockAddr, sizeof(connectSockAddr)) < 0) { + throw std::runtime_error("unable to connect udp socket\n"); + } + + // get the address + + struct sockaddr_in sockAddr; + std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) ); + socklen_t length = sizeof(sockAddr); + if (getsockname(socket_, (struct sockaddr *)&sockAddr, &length) < 0) { + throw std::runtime_error("unable to getsockname\n"); + } + + if( isConnected_ ){ + // reconnect to the connected address + + if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) { + throw std::runtime_error("unable to connect udp socket\n"); + } + + }else{ + // unconnect from the remote address + + struct sockaddr_in unconnectSockAddr; + SockaddrFromIpEndpointName( unconnectSockAddr, IpEndpointName() ); + + if( connect(socket_, (struct sockaddr *)&unconnectSockAddr, sizeof(unconnectSockAddr)) < 0 + && WSAGetLastError() != WSAEADDRNOTAVAIL ){ + throw std::runtime_error("unable to un-connect udp socket\n"); + } + } + + return IpEndpointNameFromSockaddr( sockAddr ); + } + + void Connect( const IpEndpointName& remoteEndpoint ) + { + SockaddrFromIpEndpointName( connectedAddr_, remoteEndpoint ); + + if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) { + throw std::runtime_error("unable to connect udp socket\n"); + } + + isConnected_ = true; + } + + void Send( const char *data, std::size_t size ) + { + assert( isConnected_ ); + + int iResult = send( socket_, data, (int)size, 0 ); + if (iResult == SOCKET_ERROR) { + printf("send failed with error: %d\n", WSAGetLastError()); + } + } + + void SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ) + { + sendToAddr_.sin_addr.s_addr = htonl( remoteEndpoint.address ); + sendToAddr_.sin_port = htons( (short)remoteEndpoint.port ); + + sendto( socket_, data, (int)size, 0, (sockaddr*)&sendToAddr_, sizeof(sendToAddr_) ); + } + + void Bind( const IpEndpointName& localEndpoint ) + { + struct sockaddr_in bindSockAddr; + SockaddrFromIpEndpointName( bindSockAddr, localEndpoint ); + + if (bind(socket_, (struct sockaddr *)&bindSockAddr, sizeof(bindSockAddr)) < 0) { + throw std::runtime_error("unable to bind udp socket\n"); + } + + isBound_ = true; + } + + bool IsBound() const { return isBound_; } + + std::size_t ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ) + { + assert( isBound_ ); + + struct sockaddr_in fromAddr; + socklen_t fromAddrLen = sizeof(fromAddr); + + int result = recvfrom(socket_, data, (int)size, 0, + (struct sockaddr *) &fromAddr, (socklen_t*)&fromAddrLen); + if( result < 0 ) + return 0; + + remoteEndpoint.address = ntohl(fromAddr.sin_addr.s_addr); + remoteEndpoint.port = ntohs(fromAddr.sin_port); + + return result; + } + + SOCKET& Socket() { return socket_; } +}; + +UdpSocket::UdpSocket() +{ + impl_ = new Implementation(); +} + +UdpSocket::~UdpSocket() +{ + delete impl_; +} + +void UdpSocket::SetEnableBroadcast( bool enableBroadcast ) +{ + impl_->SetEnableBroadcast( enableBroadcast ); +} + +void UdpSocket::SetAllowReuse( bool allowReuse ) +{ + impl_->SetAllowReuse( allowReuse ); +} + +IpEndpointName UdpSocket::LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const +{ + return impl_->LocalEndpointFor( remoteEndpoint ); +} + +void UdpSocket::Connect( const IpEndpointName& remoteEndpoint ) +{ + impl_->Connect( remoteEndpoint ); +} + +void UdpSocket::Send( const char *data, std::size_t size ) +{ + impl_->Send( data, size ); +} + +void UdpSocket::SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ) +{ + impl_->SendTo( remoteEndpoint, data, size ); +} + +void UdpSocket::Bind( const IpEndpointName& localEndpoint ) +{ + impl_->Bind( localEndpoint ); +} + +bool UdpSocket::IsBound() const +{ + return impl_->IsBound(); +} + +std::size_t UdpSocket::ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ) +{ + return impl_->ReceiveFrom( remoteEndpoint, data, size ); +} + + +struct AttachedTimerListener{ + AttachedTimerListener( int id, int p, TimerListener *tl ) + : initialDelayMs( id ) + , periodMs( p ) + , listener( tl ) {} + int initialDelayMs; + int periodMs; + TimerListener *listener; +}; + + +static bool CompareScheduledTimerCalls( + const std::pair< double, AttachedTimerListener > & lhs, const std::pair< double, AttachedTimerListener > & rhs ) +{ + return lhs.first < rhs.first; +} + + +SocketReceiveMultiplexer *multiplexerInstanceToAbortWithSigInt_ = 0; + +extern "C" /*static*/ void InterruptSignalHandler( int ); +/*static*/ void InterruptSignalHandler( int ) +{ + multiplexerInstanceToAbortWithSigInt_->AsynchronousBreak(); +#ifndef WINCE + signal( SIGINT, SIG_DFL ); +#endif +} + + +class SocketReceiveMultiplexer::Implementation{ + NetworkInitializer networkInitializer_; + + std::vector< std::pair< PacketListener*, UdpSocket* > > socketListeners_; + std::vector< AttachedTimerListener > timerListeners_; + + volatile bool break_; + HANDLE breakEvent_; + + double GetCurrentTimeMs() const + { +#ifndef WINCE + return timeGetTime(); // FIXME: bad choice if you want to run for more than 40 days +#else + return 0; +#endif + } + +public: + Implementation() + { + breakEvent_ = CreateEvent( NULL, FALSE, FALSE, NULL ); + } + + ~Implementation() + { + CloseHandle( breakEvent_ ); + } + + void AttachSocketListener( UdpSocket *socket, PacketListener *listener ) + { + assert( std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ) == socketListeners_.end() ); + // we don't check that the same socket has been added multiple times, even though this is an error + socketListeners_.push_back( std::make_pair( listener, socket ) ); + } + + void DetachSocketListener( UdpSocket *socket, PacketListener *listener ) + { + std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = + std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ); + assert( i != socketListeners_.end() ); + + socketListeners_.erase( i ); + } + + void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ) + { + timerListeners_.push_back( AttachedTimerListener( periodMilliseconds, periodMilliseconds, listener ) ); + } + + void AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ) + { + timerListeners_.push_back( AttachedTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ) ); + } + + void DetachPeriodicTimerListener( TimerListener *listener ) + { + std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin(); + while( i != timerListeners_.end() ){ + if( i->listener == listener ) + break; + ++i; + } + + assert( i != timerListeners_.end() ); + + timerListeners_.erase( i ); + } + + void Run() + { + break_ = false; + + // prepare the window events which we use to wake up on incoming data + // we use this instead of select() primarily to support the AsyncBreak() + // mechanism. + + std::vector events( socketListeners_.size() + 1, 0 ); + int j=0; + for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin(); + i != socketListeners_.end(); ++i, ++j ){ + + HANDLE event = CreateEvent( NULL, FALSE, FALSE, NULL ); + WSAEventSelect( i->second->impl_->Socket(), event, FD_READ ); // note that this makes the socket non-blocking which is why we can safely call RecieveFrom() on all sockets below + events[j] = event; + } + + + events[ socketListeners_.size() ] = breakEvent_; // last event in the collection is the break event + + + // configure the timer queue + double currentTimeMs = GetCurrentTimeMs(); + + // expiry time ms, listener + std::vector< std::pair< double, AttachedTimerListener > > timerQueue_; + for( std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin(); + i != timerListeners_.end(); ++i ) + timerQueue_.push_back( std::make_pair( currentTimeMs + i->initialDelayMs, *i ) ); + std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls ); + + const int MAX_BUFFER_SIZE = 4098; + char *data = new char[ MAX_BUFFER_SIZE ]; + IpEndpointName remoteEndpoint; + + while( !break_ ){ + + double currentTimeMs = GetCurrentTimeMs(); + + DWORD waitTime = INFINITE; + if( !timerQueue_.empty() ){ + + waitTime = (DWORD)( timerQueue_.front().first >= currentTimeMs + ? timerQueue_.front().first - currentTimeMs + : 0 ); + } + + DWORD waitResult = WaitForMultipleObjects( (DWORD)socketListeners_.size() + 1, &events[0], FALSE, waitTime ); + if( break_ ) + break; + + if( waitResult != WAIT_TIMEOUT ){ + for( int i = waitResult - WAIT_OBJECT_0; i < (int)socketListeners_.size(); ++i ){ + std::size_t size = socketListeners_[i].second->ReceiveFrom( remoteEndpoint, data, MAX_BUFFER_SIZE ); + if( size > 0 ){ + socketListeners_[i].first->ProcessPacket( data, (int)size, remoteEndpoint ); + if( break_ ) + break; + } + } + } + + // execute any expired timers + currentTimeMs = GetCurrentTimeMs(); + bool resort = false; + for( std::vector< std::pair< double, AttachedTimerListener > >::iterator i = timerQueue_.begin(); + i != timerQueue_.end() && i->first <= currentTimeMs; ++i ){ + + i->second.listener->TimerExpired(); + if( break_ ) + break; + + i->first += i->second.periodMs; + resort = true; + } + if( resort ) + std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls ); + } + + delete [] data; + + // free events + j = 0; + for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin(); + i != socketListeners_.end(); ++i, ++j ){ + + WSAEventSelect( i->second->impl_->Socket(), events[j], 0 ); // remove association between socket and event + CloseHandle( events[j] ); + unsigned long enableNonblocking = 0; + ioctlsocket( i->second->impl_->Socket(), FIONBIO, &enableNonblocking ); // make the socket blocking again + } + } + + void Break() + { + break_ = true; + } + + void AsynchronousBreak() + { + break_ = true; + SetEvent( breakEvent_ ); + } +}; + + + +SocketReceiveMultiplexer::SocketReceiveMultiplexer() +{ + impl_ = new Implementation(); +} + +SocketReceiveMultiplexer::~SocketReceiveMultiplexer() +{ + delete impl_; +} + +void SocketReceiveMultiplexer::AttachSocketListener( UdpSocket *socket, PacketListener *listener ) +{ + impl_->AttachSocketListener( socket, listener ); +} + +void SocketReceiveMultiplexer::DetachSocketListener( UdpSocket *socket, PacketListener *listener ) +{ + impl_->DetachSocketListener( socket, listener ); +} + +void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ) +{ + impl_->AttachPeriodicTimerListener( periodMilliseconds, listener ); +} + +void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ) +{ + impl_->AttachPeriodicTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ); +} + +void SocketReceiveMultiplexer::DetachPeriodicTimerListener( TimerListener *listener ) +{ + impl_->DetachPeriodicTimerListener( listener ); +} + +void SocketReceiveMultiplexer::Run() +{ + impl_->Run(); +} + +void SocketReceiveMultiplexer::RunUntilSigInt() +{ + assert( multiplexerInstanceToAbortWithSigInt_ == 0 ); /* at present we support only one multiplexer instance running until sig int */ + multiplexerInstanceToAbortWithSigInt_ = this; +#ifndef WINCE + signal( SIGINT, InterruptSignalHandler ); +#endif + impl_->Run(); +#ifndef WINCE + signal( SIGINT, SIG_DFL ); +#endif + multiplexerInstanceToAbortWithSigInt_ = 0; +} + +void SocketReceiveMultiplexer::Break() +{ + impl_->Break(); +} + +void SocketReceiveMultiplexer::AsynchronousBreak() +{ + impl_->AsynchronousBreak(); +} + diff --git a/ext/osc/osc/MessageMappingOscPacketListener.h b/ext/osc/osc/MessageMappingOscPacketListener.h new file mode 100644 index 0000000000..bf56b530a2 --- /dev/null +++ b/ext/osc/osc/MessageMappingOscPacketListener.h @@ -0,0 +1,80 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H +#define INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H + +#include +#include + +#include "OscPacketListener.h" + + + +namespace osc{ + +template< class T > +class MessageMappingOscPacketListener : public OscPacketListener{ +public: + typedef void (T::*function_type)(const osc::ReceivedMessage&, const IpEndpointName&); + +protected: + void RegisterMessageFunction( const char *addressPattern, function_type f ) + { + functions_.insert( std::make_pair( addressPattern, f ) ); + } + + virtual void ProcessMessage( const osc::ReceivedMessage& m, + const IpEndpointName& remoteEndpoint ) + { + typename function_map_type::iterator i = functions_.find( m.AddressPattern() ); + if( i != functions_.end() ) + (dynamic_cast(this)->*(i->second))( m, remoteEndpoint ); + } + +private: + struct cstr_compare{ + bool operator()( const char *lhs, const char *rhs ) const + { return std::strcmp( lhs, rhs ) < 0; } + }; + + typedef std::map function_map_type; + function_map_type functions_; +}; + +} // namespace osc + +#endif /* INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H */ \ No newline at end of file diff --git a/ext/osc/osc/OscException.h b/ext/osc/osc/OscException.h new file mode 100644 index 0000000000..73981737e0 --- /dev/null +++ b/ext/osc/osc/OscException.h @@ -0,0 +1,62 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_OSCEXCEPTION_H +#define INCLUDED_OSCPACK_OSCEXCEPTION_H + +#include + +namespace osc{ + +class Exception : public std::exception { + const char *what_; + +public: + Exception() throw() {} + Exception( const Exception& src ) throw() + : std::exception( src ) + , what_( src.what_ ) {} + Exception( const char *w ) throw() + : what_( w ) {} + Exception& operator=( const Exception& src ) throw() + { what_ = src.what_; return *this; } + virtual ~Exception() throw() {} + virtual const char* what() const throw() { return what_; } +}; + +} // namespace osc + +#endif /* INCLUDED_OSCPACK_OSCEXCEPTION_H */ diff --git a/ext/osc/osc/OscHostEndianness.h b/ext/osc/osc/OscHostEndianness.h new file mode 100644 index 0000000000..4682c473a5 --- /dev/null +++ b/ext/osc/osc/OscHostEndianness.h @@ -0,0 +1,127 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H +#define INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H + +/* + Make sure either OSC_HOST_LITTLE_ENDIAN or OSC_HOST_BIG_ENDIAN is defined + + We try to use preprocessor symbols to deduce the host endianness. + + Alternatively you can define one of the above symbols from the command line. + Usually you do this with the -D flag to the compiler. e.g.: + + $ g++ -DOSC_HOST_LITTLE_ENDIAN ... +*/ + +#if defined(OSC_HOST_LITTLE_ENDIAN) || defined(OSC_HOST_BIG_ENDIAN) + +// endianness defined on the command line. nothing to do here. + +#elif defined(__WIN32__) || defined(WIN32) || defined(WINCE) + +// assume that __WIN32__ is only defined on little endian systems + +#define OSC_HOST_LITTLE_ENDIAN 1 +#undef OSC_HOST_BIG_ENDIAN + +#elif defined(__APPLE__) + +#if defined(__LITTLE_ENDIAN__) + +#define OSC_HOST_LITTLE_ENDIAN 1 +#undef OSC_HOST_BIG_ENDIAN + +#elif defined(__BIG_ENDIAN__) + +#define OSC_HOST_BIG_ENDIAN 1 +#undef OSC_HOST_LITTLE_ENDIAN + +#endif + +#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) + +// should cover gcc and clang + +#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + +#define OSC_HOST_LITTLE_ENDIAN 1 +#undef OSC_HOST_BIG_ENDIAN + +#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + +#define OSC_HOST_BIG_ENDIAN 1 +#undef OSC_HOST_LITTLE_ENDIAN + +#endif + +#else + +// gcc defines __LITTLE_ENDIAN__ and __BIG_ENDIAN__ +// for others used here see http://sourceforge.net/p/predef/wiki/Endianness/ +#if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) \ + || (defined(__ARMEL__) && !defined(__ARMEB__)) \ + || (defined(__AARCH64EL__) && !defined(__AARCH64EB__)) \ + || (defined(_MIPSEL) && !defined(_MIPSEB)) \ + || (defined(__MIPSEL) && !defined(__MIPSEB)) \ + || (defined(__MIPSEL__) && !defined(__MIPSEB__)) + +#define OSC_HOST_LITTLE_ENDIAN 1 +#undef OSC_HOST_BIG_ENDIAN + +#elif (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) \ + || (defined(__ARMEB__) && !defined(__ARMEL__)) \ + || (defined(__AARCH64EB__) && !defined(__AARCH64EL__)) \ + || (defined(_MIPSEB) && !defined(_MIPSEL)) \ + || (defined(__MIPSEB) && !defined(__MIPSEL)) \ + || (defined(__MIPSEB__) && !defined(__MIPSEL__)) + +#define OSC_HOST_BIG_ENDIAN 1 +#undef OSC_HOST_LITTLE_ENDIAN + +#endif + +#endif + +#if !defined(OSC_HOST_LITTLE_ENDIAN) && !defined(OSC_HOST_BIG_ENDIAN) + +#error please edit OSCHostEndianness.h or define one of {OSC_HOST_LITTLE_ENDIAN, OSC_HOST_BIG_ENDIAN} to configure endianness + +#endif + +#endif /* INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H */ + diff --git a/ext/osc/osc/OscOutboundPacketStream.cpp b/ext/osc/osc/OscOutboundPacketStream.cpp new file mode 100644 index 0000000000..b474b4f01a --- /dev/null +++ b/ext/osc/osc/OscOutboundPacketStream.cpp @@ -0,0 +1,683 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#include "OscOutboundPacketStream.h" + +#if defined(__WIN32__) || defined(WIN32) || defined(_WIN32) +#include // for alloca +#else +//#include // alloca on Linux (also OSX) +#include // alloca on OSX and FreeBSD (and Linux?) +#endif + +#include +#include // memcpy, memmove, strcpy, strlen +#include // ptrdiff_t + +#include "OscHostEndianness.h" + +#if defined(__BORLANDC__) // workaround for BCB4 release build intrinsics bug +namespace std { +using ::__strcpy__; // avoid error: E2316 '__strcpy__' is not a member of 'std'. +} +#endif + +namespace osc{ + +static void FromInt32( char *p, int32 x ) +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::int32 i; + char c[4]; + } u; + + u.i = x; + + p[3] = u.c[0]; + p[2] = u.c[1]; + p[1] = u.c[2]; + p[0] = u.c[3]; +#else + *reinterpret_cast(p) = x; +#endif +} + + +static void FromUInt32( char *p, uint32 x ) +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::uint32 i; + char c[4]; + } u; + + u.i = x; + + p[3] = u.c[0]; + p[2] = u.c[1]; + p[1] = u.c[2]; + p[0] = u.c[3]; +#else + *reinterpret_cast(p) = x; +#endif +} + + +static void FromInt64( char *p, int64 x ) +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::int64 i; + char c[8]; + } u; + + u.i = x; + + p[7] = u.c[0]; + p[6] = u.c[1]; + p[5] = u.c[2]; + p[4] = u.c[3]; + p[3] = u.c[4]; + p[2] = u.c[5]; + p[1] = u.c[6]; + p[0] = u.c[7]; +#else + *reinterpret_cast(p) = x; +#endif +} + + +static void FromUInt64( char *p, uint64 x ) +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::uint64 i; + char c[8]; + } u; + + u.i = x; + + p[7] = u.c[0]; + p[6] = u.c[1]; + p[5] = u.c[2]; + p[4] = u.c[3]; + p[3] = u.c[4]; + p[2] = u.c[5]; + p[1] = u.c[6]; + p[0] = u.c[7]; +#else + *reinterpret_cast(p) = x; +#endif +} + + +// round up to the next highest multiple of 4. unless x is already a multiple of 4 +static inline std::size_t RoundUp4( std::size_t x ) +{ + return (x + 3) & ~((std::size_t)0x03); +} + + +OutboundPacketStream::OutboundPacketStream( char *buffer, std::size_t capacity ) + : data_( buffer ) + , end_( data_ + capacity ) + , typeTagsCurrent_( end_ ) + , messageCursor_( data_ ) + , argumentCurrent_( data_ ) + , elementSizePtr_( 0 ) + , messageIsInProgress_( false ) +{ + // sanity check integer types declared in OscTypes.h + // you'll need to fix OscTypes.h if any of these asserts fail + assert( sizeof(osc::int32) == 4 ); + assert( sizeof(osc::uint32) == 4 ); + assert( sizeof(osc::int64) == 8 ); + assert( sizeof(osc::uint64) == 8 ); +} + + +OutboundPacketStream::~OutboundPacketStream() +{ + +} + + +char *OutboundPacketStream::BeginElement( char *beginPtr ) +{ + if( elementSizePtr_ == 0 ){ + + elementSizePtr_ = reinterpret_cast(data_); + + return beginPtr; + + }else{ + // store an offset to the old element size ptr in the element size slot + // we store an offset rather than the actual pointer to be 64 bit clean. + *reinterpret_cast(beginPtr) = + (uint32)(reinterpret_cast(elementSizePtr_) - data_); + + elementSizePtr_ = reinterpret_cast(beginPtr); + + return beginPtr + 4; + } +} + + +void OutboundPacketStream::EndElement( char *endPtr ) +{ + assert( elementSizePtr_ != 0 ); + + if( elementSizePtr_ == reinterpret_cast(data_) ){ + + elementSizePtr_ = 0; + + }else{ + // while building an element, an offset to the containing element's + // size slot is stored in the elements size slot (or a ptr to data_ + // if there is no containing element). We retrieve that here + uint32 *previousElementSizePtr = + reinterpret_cast(data_ + *elementSizePtr_); + + // then we store the element size in the slot. note that the element + // size does not include the size slot, hence the - 4 below. + + std::ptrdiff_t d = endPtr - reinterpret_cast(elementSizePtr_); + // assert( d >= 4 && d <= 0x7FFFFFFF ); // assume packets smaller than 2Gb + + uint32 elementSize = static_cast(d - 4); + FromUInt32( reinterpret_cast(elementSizePtr_), elementSize ); + + // finally, we reset the element size ptr to the containing element + elementSizePtr_ = previousElementSizePtr; + } +} + + +bool OutboundPacketStream::ElementSizeSlotRequired() const +{ + return (elementSizePtr_ != 0); +} + + +void OutboundPacketStream::CheckForAvailableBundleSpace() +{ + std::size_t required = Size() + ((ElementSizeSlotRequired())?4:0) + 16; + + if( required > Capacity() ) + throw OutOfBufferMemoryException(); +} + + +void OutboundPacketStream::CheckForAvailableMessageSpace( const char *addressPattern ) +{ + // plus 4 for at least four bytes of type tag + std::size_t required = Size() + ((ElementSizeSlotRequired())?4:0) + + RoundUp4(std::strlen(addressPattern) + 1) + 4; + + if( required > Capacity() ) + throw OutOfBufferMemoryException(); +} + + +void OutboundPacketStream::CheckForAvailableArgumentSpace( std::size_t argumentLength ) +{ + // plus three for extra type tag, comma and null terminator + std::size_t required = (argumentCurrent_ - data_) + argumentLength + + RoundUp4( (end_ - typeTagsCurrent_) + 3 ); + + if( required > Capacity() ) + throw OutOfBufferMemoryException(); +} + + +void OutboundPacketStream::Clear() +{ + typeTagsCurrent_ = end_; + messageCursor_ = data_; + argumentCurrent_ = data_; + elementSizePtr_ = 0; + messageIsInProgress_ = false; +} + + +std::size_t OutboundPacketStream::Capacity() const +{ + return end_ - data_; +} + + +std::size_t OutboundPacketStream::Size() const +{ + std::size_t result = argumentCurrent_ - data_; + if( IsMessageInProgress() ){ + // account for the length of the type tag string. the total type tag + // includes an initial comma, plus at least one terminating \0 + result += RoundUp4( (end_ - typeTagsCurrent_) + 2 ); + } + + return result; +} + + +const char *OutboundPacketStream::Data() const +{ + return data_; +} + + +bool OutboundPacketStream::IsReady() const +{ + return (!IsMessageInProgress() && !IsBundleInProgress()); +} + + +bool OutboundPacketStream::IsMessageInProgress() const +{ + return messageIsInProgress_; +} + + +bool OutboundPacketStream::IsBundleInProgress() const +{ + return (elementSizePtr_ != 0); +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const BundleInitiator& rhs ) +{ + if( IsMessageInProgress() ) + throw MessageInProgressException(); + + CheckForAvailableBundleSpace(); + + messageCursor_ = BeginElement( messageCursor_ ); + + std::memcpy( messageCursor_, "#bundle\0", 8 ); + FromUInt64( messageCursor_ + 8, rhs.timeTag ); + + messageCursor_ += 16; + argumentCurrent_ = messageCursor_; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const BundleTerminator& rhs ) +{ + (void) rhs; + + if( !IsBundleInProgress() ) + throw BundleNotInProgressException(); + if( IsMessageInProgress() ) + throw MessageInProgressException(); + + EndElement( messageCursor_ ); + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const BeginMessage& rhs ) +{ + if( IsMessageInProgress() ) + throw MessageInProgressException(); + + CheckForAvailableMessageSpace( rhs.addressPattern ); + + messageCursor_ = BeginElement( messageCursor_ ); + + std::strcpy( messageCursor_, rhs.addressPattern ); + std::size_t rhsLength = std::strlen(rhs.addressPattern); + messageCursor_ += rhsLength + 1; + + // zero pad to 4-byte boundary + std::size_t i = rhsLength + 1; + while( i & 0x3 ){ + *messageCursor_++ = '\0'; + ++i; + } + + argumentCurrent_ = messageCursor_; + typeTagsCurrent_ = end_; + + messageIsInProgress_ = true; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const MessageTerminator& rhs ) +{ + (void) rhs; + + if( !IsMessageInProgress() ) + throw MessageNotInProgressException(); + + std::size_t typeTagsCount = end_ - typeTagsCurrent_; + + if( typeTagsCount ){ + + char *tempTypeTags = (char*)alloca(typeTagsCount); + std::memcpy( tempTypeTags, typeTagsCurrent_, typeTagsCount ); + + // slot size includes comma and null terminator + std::size_t typeTagSlotSize = RoundUp4( typeTagsCount + 2 ); + + std::size_t argumentsSize = argumentCurrent_ - messageCursor_; + + std::memmove( messageCursor_ + typeTagSlotSize, messageCursor_, argumentsSize ); + + messageCursor_[0] = ','; + // copy type tags in reverse (really forward) order + for( std::size_t i=0; i < typeTagsCount; ++i ) + messageCursor_[i+1] = tempTypeTags[ (typeTagsCount-1) - i ]; + + char *p = messageCursor_ + 1 + typeTagsCount; + for( std::size_t i=0; i < (typeTagSlotSize - (typeTagsCount + 1)); ++i ) + *p++ = '\0'; + + typeTagsCurrent_ = end_; + + // advance messageCursor_ for next message + messageCursor_ += typeTagSlotSize + argumentsSize; + + }else{ + // send an empty type tags string + std::memcpy( messageCursor_, ",\0\0\0", 4 ); + + // advance messageCursor_ for next message + messageCursor_ += 4; + } + + argumentCurrent_ = messageCursor_; + + EndElement( messageCursor_ ); + + messageIsInProgress_ = false; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( bool rhs ) +{ + CheckForAvailableArgumentSpace(0); + + *(--typeTagsCurrent_) = (char)((rhs) ? TRUE_TYPE_TAG : FALSE_TYPE_TAG); + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const NilType& rhs ) +{ + (void) rhs; + CheckForAvailableArgumentSpace(0); + + *(--typeTagsCurrent_) = NIL_TYPE_TAG; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const InfinitumType& rhs ) +{ + (void) rhs; + CheckForAvailableArgumentSpace(0); + + *(--typeTagsCurrent_) = INFINITUM_TYPE_TAG; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( int32 rhs ) +{ + CheckForAvailableArgumentSpace(4); + + *(--typeTagsCurrent_) = INT32_TYPE_TAG; + FromInt32( argumentCurrent_, rhs ); + argumentCurrent_ += 4; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( float rhs ) +{ + CheckForAvailableArgumentSpace(4); + + *(--typeTagsCurrent_) = FLOAT_TYPE_TAG; + +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + float f; + char c[4]; + } u; + + u.f = rhs; + + argumentCurrent_[3] = u.c[0]; + argumentCurrent_[2] = u.c[1]; + argumentCurrent_[1] = u.c[2]; + argumentCurrent_[0] = u.c[3]; +#else + *reinterpret_cast(argumentCurrent_) = rhs; +#endif + + argumentCurrent_ += 4; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( char rhs ) +{ + CheckForAvailableArgumentSpace(4); + + *(--typeTagsCurrent_) = CHAR_TYPE_TAG; + FromInt32( argumentCurrent_, rhs ); + argumentCurrent_ += 4; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const RgbaColor& rhs ) +{ + CheckForAvailableArgumentSpace(4); + + *(--typeTagsCurrent_) = RGBA_COLOR_TYPE_TAG; + FromUInt32( argumentCurrent_, rhs ); + argumentCurrent_ += 4; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const MidiMessage& rhs ) +{ + CheckForAvailableArgumentSpace(4); + + *(--typeTagsCurrent_) = MIDI_MESSAGE_TYPE_TAG; + FromUInt32( argumentCurrent_, rhs ); + argumentCurrent_ += 4; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( int64 rhs ) +{ + CheckForAvailableArgumentSpace(8); + + *(--typeTagsCurrent_) = INT64_TYPE_TAG; + FromInt64( argumentCurrent_, rhs ); + argumentCurrent_ += 8; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const TimeTag& rhs ) +{ + CheckForAvailableArgumentSpace(8); + + *(--typeTagsCurrent_) = TIME_TAG_TYPE_TAG; + FromUInt64( argumentCurrent_, rhs ); + argumentCurrent_ += 8; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( double rhs ) +{ + CheckForAvailableArgumentSpace(8); + + *(--typeTagsCurrent_) = DOUBLE_TYPE_TAG; + +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + double f; + char c[8]; + } u; + + u.f = rhs; + + argumentCurrent_[7] = u.c[0]; + argumentCurrent_[6] = u.c[1]; + argumentCurrent_[5] = u.c[2]; + argumentCurrent_[4] = u.c[3]; + argumentCurrent_[3] = u.c[4]; + argumentCurrent_[2] = u.c[5]; + argumentCurrent_[1] = u.c[6]; + argumentCurrent_[0] = u.c[7]; +#else + *reinterpret_cast(argumentCurrent_) = rhs; +#endif + + argumentCurrent_ += 8; + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const char *rhs ) +{ + CheckForAvailableArgumentSpace( RoundUp4(std::strlen(rhs) + 1) ); + + *(--typeTagsCurrent_) = STRING_TYPE_TAG; + std::strcpy( argumentCurrent_, rhs ); + std::size_t rhsLength = std::strlen(rhs); + argumentCurrent_ += rhsLength + 1; + + // zero pad to 4-byte boundary + std::size_t i = rhsLength + 1; + while( i & 0x3 ){ + *argumentCurrent_++ = '\0'; + ++i; + } + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const Symbol& rhs ) +{ + CheckForAvailableArgumentSpace( RoundUp4(std::strlen(rhs) + 1) ); + + *(--typeTagsCurrent_) = SYMBOL_TYPE_TAG; + std::strcpy( argumentCurrent_, rhs ); + std::size_t rhsLength = std::strlen(rhs); + argumentCurrent_ += rhsLength + 1; + + // zero pad to 4-byte boundary + std::size_t i = rhsLength + 1; + while( i & 0x3 ){ + *argumentCurrent_++ = '\0'; + ++i; + } + + return *this; +} + + +OutboundPacketStream& OutboundPacketStream::operator<<( const Blob& rhs ) +{ + CheckForAvailableArgumentSpace( 4 + RoundUp4(rhs.size) ); + + *(--typeTagsCurrent_) = BLOB_TYPE_TAG; + FromUInt32( argumentCurrent_, rhs.size ); + argumentCurrent_ += 4; + + std::memcpy( argumentCurrent_, rhs.data, rhs.size ); + argumentCurrent_ += rhs.size; + + // zero pad to 4-byte boundary + unsigned long i = rhs.size; + while( i & 0x3 ){ + *argumentCurrent_++ = '\0'; + ++i; + } + + return *this; +} + +OutboundPacketStream& OutboundPacketStream::operator<<( const ArrayInitiator& rhs ) +{ + (void) rhs; + CheckForAvailableArgumentSpace(0); + + *(--typeTagsCurrent_) = ARRAY_BEGIN_TYPE_TAG; + + return *this; +} + +OutboundPacketStream& OutboundPacketStream::operator<<( const ArrayTerminator& rhs ) +{ + (void) rhs; + CheckForAvailableArgumentSpace(0); + + *(--typeTagsCurrent_) = ARRAY_END_TYPE_TAG; + + return *this; +} + +} // namespace osc + + diff --git a/ext/osc/osc/OscOutboundPacketStream.h b/ext/osc/osc/OscOutboundPacketStream.h new file mode 100644 index 0000000000..d0afe95421 --- /dev/null +++ b/ext/osc/osc/OscOutboundPacketStream.h @@ -0,0 +1,155 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_OSCOUTBOUNDPACKETSTREAM_H +#define INCLUDED_OSCPACK_OSCOUTBOUNDPACKETSTREAM_H + +#include // size_t + +#include "OscTypes.h" +#include "OscException.h" + + +namespace osc{ + +class OutOfBufferMemoryException : public Exception{ +public: + OutOfBufferMemoryException( const char *w="out of buffer memory" ) + : Exception( w ) {} +}; + +class BundleNotInProgressException : public Exception{ +public: + BundleNotInProgressException( + const char *w="call to EndBundle when bundle is not in progress" ) + : Exception( w ) {} +}; + +class MessageInProgressException : public Exception{ +public: + MessageInProgressException( + const char *w="opening or closing bundle or message while message is in progress" ) + : Exception( w ) {} +}; + +class MessageNotInProgressException : public Exception{ +public: + MessageNotInProgressException( + const char *w="call to EndMessage when message is not in progress" ) + : Exception( w ) {} +}; + + +class OutboundPacketStream{ +public: + OutboundPacketStream() = default; + OutboundPacketStream( char *buffer, std::size_t capacity ); + ~OutboundPacketStream(); + + void Clear(); + + std::size_t Capacity() const; + + // invariant: size() is valid even while building a message. + std::size_t Size() const; + + const char *Data() const; + + // indicates that all messages have been closed with a matching EndMessage + // and all bundles have been closed with a matching EndBundle + bool IsReady() const; + + bool IsMessageInProgress() const; + bool IsBundleInProgress() const; + + OutboundPacketStream& operator<<( const BundleInitiator& rhs ); + OutboundPacketStream& operator<<( const BundleTerminator& rhs ); + + OutboundPacketStream& operator<<( const BeginMessage& rhs ); + OutboundPacketStream& operator<<( const MessageTerminator& rhs ); + + OutboundPacketStream& operator<<( bool rhs ); + OutboundPacketStream& operator<<( const NilType& rhs ); + OutboundPacketStream& operator<<( const InfinitumType& rhs ); + OutboundPacketStream& operator<<( int32 rhs ); + +#if !(defined(__x86_64__) || defined(_M_X64)) + OutboundPacketStream& operator<<( int rhs ) + { *this << (int32)rhs; return *this; } +#endif + + OutboundPacketStream& operator<<( float rhs ); + OutboundPacketStream& operator<<( char rhs ); + OutboundPacketStream& operator<<( const RgbaColor& rhs ); + OutboundPacketStream& operator<<( const MidiMessage& rhs ); + OutboundPacketStream& operator<<( int64 rhs ); + OutboundPacketStream& operator<<( const TimeTag& rhs ); + OutboundPacketStream& operator<<( double rhs ); + OutboundPacketStream& operator<<( const char* rhs ); + OutboundPacketStream& operator<<( const Symbol& rhs ); + OutboundPacketStream& operator<<( const Blob& rhs ); + + OutboundPacketStream& operator<<( const ArrayInitiator& rhs ); + OutboundPacketStream& operator<<( const ArrayTerminator& rhs ); + +private: + + char *BeginElement( char *beginPtr ); + void EndElement( char *endPtr ); + + bool ElementSizeSlotRequired() const; + void CheckForAvailableBundleSpace(); + void CheckForAvailableMessageSpace( const char *addressPattern ); + void CheckForAvailableArgumentSpace( std::size_t argumentLength ); + + char *data_; + char *end_; + + char *typeTagsCurrent_; // stored in reverse order + char *messageCursor_; + char *argumentCurrent_; + + // elementSizePtr_ has two special values: 0 indicates that a bundle + // isn't open, and elementSizePtr_==data_ indicates that a bundle is + // open but that it doesn't have a size slot (ie the outermost bundle) + uint32 *elementSizePtr_; + + bool messageIsInProgress_; +}; + +} // namespace osc + +#endif /* INCLUDED_OSCPACK_OSCOUTBOUNDPACKETSTREAM_H */ diff --git a/ext/osc/osc/OscPacketListener.h b/ext/osc/osc/OscPacketListener.h new file mode 100644 index 0000000000..472cb1066f --- /dev/null +++ b/ext/osc/osc/OscPacketListener.h @@ -0,0 +1,79 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_OSCPACKETLISTENER_H +#define INCLUDED_OSCPACK_OSCPACKETLISTENER_H + +#include "OscReceivedElements.h" +#include "../ip/PacketListener.h" + + +namespace osc{ + +class OscPacketListener : public PacketListener{ +protected: + virtual void ProcessBundle( const osc::ReceivedBundle& b, + const IpEndpointName& remoteEndpoint ) + { + // ignore bundle time tag for now + + for( ReceivedBundle::const_iterator i = b.ElementsBegin(); + i != b.ElementsEnd(); ++i ){ + if( i->IsBundle() ) + ProcessBundle( ReceivedBundle(*i), remoteEndpoint ); + else + ProcessMessage( ReceivedMessage(*i), remoteEndpoint ); + } + } + + virtual void ProcessMessage( const osc::ReceivedMessage& m, + const IpEndpointName& remoteEndpoint ) = 0; + +public: + virtual void ProcessPacket( const char *data, int size, + const IpEndpointName& remoteEndpoint ) + { + osc::ReceivedPacket p( data, size ); + if( p.IsBundle() ) + ProcessBundle( ReceivedBundle(p), remoteEndpoint ); + else + ProcessMessage( ReceivedMessage(p), remoteEndpoint ); + } +}; + +} // namespace osc + +#endif /* INCLUDED_OSCPACK_OSCPACKETLISTENER_H */ diff --git a/ext/osc/osc/OscPrintReceivedElements.cpp b/ext/osc/osc/OscPrintReceivedElements.cpp new file mode 100644 index 0000000000..bc1689bc1d --- /dev/null +++ b/ext/osc/osc/OscPrintReceivedElements.cpp @@ -0,0 +1,261 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#include "OscPrintReceivedElements.h" + +#include +#include +#include +#include + +#if defined(__BORLANDC__) // workaround for BCB4 release build intrinsics bug +namespace std { +using ::__strcpy__; // avoid error: E2316 '__strcpy__' is not a member of 'std'. +} +#endif + +namespace osc{ + + +std::ostream& operator<<( std::ostream & os, + const ReceivedMessageArgument& arg ) +{ + switch( arg.TypeTag() ){ + case TRUE_TYPE_TAG: + os << "bool:true"; + break; + + case FALSE_TYPE_TAG: + os << "bool:false"; + break; + + case NIL_TYPE_TAG: + os << "(Nil)"; + break; + + case INFINITUM_TYPE_TAG: + os << "(Infinitum)"; + break; + + case INT32_TYPE_TAG: + os << "int32:" << arg.AsInt32Unchecked(); + break; + + case FLOAT_TYPE_TAG: + os << "float32:" << arg.AsFloatUnchecked(); + break; + + case CHAR_TYPE_TAG: + { + char s[2] = {0}; + s[0] = arg.AsCharUnchecked(); + os << "char:'" << s << "'"; + } + break; + + case RGBA_COLOR_TYPE_TAG: + { + uint32 color = arg.AsRgbaColorUnchecked(); + + os << "RGBA:0x" + << std::hex << std::setfill('0') + << std::setw(2) << (int)((color>>24) & 0xFF) + << std::setw(2) << (int)((color>>16) & 0xFF) + << std::setw(2) << (int)((color>>8) & 0xFF) + << std::setw(2) << (int)(color & 0xFF) + << std::setfill(' '); + os.unsetf(std::ios::basefield); + } + break; + + case MIDI_MESSAGE_TYPE_TAG: + { + uint32 m = arg.AsMidiMessageUnchecked(); + os << "midi (port, status, data1, data2):<<" + << std::hex << std::setfill('0') + << "0x" << std::setw(2) << (int)((m>>24) & 0xFF) + << " 0x" << std::setw(2) << (int)((m>>16) & 0xFF) + << " 0x" << std::setw(2) << (int)((m>>8) & 0xFF) + << " 0x" << std::setw(2) << (int)(m & 0xFF) + << std::setfill(' ') << ">>"; + os.unsetf(std::ios::basefield); + } + break; + + case INT64_TYPE_TAG: + os << "int64:" << arg.AsInt64Unchecked(); + break; + + case TIME_TAG_TYPE_TAG: + { + os << "OSC-timetag:" << arg.AsTimeTagUnchecked() << " "; + + std::time_t t = + (unsigned long)( arg.AsTimeTagUnchecked() >> 32 ); + + const char *timeString = std::ctime( &t ); + size_t len = std::strlen( timeString ); + + // -1 to omit trailing newline from string returned by ctime() + if( len > 1 ) + os.write( timeString, len - 1 ); + } + break; + + case DOUBLE_TYPE_TAG: + os << "double:" << arg.AsDoubleUnchecked(); + break; + + case STRING_TYPE_TAG: + os << "OSC-string:`" << arg.AsStringUnchecked() << "'"; + break; + + case SYMBOL_TYPE_TAG: + os << "OSC-string (symbol):`" << arg.AsSymbolUnchecked() << "'"; + break; + + case BLOB_TYPE_TAG: + { + const void *data; + osc_bundle_element_size_t size; + arg.AsBlobUnchecked( data, size ); + os << "OSC-blob:<<" << std::hex << std::setfill('0'); + unsigned char *p = (unsigned char*)data; + for( osc_bundle_element_size_t i = 0; i < size; ++i ){ + os << "0x" << std::setw(2) << int(p[i]); + if( i != size-1 ) + os << ' '; + } + os.unsetf(std::ios::basefield); + os << ">>" << std::setfill(' '); + } + break; + + case ARRAY_BEGIN_TYPE_TAG: + os << "["; + break; + + case ARRAY_END_TYPE_TAG: + os << "]"; + break; + + default: + os << "unknown"; + } + + return os; +} + + +std::ostream& operator<<( std::ostream & os, const ReceivedMessage& m ) +{ + os << "["; + if( m.AddressPatternIsUInt32() ) + os << m.AddressPatternAsUInt32(); + else + os << m.AddressPattern(); + + bool first = true; + for( ReceivedMessage::const_iterator i = m.ArgumentsBegin(); + i != m.ArgumentsEnd(); ++i ){ + if( first ){ + os << " "; + first = false; + }else{ + os << ", "; + } + + os << *i; + } + + os << "]"; + + return os; +} + + +std::ostream& operator<<( std::ostream & os, const ReceivedBundle& b ) +{ + static int indent = 0; + + for( int j=0; j < indent; ++j ) + os << " "; + os << "{ ( "; + if( b.TimeTag() == 1 ) + os << "immediate"; + else + os << b.TimeTag(); + os << " )\n"; + + ++indent; + + for( ReceivedBundle::const_iterator i = b.ElementsBegin(); + i != b.ElementsEnd(); ++i ){ + if( i->IsBundle() ){ + ReceivedBundle b(*i); + os << b << "\n"; + }else{ + ReceivedMessage m(*i); + for( int j=0; j < indent; ++j ) + os << " "; + os << m << "\n"; + } + } + + --indent; + + for( int j=0; j < indent; ++j ) + os << " "; + os << "}"; + + return os; +} + + +std::ostream& operator<<( std::ostream & os, const ReceivedPacket& p ) +{ + if( p.IsBundle() ){ + ReceivedBundle b(p); + os << b << "\n"; + }else{ + ReceivedMessage m(p); + os << m << "\n"; + } + + return os; +} + +} // namespace osc diff --git a/ext/osc/osc/OscPrintReceivedElements.h b/ext/osc/osc/OscPrintReceivedElements.h new file mode 100644 index 0000000000..8d71391f0c --- /dev/null +++ b/ext/osc/osc/OscPrintReceivedElements.h @@ -0,0 +1,54 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H +#define INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H + +#include + +#include "OscReceivedElements.h" + + +namespace osc{ + +std::ostream& operator<<( std::ostream & os, const ReceivedPacket& p ); +std::ostream& operator<<( std::ostream & os, const ReceivedMessageArgument& arg ); +std::ostream& operator<<( std::ostream & os, const ReceivedMessage& m ); +std::ostream& operator<<( std::ostream & os, const ReceivedBundle& b ); + +} // namespace osc + +#endif /* INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H */ diff --git a/ext/osc/osc/OscReceivedElements.cpp b/ext/osc/osc/OscReceivedElements.cpp new file mode 100644 index 0000000000..1d57d3740a --- /dev/null +++ b/ext/osc/osc/OscReceivedElements.cpp @@ -0,0 +1,796 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#include "OscReceivedElements.h" + +#include "OscHostEndianness.h" + +#include // ptrdiff_t + +namespace osc{ + + +// return the first 4 byte boundary after the end of a str4 +// be careful about calling this version if you don't know whether +// the string is terminated correctly. +static inline const char* FindStr4End( const char *p ) +{ + if( p[0] == '\0' ) // special case for SuperCollider integer address pattern + return p + 4; + + p += 3; + + while( *p ) + p += 4; + + return p + 1; +} + + +// return the first 4 byte boundary after the end of a str4 +// returns 0 if p == end or if the string is unterminated +static inline const char* FindStr4End( const char *p, const char *end ) +{ + if( p >= end ) + return 0; + + if( p[0] == '\0' ) // special case for SuperCollider integer address pattern + return p + 4; + + p += 3; + end -= 1; + + while( p < end && *p ) + p += 4; + + if( *p ) + return 0; + else + return p + 1; +} + + +// round up to the next highest multiple of 4. unless x is already a multiple of 4 +static inline uint32 RoundUp4( uint32 x ) +{ + return (x + 3) & ~((uint32)0x03); +} + + +static inline int32 ToInt32( const char *p ) +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::int32 i; + char c[4]; + } u; + + u.c[0] = p[3]; + u.c[1] = p[2]; + u.c[2] = p[1]; + u.c[3] = p[0]; + + return u.i; +#else + return *(int32*)p; +#endif +} + + +static inline uint32 ToUInt32( const char *p ) +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::uint32 i; + char c[4]; + } u; + + u.c[0] = p[3]; + u.c[1] = p[2]; + u.c[2] = p[1]; + u.c[3] = p[0]; + + return u.i; +#else + return *(uint32*)p; +#endif +} + + +static inline int64 ToInt64( const char *p ) +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::int64 i; + char c[8]; + } u; + + u.c[0] = p[7]; + u.c[1] = p[6]; + u.c[2] = p[5]; + u.c[3] = p[4]; + u.c[4] = p[3]; + u.c[5] = p[2]; + u.c[6] = p[1]; + u.c[7] = p[0]; + + return u.i; +#else + return *(int64*)p; +#endif +} + + +static inline uint64 ToUInt64( const char *p ) +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::uint64 i; + char c[8]; + } u; + + u.c[0] = p[7]; + u.c[1] = p[6]; + u.c[2] = p[5]; + u.c[3] = p[4]; + u.c[4] = p[3]; + u.c[5] = p[2]; + u.c[6] = p[1]; + u.c[7] = p[0]; + + return u.i; +#else + return *(uint64*)p; +#endif +} + +//------------------------------------------------------------------------------ + +bool ReceivedPacket::IsBundle() const +{ + return (Size() > 0 && Contents()[0] == '#'); +} + +//------------------------------------------------------------------------------ + +bool ReceivedBundleElement::IsBundle() const +{ + return (Size() > 0 && Contents()[0] == '#'); +} + + +osc_bundle_element_size_t ReceivedBundleElement::Size() const +{ + return ToInt32( sizePtr_ ); +} + +//------------------------------------------------------------------------------ + +bool ReceivedMessageArgument::AsBool() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == TRUE_TYPE_TAG ) + return true; + else if( *typeTagPtr_ == FALSE_TYPE_TAG ) + return false; + else + throw WrongArgumentTypeException(); +} + + +bool ReceivedMessageArgument::AsBoolUnchecked() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == TRUE_TYPE_TAG ) + return true; + else + return false; +} + + +int32 ReceivedMessageArgument::AsInt32() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == INT32_TYPE_TAG ) + return AsInt32Unchecked(); + else + throw WrongArgumentTypeException(); +} + + +int32 ReceivedMessageArgument::AsInt32Unchecked() const +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + osc::int32 i; + char c[4]; + } u; + + u.c[0] = argumentPtr_[3]; + u.c[1] = argumentPtr_[2]; + u.c[2] = argumentPtr_[1]; + u.c[3] = argumentPtr_[0]; + + return u.i; +#else + return *(int32*)argument_; +#endif +} + + +float ReceivedMessageArgument::AsFloat() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == FLOAT_TYPE_TAG ) + return AsFloatUnchecked(); + else + throw WrongArgumentTypeException(); +} + + +float ReceivedMessageArgument::AsFloatUnchecked() const +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + float f; + char c[4]; + } u; + + u.c[0] = argumentPtr_[3]; + u.c[1] = argumentPtr_[2]; + u.c[2] = argumentPtr_[1]; + u.c[3] = argumentPtr_[0]; + + return u.f; +#else + return *(float*)argument_; +#endif +} + + +char ReceivedMessageArgument::AsChar() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == CHAR_TYPE_TAG ) + return AsCharUnchecked(); + else + throw WrongArgumentTypeException(); +} + + +char ReceivedMessageArgument::AsCharUnchecked() const +{ + return (char)ToInt32( argumentPtr_ ); +} + + +uint32 ReceivedMessageArgument::AsRgbaColor() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == RGBA_COLOR_TYPE_TAG ) + return AsRgbaColorUnchecked(); + else + throw WrongArgumentTypeException(); +} + + +uint32 ReceivedMessageArgument::AsRgbaColorUnchecked() const +{ + return ToUInt32( argumentPtr_ ); +} + + +uint32 ReceivedMessageArgument::AsMidiMessage() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == MIDI_MESSAGE_TYPE_TAG ) + return AsMidiMessageUnchecked(); + else + throw WrongArgumentTypeException(); +} + + +uint32 ReceivedMessageArgument::AsMidiMessageUnchecked() const +{ + return ToUInt32( argumentPtr_ ); +} + + +int64 ReceivedMessageArgument::AsInt64() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == INT64_TYPE_TAG ) + return AsInt64Unchecked(); + else + throw WrongArgumentTypeException(); +} + + +int64 ReceivedMessageArgument::AsInt64Unchecked() const +{ + return ToInt64( argumentPtr_ ); +} + + +uint64 ReceivedMessageArgument::AsTimeTag() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == TIME_TAG_TYPE_TAG ) + return AsTimeTagUnchecked(); + else + throw WrongArgumentTypeException(); +} + + +uint64 ReceivedMessageArgument::AsTimeTagUnchecked() const +{ + return ToUInt64( argumentPtr_ ); +} + + +double ReceivedMessageArgument::AsDouble() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == DOUBLE_TYPE_TAG ) + return AsDoubleUnchecked(); + else + throw WrongArgumentTypeException(); +} + + +double ReceivedMessageArgument::AsDoubleUnchecked() const +{ +#ifdef OSC_HOST_LITTLE_ENDIAN + union{ + double d; + char c[8]; + } u; + + u.c[0] = argumentPtr_[7]; + u.c[1] = argumentPtr_[6]; + u.c[2] = argumentPtr_[5]; + u.c[3] = argumentPtr_[4]; + u.c[4] = argumentPtr_[3]; + u.c[5] = argumentPtr_[2]; + u.c[6] = argumentPtr_[1]; + u.c[7] = argumentPtr_[0]; + + return u.d; +#else + return *(double*)argument_; +#endif +} + + +const char* ReceivedMessageArgument::AsString() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == STRING_TYPE_TAG ) + return argumentPtr_; + else + throw WrongArgumentTypeException(); +} + + +const char* ReceivedMessageArgument::AsSymbol() const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == SYMBOL_TYPE_TAG ) + return argumentPtr_; + else + throw WrongArgumentTypeException(); +} + + +void ReceivedMessageArgument::AsBlob( const void*& data, osc_bundle_element_size_t& size ) const +{ + if( !typeTagPtr_ ) + throw MissingArgumentException(); + else if( *typeTagPtr_ == BLOB_TYPE_TAG ) + AsBlobUnchecked( data, size ); + else + throw WrongArgumentTypeException(); +} + + +void ReceivedMessageArgument::AsBlobUnchecked( const void*& data, osc_bundle_element_size_t& size ) const +{ + // read blob size as an unsigned int then validate + osc_bundle_element_size_t sizeResult = (osc_bundle_element_size_t)ToUInt32( argumentPtr_ ); + if( !IsValidElementSizeValue(sizeResult) ) + throw MalformedMessageException("invalid blob size"); + + size = sizeResult; + data = (void*)(argumentPtr_+ osc::OSC_SIZEOF_INT32); +} + +std::size_t ReceivedMessageArgument::ComputeArrayItemCount() const +{ + // it is only valid to call ComputeArrayItemCount when the argument is the array start marker + if( !IsArrayBegin() ) + throw WrongArgumentTypeException(); + + std::size_t result = 0; + unsigned int level = 0; + const char *typeTag = typeTagPtr_ + 1; + + // iterate through all type tags. note that ReceivedMessage::Init + // has already checked that the message is well formed. + while( *typeTag ) { + switch( *typeTag++ ) { + case ARRAY_BEGIN_TYPE_TAG: + level += 1; + break; + + case ARRAY_END_TYPE_TAG: + if(level == 0) + return result; + level -= 1; + break; + + default: + if( level == 0 ) // only count items at level 0 + ++result; + } + } + + return result; +} + +//------------------------------------------------------------------------------ + +void ReceivedMessageArgumentIterator::Advance() +{ + if( !value_.typeTagPtr_ ) + return; + + switch( *value_.typeTagPtr_++ ){ + case '\0': + // don't advance past end + --value_.typeTagPtr_; + break; + + case TRUE_TYPE_TAG: + case FALSE_TYPE_TAG: + case NIL_TYPE_TAG: + case INFINITUM_TYPE_TAG: + + // zero length + break; + + case INT32_TYPE_TAG: + case FLOAT_TYPE_TAG: + case CHAR_TYPE_TAG: + case RGBA_COLOR_TYPE_TAG: + case MIDI_MESSAGE_TYPE_TAG: + + value_.argumentPtr_ += 4; + break; + + case INT64_TYPE_TAG: + case TIME_TAG_TYPE_TAG: + case DOUBLE_TYPE_TAG: + + value_.argumentPtr_ += 8; + break; + + case STRING_TYPE_TAG: + case SYMBOL_TYPE_TAG: + + // we use the unsafe function FindStr4End(char*) here because all of + // the arguments have already been validated in + // ReceivedMessage::Init() below. + + value_.argumentPtr_ = FindStr4End( value_.argumentPtr_ ); + break; + + case BLOB_TYPE_TAG: + { + // treat blob size as an unsigned int for the purposes of this calculation + uint32 blobSize = ToUInt32( value_.argumentPtr_ ); + value_.argumentPtr_ = value_.argumentPtr_ + osc::OSC_SIZEOF_INT32 + RoundUp4( blobSize ); + } + break; + + case ARRAY_BEGIN_TYPE_TAG: + case ARRAY_END_TYPE_TAG: + + // [ Indicates the beginning of an array. The tags following are for + // data in the Array until a close brace tag is reached. + // ] Indicates the end of an array. + + // zero length, don't advance argument ptr + break; + + default: // unknown type tag + // don't advance + --value_.typeTagPtr_; + break; + } +} + +//------------------------------------------------------------------------------ + +ReceivedMessage::ReceivedMessage( const ReceivedPacket& packet ) + : addressPattern_( packet.Contents() ) +{ + Init( packet.Contents(), packet.Size() ); +} + + +ReceivedMessage::ReceivedMessage( const ReceivedBundleElement& bundleElement ) + : addressPattern_( bundleElement.Contents() ) +{ + Init( bundleElement.Contents(), bundleElement.Size() ); +} + + +bool ReceivedMessage::AddressPatternIsUInt32() const +{ + return (addressPattern_[0] == '\0'); +} + + +uint32 ReceivedMessage::AddressPatternAsUInt32() const +{ + return ToUInt32( addressPattern_ ); +} + + +void ReceivedMessage::Init( const char *message, osc_bundle_element_size_t size ) +{ + if( !IsValidElementSizeValue(size) ) + throw MalformedMessageException( "invalid message size" ); + + if( size == 0 ) + throw MalformedMessageException( "zero length messages not permitted" ); + + if( !IsMultipleOf4(size) ) + throw MalformedMessageException( "message size must be multiple of four" ); + + const char *end = message + size; + + typeTagsBegin_ = FindStr4End( addressPattern_, end ); + if( typeTagsBegin_ == 0 ){ + // address pattern was not terminated before end + throw MalformedMessageException( "unterminated address pattern" ); + } + + if( typeTagsBegin_ == end ){ + // message consists of only the address pattern - no arguments or type tags. + typeTagsBegin_ = 0; + typeTagsEnd_ = 0; + arguments_ = 0; + + }else{ + if( *typeTagsBegin_ != ',' ) + throw MalformedMessageException( "type tags not present" ); + + if( *(typeTagsBegin_ + 1) == '\0' ){ + // zero length type tags + typeTagsBegin_ = 0; + typeTagsEnd_ = 0; + arguments_ = 0; + + }else{ + // check that all arguments are present and well formed + + arguments_ = FindStr4End( typeTagsBegin_, end ); + if( arguments_ == 0 ){ + throw MalformedMessageException( "type tags were not terminated before end of message" ); + } + + ++typeTagsBegin_; // advance past initial ',' + + const char *typeTag = typeTagsBegin_; + const char *argument = arguments_; + unsigned int arrayLevel = 0; + + do{ + switch( *typeTag ){ + case TRUE_TYPE_TAG: + case FALSE_TYPE_TAG: + case NIL_TYPE_TAG: + case INFINITUM_TYPE_TAG: + // zero length + break; + + // [ Indicates the beginning of an array. The tags following are for + // data in the Array until a close brace tag is reached. + // ] Indicates the end of an array. + case ARRAY_BEGIN_TYPE_TAG: + ++arrayLevel; + // (zero length argument data) + break; + + case ARRAY_END_TYPE_TAG: + --arrayLevel; + // (zero length argument data) + break; + + case INT32_TYPE_TAG: + case FLOAT_TYPE_TAG: + case CHAR_TYPE_TAG: + case RGBA_COLOR_TYPE_TAG: + case MIDI_MESSAGE_TYPE_TAG: + + if( argument == end ) + throw MalformedMessageException( "arguments exceed message size" ); + argument += 4; + if( argument > end ) + throw MalformedMessageException( "arguments exceed message size" ); + break; + + case INT64_TYPE_TAG: + case TIME_TAG_TYPE_TAG: + case DOUBLE_TYPE_TAG: + + if( argument == end ) + throw MalformedMessageException( "arguments exceed message size" ); + argument += 8; + if( argument > end ) + throw MalformedMessageException( "arguments exceed message size" ); + break; + + case STRING_TYPE_TAG: + case SYMBOL_TYPE_TAG: + + if( argument == end ) + throw MalformedMessageException( "arguments exceed message size" ); + argument = FindStr4End( argument, end ); + if( argument == 0 ) + throw MalformedMessageException( "unterminated string argument" ); + break; + + case BLOB_TYPE_TAG: + { + if( argument + osc::OSC_SIZEOF_INT32 > end ) + MalformedMessageException( "arguments exceed message size" ); + + // treat blob size as an unsigned int for the purposes of this calculation + uint32 blobSize = ToUInt32( argument ); + argument = argument + osc::OSC_SIZEOF_INT32 + RoundUp4( blobSize ); + if( argument > end ) + MalformedMessageException( "arguments exceed message size" ); + } + break; + + default: + throw MalformedMessageException( "unknown type tag" ); + } + + }while( *++typeTag != '\0' ); + typeTagsEnd_ = typeTag; + + if( arrayLevel != 0 ) + throw MalformedMessageException( "array was not terminated before end of message (expected ']' end of array tag)" ); + } + + // These invariants should be guaranteed by the above code. + // we depend on them in the implementation of ArgumentCount() +#ifndef NDEBUG + std::ptrdiff_t argumentCount = typeTagsEnd_ - typeTagsBegin_; + assert( argumentCount >= 0 ); + assert( argumentCount <= OSC_INT32_MAX ); +#endif + } +} + +//------------------------------------------------------------------------------ + +ReceivedBundle::ReceivedBundle( const ReceivedPacket& packet ) + : elementCount_( 0 ) +{ + Init( packet.Contents(), packet.Size() ); +} + + +ReceivedBundle::ReceivedBundle( const ReceivedBundleElement& bundleElement ) + : elementCount_( 0 ) +{ + Init( bundleElement.Contents(), bundleElement.Size() ); +} + + +void ReceivedBundle::Init( const char *bundle, osc_bundle_element_size_t size ) +{ + + if( !IsValidElementSizeValue(size) ) + throw MalformedBundleException( "invalid bundle size" ); + + if( size < 16 ) + throw MalformedBundleException( "packet too short for bundle" ); + + if( !IsMultipleOf4(size) ) + throw MalformedBundleException( "bundle size must be multiple of four" ); + + if( bundle[0] != '#' + || bundle[1] != 'b' + || bundle[2] != 'u' + || bundle[3] != 'n' + || bundle[4] != 'd' + || bundle[5] != 'l' + || bundle[6] != 'e' + || bundle[7] != '\0' ) + throw MalformedBundleException( "bad bundle address pattern" ); + + end_ = bundle + size; + + timeTag_ = bundle + 8; + + const char *p = timeTag_ + 8; + + while( p < end_ ){ + if( p + osc::OSC_SIZEOF_INT32 > end_ ) + throw MalformedBundleException( "packet too short for elementSize" ); + + // treat element size as an unsigned int for the purposes of this calculation + uint32 elementSize = ToUInt32( p ); + if( (elementSize & ((uint32)0x03)) != 0 ) + throw MalformedBundleException( "bundle element size must be multiple of four" ); + + p += osc::OSC_SIZEOF_INT32 + elementSize; + if( p > end_ ) + throw MalformedBundleException( "packet too short for bundle element" ); + + ++elementCount_; + } + + if( p != end_ ) + throw MalformedBundleException( "bundle contents " ); +} + + +uint64 ReceivedBundle::TimeTag() const +{ + return ToUInt64( timeTag_ ); +} + + +} // namespace osc + diff --git a/ext/osc/osc/OscReceivedElements.h b/ext/osc/osc/OscReceivedElements.h new file mode 100644 index 0000000000..b6205f3168 --- /dev/null +++ b/ext/osc/osc/OscReceivedElements.h @@ -0,0 +1,548 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_OSCRECEIVEDELEMENTS_H +#define INCLUDED_OSCPACK_OSCRECEIVEDELEMENTS_H + +#include +#include +#include // size_t + +#include "OscTypes.h" +#include "OscException.h" + + +namespace osc{ + + +class MalformedPacketException : public Exception{ +public: + MalformedPacketException( const char *w="malformed packet" ) + : Exception( w ) {} +}; + +class MalformedMessageException : public Exception{ +public: + MalformedMessageException( const char *w="malformed message" ) + : Exception( w ) {} +}; + +class MalformedBundleException : public Exception{ +public: + MalformedBundleException( const char *w="malformed bundle" ) + : Exception( w ) {} +}; + +class WrongArgumentTypeException : public Exception{ +public: + WrongArgumentTypeException( const char *w="wrong argument type" ) + : Exception( w ) {} +}; + +class MissingArgumentException : public Exception{ +public: + MissingArgumentException( const char *w="missing argument" ) + : Exception( w ) {} +}; + +class ExcessArgumentException : public Exception{ +public: + ExcessArgumentException( const char *w="too many arguments" ) + : Exception( w ) {} +}; + + +class ReceivedPacket{ +public: + // Although the OSC spec is not entirely clear on this, we only support + // packets up to 0x7FFFFFFC bytes long (the maximum 4-byte aligned value + // representable by an int32). An exception will be raised if you pass a + // larger value to the ReceivedPacket() constructor. + + ReceivedPacket( const char *contents, osc_bundle_element_size_t size ) + : contents_( contents ) + , size_( ValidateSize(size) ) {} + + ReceivedPacket( const char *contents, std::size_t size ) + : contents_( contents ) + , size_( ValidateSize( (osc_bundle_element_size_t)size ) ) {} + +#if !(defined(__x86_64__) || defined(_M_X64)) + ReceivedPacket( const char *contents, int size ) + : contents_( contents ) + , size_( ValidateSize( (osc_bundle_element_size_t)size ) ) {} +#endif + + bool IsMessage() const { return !IsBundle(); } + bool IsBundle() const; + + osc_bundle_element_size_t Size() const { return size_; } + const char *Contents() const { return contents_; } + +private: + const char *contents_; + osc_bundle_element_size_t size_; + + static osc_bundle_element_size_t ValidateSize( osc_bundle_element_size_t size ) + { + // sanity check integer types declared in OscTypes.h + // you'll need to fix OscTypes.h if any of these asserts fail + assert( sizeof(osc::int32) == 4 ); + assert( sizeof(osc::uint32) == 4 ); + assert( sizeof(osc::int64) == 8 ); + assert( sizeof(osc::uint64) == 8 ); + + if( !IsValidElementSizeValue(size) ) + throw MalformedPacketException( "invalid packet size" ); + + if( size == 0 ) + throw MalformedPacketException( "zero length elements not permitted" ); + + if( !IsMultipleOf4(size) ) + throw MalformedPacketException( "element size must be multiple of four" ); + + return size; + } +}; + + +class ReceivedBundleElement{ +public: + ReceivedBundleElement( const char *sizePtr ) + : sizePtr_( sizePtr ) {} + + friend class ReceivedBundleElementIterator; + + bool IsMessage() const { return !IsBundle(); } + bool IsBundle() const; + + osc_bundle_element_size_t Size() const; + const char *Contents() const { return sizePtr_ + osc::OSC_SIZEOF_INT32; } + +private: + const char *sizePtr_; +}; + + +class ReceivedBundleElementIterator{ +public: + ReceivedBundleElementIterator( const char *sizePtr ) + : value_( sizePtr ) {} + + ReceivedBundleElementIterator operator++() + { + Advance(); + return *this; + } + + ReceivedBundleElementIterator operator++(int) + { + ReceivedBundleElementIterator old( *this ); + Advance(); + return old; + } + + const ReceivedBundleElement& operator*() const { return value_; } + + const ReceivedBundleElement* operator->() const { return &value_; } + + friend bool operator==(const ReceivedBundleElementIterator& lhs, + const ReceivedBundleElementIterator& rhs ); + +private: + ReceivedBundleElement value_; + + void Advance() { value_.sizePtr_ = value_.Contents() + value_.Size(); } + + bool IsEqualTo( const ReceivedBundleElementIterator& rhs ) const + { + return value_.sizePtr_ == rhs.value_.sizePtr_; + } +}; + +inline bool operator==(const ReceivedBundleElementIterator& lhs, + const ReceivedBundleElementIterator& rhs ) +{ + return lhs.IsEqualTo( rhs ); +} + +inline bool operator!=(const ReceivedBundleElementIterator& lhs, + const ReceivedBundleElementIterator& rhs ) +{ + return !( lhs == rhs ); +} + + +class ReceivedMessageArgument{ +public: + ReceivedMessageArgument( const char *typeTagPtr, const char *argumentPtr ) + : typeTagPtr_( typeTagPtr ) + , argumentPtr_( argumentPtr ) {} + + friend class ReceivedMessageArgumentIterator; + + char TypeTag() const { return *typeTagPtr_; } + + // the unchecked methods below don't check whether the argument actually + // is of the specified type. they should only be used if you've already + // checked the type tag or the associated IsType() method. + + bool IsBool() const + { return *typeTagPtr_ == TRUE_TYPE_TAG || *typeTagPtr_ == FALSE_TYPE_TAG; } + bool AsBool() const; + bool AsBoolUnchecked() const; + + bool IsNil() const { return *typeTagPtr_ == NIL_TYPE_TAG; } + bool IsInfinitum() const { return *typeTagPtr_ == INFINITUM_TYPE_TAG; } + + bool IsInt32() const { return *typeTagPtr_ == INT32_TYPE_TAG; } + int32 AsInt32() const; + int32 AsInt32Unchecked() const; + + bool IsFloat() const { return *typeTagPtr_ == FLOAT_TYPE_TAG; } + float AsFloat() const; + float AsFloatUnchecked() const; + + bool IsChar() const { return *typeTagPtr_ == CHAR_TYPE_TAG; } + char AsChar() const; + char AsCharUnchecked() const; + + bool IsRgbaColor() const { return *typeTagPtr_ == RGBA_COLOR_TYPE_TAG; } + uint32 AsRgbaColor() const; + uint32 AsRgbaColorUnchecked() const; + + bool IsMidiMessage() const { return *typeTagPtr_ == MIDI_MESSAGE_TYPE_TAG; } + uint32 AsMidiMessage() const; + uint32 AsMidiMessageUnchecked() const; + + bool IsInt64() const { return *typeTagPtr_ == INT64_TYPE_TAG; } + int64 AsInt64() const; + int64 AsInt64Unchecked() const; + + bool IsTimeTag() const { return *typeTagPtr_ == TIME_TAG_TYPE_TAG; } + uint64 AsTimeTag() const; + uint64 AsTimeTagUnchecked() const; + + bool IsDouble() const { return *typeTagPtr_ == DOUBLE_TYPE_TAG; } + double AsDouble() const; + double AsDoubleUnchecked() const; + + bool IsString() const { return *typeTagPtr_ == STRING_TYPE_TAG; } + const char* AsString() const; + const char* AsStringUnchecked() const { return argumentPtr_; } + + bool IsSymbol() const { return *typeTagPtr_ == SYMBOL_TYPE_TAG; } + const char* AsSymbol() const; + const char* AsSymbolUnchecked() const { return argumentPtr_; } + + bool IsBlob() const { return *typeTagPtr_ == BLOB_TYPE_TAG; } + void AsBlob( const void*& data, osc_bundle_element_size_t& size ) const; + void AsBlobUnchecked( const void*& data, osc_bundle_element_size_t& size ) const; + + bool IsArrayBegin() const { return *typeTagPtr_ == ARRAY_BEGIN_TYPE_TAG; } + bool IsArrayEnd() const { return *typeTagPtr_ == ARRAY_END_TYPE_TAG; } + // Calculate the number of top-level items in the array. Nested arrays count as one item. + // Only valid at array start. Will throw an exception if IsArrayStart() == false. + std::size_t ComputeArrayItemCount() const; + +private: + const char *typeTagPtr_; + const char *argumentPtr_; +}; + + +class ReceivedMessageArgumentIterator{ +public: + ReceivedMessageArgumentIterator( const char *typeTags, const char *arguments ) + : value_( typeTags, arguments ) {} + + ReceivedMessageArgumentIterator operator++() + { + Advance(); + return *this; + } + + ReceivedMessageArgumentIterator operator++(int) + { + ReceivedMessageArgumentIterator old( *this ); + Advance(); + return old; + } + + const ReceivedMessageArgument& operator*() const { return value_; } + + const ReceivedMessageArgument* operator->() const { return &value_; } + + friend bool operator==(const ReceivedMessageArgumentIterator& lhs, + const ReceivedMessageArgumentIterator& rhs ); + +private: + ReceivedMessageArgument value_; + + void Advance(); + + bool IsEqualTo( const ReceivedMessageArgumentIterator& rhs ) const + { + return value_.typeTagPtr_ == rhs.value_.typeTagPtr_; + } +}; + +inline bool operator==(const ReceivedMessageArgumentIterator& lhs, + const ReceivedMessageArgumentIterator& rhs ) +{ + return lhs.IsEqualTo( rhs ); +} + +inline bool operator!=(const ReceivedMessageArgumentIterator& lhs, + const ReceivedMessageArgumentIterator& rhs ) +{ + return !( lhs == rhs ); +} + + +class ReceivedMessageArgumentStream{ + friend class ReceivedMessage; + ReceivedMessageArgumentStream( const ReceivedMessageArgumentIterator& begin, + const ReceivedMessageArgumentIterator& end ) + : p_( begin ) + , end_( end ) {} + + ReceivedMessageArgumentIterator p_, end_; + +public: + + // end of stream + bool Eos() const { return p_ == end_; } + + ReceivedMessageArgumentStream& operator>>( bool& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs = (*p_++).AsBool(); + return *this; + } + + // not sure if it would be useful to stream Nil and Infinitum + // for now it's not possible + // same goes for array boundaries + + ReceivedMessageArgumentStream& operator>>( int32& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs = (*p_++).AsInt32(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( float& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs = (*p_++).AsFloat(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( char& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs = (*p_++).AsChar(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( RgbaColor& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs.value = (*p_++).AsRgbaColor(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( MidiMessage& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs.value = (*p_++).AsMidiMessage(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( int64& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs = (*p_++).AsInt64(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( TimeTag& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs.value = (*p_++).AsTimeTag(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( double& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs = (*p_++).AsDouble(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( Blob& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + (*p_++).AsBlob( rhs.data, rhs.size ); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( const char*& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs = (*p_++).AsString(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( Symbol& rhs ) + { + if( Eos() ) + throw MissingArgumentException(); + + rhs.value = (*p_++).AsSymbol(); + return *this; + } + + ReceivedMessageArgumentStream& operator>>( MessageTerminator& rhs ) + { + (void) rhs; // suppress unused parameter warning + + if( !Eos() ) + throw ExcessArgumentException(); + + return *this; + } +}; + + +class ReceivedMessage{ + void Init( const char *bundle, osc_bundle_element_size_t size ); +public: + explicit ReceivedMessage( const ReceivedPacket& packet ); + explicit ReceivedMessage( const ReceivedBundleElement& bundleElement ); + + const char *AddressPattern() const { return addressPattern_; } + + // Support for non-standard SuperCollider integer address patterns: + bool AddressPatternIsUInt32() const; + uint32 AddressPatternAsUInt32() const; + + uint32 ArgumentCount() const { return static_cast(typeTagsEnd_ - typeTagsBegin_); } + + const char *TypeTags() const { return typeTagsBegin_; } + + + typedef ReceivedMessageArgumentIterator const_iterator; + + ReceivedMessageArgumentIterator ArgumentsBegin() const + { + return ReceivedMessageArgumentIterator( typeTagsBegin_, arguments_ ); + } + + ReceivedMessageArgumentIterator ArgumentsEnd() const + { + return ReceivedMessageArgumentIterator( typeTagsEnd_, 0 ); + } + + ReceivedMessageArgumentStream ArgumentStream() const + { + return ReceivedMessageArgumentStream( ArgumentsBegin(), ArgumentsEnd() ); + } + +private: + const char *addressPattern_; + const char *typeTagsBegin_; + const char *typeTagsEnd_; + const char *arguments_; +}; + + +class ReceivedBundle{ + void Init( const char *message, osc_bundle_element_size_t size ); +public: + explicit ReceivedBundle( const ReceivedPacket& packet ); + explicit ReceivedBundle( const ReceivedBundleElement& bundleElement ); + + uint64 TimeTag() const; + + uint32 ElementCount() const { return elementCount_; } + + typedef ReceivedBundleElementIterator const_iterator; + + ReceivedBundleElementIterator ElementsBegin() const + { + return ReceivedBundleElementIterator( timeTag_ + 8 ); + } + + ReceivedBundleElementIterator ElementsEnd() const + { + return ReceivedBundleElementIterator( end_ ); + } + +private: + const char *timeTag_; + const char *end_; + uint32 elementCount_; +}; + + +} // namespace osc + + +#endif /* INCLUDED_OSCPACK_OSCRECEIVEDELEMENTS_H */ diff --git a/ext/osc/osc/OscTypes.cpp b/ext/osc/osc/OscTypes.cpp new file mode 100644 index 0000000000..444a9fed48 --- /dev/null +++ b/ext/osc/osc/OscTypes.cpp @@ -0,0 +1,52 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#include "OscTypes.h" + +namespace osc{ + +BundleInitiator BeginBundleImmediate(1); +BundleTerminator EndBundle; +MessageTerminator EndMessage; +NilType OscNil; +#ifndef _OBJC_OBJC_H_ +NilType Nil; // Objective-C defines Nil. so our Nil is deprecated. use OscNil instead +#endif +InfinitumType Infinitum; +ArrayInitiator BeginArray; +ArrayTerminator EndArray; + +} // namespace osc diff --git a/ext/osc/osc/OscTypes.h b/ext/osc/osc/OscTypes.h new file mode 100644 index 0000000000..610020182e --- /dev/null +++ b/ext/osc/osc/OscTypes.h @@ -0,0 +1,240 @@ +/* + oscpack -- Open Sound Control (OSC) packet manipulation library + http://www.rossbencina.com/code/oscpack + + Copyright (c) 2004-2013 Ross Bencina + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* + The text above constitutes the entire oscpack license; however, + the oscpack developer(s) also make the following non-binding requests: + + Any person wishing to distribute modifications to the Software is + requested to send the modifications to the original developer so that + they can be incorporated into the canonical version. It is also + requested that these non-binding requests be included whenever the + above license is reproduced. +*/ +#ifndef INCLUDED_OSCPACK_OSCTYPES_H +#define INCLUDED_OSCPACK_OSCTYPES_H + + +namespace osc{ + +// basic types + +#if defined(__BORLANDC__) || defined(_MSC_VER) + +typedef __int64 int64; +typedef unsigned __int64 uint64; + +#elif defined(__x86_64__) || defined(_M_X64) + +typedef long int64; +typedef unsigned long uint64; + +#else + +typedef long long int64; +typedef unsigned long long uint64; + +#endif + + + +#if defined(__x86_64__) || defined(_M_X64) + +typedef signed int int32; +typedef unsigned int uint32; + +#else + +typedef signed long int32; +typedef unsigned long uint32; + +#endif + + +enum ValueTypeSizes{ + OSC_SIZEOF_INT32 = 4, + OSC_SIZEOF_UINT32 = 4, + OSC_SIZEOF_INT64 = 8, + OSC_SIZEOF_UINT64 = 8, +}; + + +// osc_bundle_element_size_t is used for the size of bundle elements and blobs +// the OSC spec specifies these as int32 (signed) but we ensure that they +// are always positive since negative field sizes make no sense. + +typedef int32 osc_bundle_element_size_t; + +enum { + OSC_INT32_MAX = 0x7FFFFFFF, + + // Element sizes are specified to be int32, and are always rounded up to nearest + // multiple of 4. Therefore their values can't be greater than 0x7FFFFFFC. + OSC_BUNDLE_ELEMENT_SIZE_MAX = 0x7FFFFFFC +}; + + +inline bool IsValidElementSizeValue( osc_bundle_element_size_t x ) +{ + // sizes may not be negative or exceed OSC_BUNDLE_ELEMENT_SIZE_MAX + return x >= 0 && x <= OSC_BUNDLE_ELEMENT_SIZE_MAX; +} + + +inline bool IsMultipleOf4( osc_bundle_element_size_t x ) +{ + return (x & ((osc_bundle_element_size_t)0x03)) == 0; +} + + +enum TypeTagValues { + TRUE_TYPE_TAG = 'T', + FALSE_TYPE_TAG = 'F', + NIL_TYPE_TAG = 'N', + INFINITUM_TYPE_TAG = 'I', + INT32_TYPE_TAG = 'i', + FLOAT_TYPE_TAG = 'f', + CHAR_TYPE_TAG = 'c', + RGBA_COLOR_TYPE_TAG = 'r', + MIDI_MESSAGE_TYPE_TAG = 'm', + INT64_TYPE_TAG = 'h', + TIME_TAG_TYPE_TAG = 't', + DOUBLE_TYPE_TAG = 'd', + STRING_TYPE_TAG = 's', + SYMBOL_TYPE_TAG = 'S', + BLOB_TYPE_TAG = 'b', + ARRAY_BEGIN_TYPE_TAG = '[', + ARRAY_END_TYPE_TAG = ']' +}; + + + +// i/o manipulators used for streaming interfaces + +struct BundleInitiator{ + explicit BundleInitiator( uint64 timeTag_ ) : timeTag( timeTag_ ) {} + uint64 timeTag; +}; + +extern BundleInitiator BeginBundleImmediate; + +inline BundleInitiator BeginBundle( uint64 timeTag=1 ) +{ + return BundleInitiator(timeTag); +} + + +struct BundleTerminator{ +}; + +extern BundleTerminator EndBundle; + +struct BeginMessage{ + explicit BeginMessage( const char *addressPattern_ ) : addressPattern( addressPattern_ ) {} + const char *addressPattern; +}; + +struct MessageTerminator{ +}; + +extern MessageTerminator EndMessage; + + +// osc specific types. they are defined as structs so they can be used +// as separately identifiable types with the streaming operators. + +struct NilType{ +}; + +extern NilType OscNil; + +#ifndef _OBJC_OBJC_H_ +extern NilType Nil; // Objective-C defines Nil. so our Nil is deprecated. use OscNil instead +#endif + +struct InfinitumType{ +}; + +extern InfinitumType Infinitum; + +struct RgbaColor{ + RgbaColor() {} + explicit RgbaColor( uint32 value_ ) : value( value_ ) {} + uint32 value; + + operator uint32() const { return value; } +}; + + +struct MidiMessage{ + MidiMessage() {} + explicit MidiMessage( uint32 value_ ) : value( value_ ) {} + uint32 value; + + operator uint32() const { return value; } +}; + + +struct TimeTag{ + TimeTag() {} + explicit TimeTag( uint64 value_ ) : value( value_ ) {} + uint64 value; + + operator uint64() const { return value; } +}; + + +struct Symbol{ + Symbol() {} + explicit Symbol( const char* value_ ) : value( value_ ) {} + const char* value; + + operator const char *() const { return value; } +}; + + +struct Blob{ + Blob() {} + explicit Blob( const void* data_, osc_bundle_element_size_t size_ ) + : data( data_ ), size( size_ ) {} + const void* data; + osc_bundle_element_size_t size; +}; + +struct ArrayInitiator{ +}; + +extern ArrayInitiator BeginArray; + +struct ArrayTerminator{ +}; + +extern ArrayTerminator EndArray; + +} // namespace osc + + +#endif /* INCLUDED_OSCPACK_OSCTYPES_H */ From e14121741a702a17043ff46ad7842ec0ec7748e2 Mon Sep 17 00:00:00 2001 From: Malin E Date: Tue, 7 Dec 2021 09:05:16 +0100 Subject: [PATCH 016/117] Dont spam warning for too many axes or buttons on joystick --- apps/OpenSpace/main.cpp | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 063057d6a5..24bc01d5dc 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -369,30 +369,33 @@ void mainPreSyncFunc() { std::fill(state.axes.begin(), state.axes.end(), 0.f); std::fill(state.buttons.begin(), state.buttons.end(), JoystickAction::Idle); + + // Check axes and buttons + glfwGetJoystickAxes(i, &state.nAxes); + if (state.nAxes > JoystickInputState::MaxAxes) { + LWARNING(fmt::format( + "Joystick/Gamepad {} has {} axes, but only {} axes are supported. " + "All excess axes are ignored", + state.name, state.nAxes, JoystickInputState::MaxAxes + )); + state.nAxes = JoystickInputState::MaxAxes; + } + glfwGetJoystickButtons(i, &state.nButtons); + if (state.nButtons > JoystickInputState::MaxButtons) { + LWARNING(fmt::format( + "Joystick/Gamepad {} has {} buttons, but only {} buttons are " + "supported. All excess buttons are ignored", + state.name, state.nButtons, JoystickInputState::MaxButtons + )); + state.nButtons = JoystickInputState::MaxButtons; + } } const float* axes = glfwGetJoystickAxes(i, &state.nAxes); - if (state.nAxes > JoystickInputState::MaxAxes) { - LWARNING(fmt::format( - "Joystick/Gamepad {} has {} axes, but only {} axes are supported. " - "All excess axes are ignored", - state.name, state.nAxes, JoystickInputState::MaxAxes - )); - state.nAxes = JoystickInputState::MaxAxes; - } std::memcpy(state.axes.data(), axes, state.nAxes * sizeof(float)); const unsigned char* buttons = glfwGetJoystickButtons(i, &state.nButtons); - if (state.nButtons > JoystickInputState::MaxButtons) { - LWARNING(fmt::format( - "Joystick/Gamepad {} has {} buttons, but only {} buttons are " - "supported. All excess buttons are ignored", - state.name, state.nButtons, JoystickInputState::MaxButtons - )); - state.nButtons = JoystickInputState::MaxButtons; - } - for (int j = 0; j < state.nButtons; ++j) { const bool currentlyPressed = buttons[j] == GLFW_PRESS; From a3ba8ee808925759ba9a4ea863a569f97b52b847 Mon Sep 17 00:00:00 2001 From: Malin E Date: Tue, 7 Dec 2021 10:52:04 +0100 Subject: [PATCH 017/117] Remove excess axes or buttons if too many present on joystick --- apps/OpenSpace/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 24bc01d5dc..b761225f75 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -378,7 +378,6 @@ void mainPreSyncFunc() { "All excess axes are ignored", state.name, state.nAxes, JoystickInputState::MaxAxes )); - state.nAxes = JoystickInputState::MaxAxes; } glfwGetJoystickButtons(i, &state.nButtons); if (state.nButtons > JoystickInputState::MaxButtons) { @@ -387,14 +386,19 @@ void mainPreSyncFunc() { "supported. All excess buttons are ignored", state.name, state.nButtons, JoystickInputState::MaxButtons )); - state.nButtons = JoystickInputState::MaxButtons; } } const float* axes = glfwGetJoystickAxes(i, &state.nAxes); + if (state.nAxes > JoystickInputState::MaxAxes) { + state.nAxes = JoystickInputState::MaxAxes; + } std::memcpy(state.axes.data(), axes, state.nAxes * sizeof(float)); const unsigned char* buttons = glfwGetJoystickButtons(i, &state.nButtons); + if (state.nButtons > JoystickInputState::MaxButtons) { + state.nButtons = JoystickInputState::MaxButtons; + } for (int j = 0; j < state.nButtons; ++j) { const bool currentlyPressed = buttons[j] == GLFW_PRESS; From cfd8b145f3af709d6aa870c1acf7ef80d8b1dc39 Mon Sep 17 00:00:00 2001 From: Malin E Date: Tue, 7 Dec 2021 11:07:05 +0100 Subject: [PATCH 018/117] Remove osc files that should not be here --- ext/osc/CMakeLists.txt | 53 -- ext/osc/LICENSE | 34 - ext/osc/ip/IpEndpointName.cpp | 88 -- ext/osc/ip/IpEndpointName.h | 83 -- ext/osc/ip/NetworkingUtils.h | 56 -- ext/osc/ip/PacketListener.h | 50 -- ext/osc/ip/TimerListener.h | 47 -- ext/osc/ip/UdpSocket.h | 177 ---- ext/osc/ip/posix/NetworkingUtils.cpp | 64 -- ext/osc/ip/posix/UdpSocket.cpp | 605 ------------- ext/osc/ip/win32/NetworkingUtils.cpp | 95 --- ext/osc/ip/win32/UdpSocket.cpp | 574 ------------- ext/osc/osc/MessageMappingOscPacketListener.h | 80 -- ext/osc/osc/OscException.h | 62 -- ext/osc/osc/OscHostEndianness.h | 127 --- ext/osc/osc/OscOutboundPacketStream.cpp | 683 --------------- ext/osc/osc/OscOutboundPacketStream.h | 155 ---- ext/osc/osc/OscPacketListener.h | 79 -- ext/osc/osc/OscPrintReceivedElements.cpp | 261 ------ ext/osc/osc/OscPrintReceivedElements.h | 54 -- ext/osc/osc/OscReceivedElements.cpp | 796 ------------------ ext/osc/osc/OscReceivedElements.h | 548 ------------ ext/osc/osc/OscTypes.cpp | 52 -- ext/osc/osc/OscTypes.h | 240 ------ 24 files changed, 5063 deletions(-) delete mode 100644 ext/osc/CMakeLists.txt delete mode 100644 ext/osc/LICENSE delete mode 100644 ext/osc/ip/IpEndpointName.cpp delete mode 100644 ext/osc/ip/IpEndpointName.h delete mode 100644 ext/osc/ip/NetworkingUtils.h delete mode 100644 ext/osc/ip/PacketListener.h delete mode 100644 ext/osc/ip/TimerListener.h delete mode 100644 ext/osc/ip/UdpSocket.h delete mode 100644 ext/osc/ip/posix/NetworkingUtils.cpp delete mode 100644 ext/osc/ip/posix/UdpSocket.cpp delete mode 100644 ext/osc/ip/win32/NetworkingUtils.cpp delete mode 100644 ext/osc/ip/win32/UdpSocket.cpp delete mode 100644 ext/osc/osc/MessageMappingOscPacketListener.h delete mode 100644 ext/osc/osc/OscException.h delete mode 100644 ext/osc/osc/OscHostEndianness.h delete mode 100644 ext/osc/osc/OscOutboundPacketStream.cpp delete mode 100644 ext/osc/osc/OscOutboundPacketStream.h delete mode 100644 ext/osc/osc/OscPacketListener.h delete mode 100644 ext/osc/osc/OscPrintReceivedElements.cpp delete mode 100644 ext/osc/osc/OscPrintReceivedElements.h delete mode 100644 ext/osc/osc/OscReceivedElements.cpp delete mode 100644 ext/osc/osc/OscReceivedElements.h delete mode 100644 ext/osc/osc/OscTypes.cpp delete mode 100644 ext/osc/osc/OscTypes.h diff --git a/ext/osc/CMakeLists.txt b/ext/osc/CMakeLists.txt deleted file mode 100644 index 27c30e8a18..0000000000 --- a/ext/osc/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -cmake_minimum_required(VERSION 2.6) -PROJECT(Oscpack) -message(STATUS "Generating oscpack project") - -# separate versions of NetworkingUtils.cpp and UdpSocket.cpp are provided for Win32 and POSIX -# the IpSystemTypePath selects the correct ones based on the current platform - -IF(WIN32) - set(IpSystemTypePath ip/win32) -ELSE(WIN32) - set(IpSystemTypePath ip/posix) -ENDIF(WIN32) - -ADD_LIBRARY(oscpack - ip/IpEndpointName.h - ip/IpEndpointName.cpp - ip/NetworkingUtils.h - ${IpSystemTypePath}/NetworkingUtils.cpp - ip/UdpSocket.h - ${IpSystemTypePath}/UdpSocket.cpp - ip/PacketListener.h - ip/TimerListener.h - osc/OscTypes.h - osc/OscTypes.cpp - osc/OscHostEndianness.h - osc/OscException.h - osc/OscPacketListener.h - osc/MessageMappingOscPacketListener.h - osc/OscReceivedElements.h - osc/OscReceivedElements.cpp - osc/OscPrintReceivedElements.h - osc/OscPrintReceivedElements.cpp - osc/OscOutboundPacketStream.h - osc/OscOutboundPacketStream.cpp -) - -TARGET_INCLUDE_DIRECTORIES(oscpack PUBLIC ${CMAKE_SOURCE_DIR}) - -IF(WIN32) - target_link_libraries(oscpack PUBLIC Ws2_32 winmm) -ENDIF(WIN32) - -if(MSVC) - # Force to always compile with W4 - if(CMAKE_CXX_FLAGS MATCHES /W[0-4]) - string(REGEX REPLACE /W[0-4] /W4 CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - else() - set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} /W4) - endif() -elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - # Update if necessary - set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-long-long -pedantic) -endif() diff --git a/ext/osc/LICENSE b/ext/osc/LICENSE deleted file mode 100644 index ebaaac1977..0000000000 --- a/ext/osc/LICENSE +++ /dev/null @@ -1,34 +0,0 @@ -oscpack -- Open Sound Control (OSC) packet manipulation library -http://www.rossbencina.com/code/oscpack - -Copyright (c) 2004-2013 Ross Bencina - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files -(the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -### - -The text above constitutes the entire oscpack license; however, -the oscpack developer(s) also make the following non-binding requests: - -Any person wishing to distribute modifications to the Software is -requested to send the modifications to the original developer so that -they can be incorporated into the canonical version. It is also -requested that these non-binding requests be included whenever the -above license is reproduced. \ No newline at end of file diff --git a/ext/osc/ip/IpEndpointName.cpp b/ext/osc/ip/IpEndpointName.cpp deleted file mode 100644 index 50b0262216..0000000000 --- a/ext/osc/ip/IpEndpointName.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#include "IpEndpointName.h" - -#include - -#include "NetworkingUtils.h" - - -unsigned long IpEndpointName::GetHostByName( const char *s ) -{ - return ::GetHostByName(s); -} - - -void IpEndpointName::AddressAsString( char *s ) const -{ - if( address == ANY_ADDRESS ){ - std::sprintf( s, "" ); - }else{ - std::sprintf( s, "%d.%d.%d.%d", - (int)((address >> 24) & 0xFF), - (int)((address >> 16) & 0xFF), - (int)((address >> 8) & 0xFF), - (int)(address & 0xFF) ); - } -} - - -void IpEndpointName::AddressAndPortAsString( char *s ) const -{ - if( port == ANY_PORT ){ - if( address == ANY_ADDRESS ){ - std::sprintf( s, ":" ); - }else{ - std::sprintf( s, "%d.%d.%d.%d:", - (int)((address >> 24) & 0xFF), - (int)((address >> 16) & 0xFF), - (int)((address >> 8) & 0xFF), - (int)(address & 0xFF) ); - } - }else{ - if( address == ANY_ADDRESS ){ - std::sprintf( s, ":%d", port ); - }else{ - std::sprintf( s, "%d.%d.%d.%d:%d", - (int)((address >> 24) & 0xFF), - (int)((address >> 16) & 0xFF), - (int)((address >> 8) & 0xFF), - (int)(address & 0xFF), - (int)port ); - } - } -} diff --git a/ext/osc/ip/IpEndpointName.h b/ext/osc/ip/IpEndpointName.h deleted file mode 100644 index c83e1c3cfe..0000000000 --- a/ext/osc/ip/IpEndpointName.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_IPENDPOINTNAME_H -#define INCLUDED_OSCPACK_IPENDPOINTNAME_H - - -class IpEndpointName{ - static unsigned long GetHostByName( const char *s ); -public: - static const unsigned long ANY_ADDRESS = 0xFFFFFFFF; - static const int ANY_PORT = -1; - - IpEndpointName() - : address( ANY_ADDRESS ), port( ANY_PORT ) {} - IpEndpointName( int port_ ) - : address( ANY_ADDRESS ), port( port_ ) {} - IpEndpointName( unsigned long ipAddress_, int port_ ) - : address( ipAddress_ ), port( port_ ) {} - IpEndpointName( const char *addressName, int port_=ANY_PORT ) - : address( GetHostByName( addressName ) ) - , port( port_ ) {} - IpEndpointName( int addressA, int addressB, int addressC, int addressD, int port_=ANY_PORT ) - : address( ( (addressA << 24) | (addressB << 16) | (addressC << 8) | addressD ) ) - , port( port_ ) {} - - // address and port are maintained in host byte order here - unsigned long address; - int port; - - bool IsMulticastAddress() const { return ((address >> 24) & 0xFF) >= 224 && ((address >> 24) & 0xFF) <= 239; } - - enum { ADDRESS_STRING_LENGTH=17 }; - void AddressAsString( char *s ) const; - - enum { ADDRESS_AND_PORT_STRING_LENGTH=23}; - void AddressAndPortAsString( char *s ) const; -}; - -inline bool operator==( const IpEndpointName& lhs, const IpEndpointName& rhs ) -{ - return (lhs.address == rhs.address && lhs.port == rhs.port ); -} - -inline bool operator!=( const IpEndpointName& lhs, const IpEndpointName& rhs ) -{ - return !(lhs == rhs); -} - -#endif /* INCLUDED_OSCPACK_IPENDPOINTNAME_H */ diff --git a/ext/osc/ip/NetworkingUtils.h b/ext/osc/ip/NetworkingUtils.h deleted file mode 100644 index a83612aeda..0000000000 --- a/ext/osc/ip/NetworkingUtils.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_NETWORKINGUTILS_H -#define INCLUDED_OSCPACK_NETWORKINGUTILS_H - - -// in general NetworkInitializer is only used internally, but if you're -// application creates multiple sockets from different threads at runtime you -// should instantiate one of these in main just to make sure the networking -// layer is initialized. -class NetworkInitializer{ -public: - NetworkInitializer(); - ~NetworkInitializer(); -}; - - -// return ip address of host name in host byte order -unsigned long GetHostByName( const char *name ); - - -#endif /* INCLUDED_OSCPACK_NETWORKINGUTILS_H */ diff --git a/ext/osc/ip/PacketListener.h b/ext/osc/ip/PacketListener.h deleted file mode 100644 index 6c26b32996..0000000000 --- a/ext/osc/ip/PacketListener.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_PACKETLISTENER_H -#define INCLUDED_OSCPACK_PACKETLISTENER_H - - -class IpEndpointName; - -class PacketListener{ -public: - virtual ~PacketListener() {} - virtual void ProcessPacket( const char *data, int size, - const IpEndpointName& remoteEndpoint ) = 0; -}; - -#endif /* INCLUDED_OSCPACK_PACKETLISTENER_H */ diff --git a/ext/osc/ip/TimerListener.h b/ext/osc/ip/TimerListener.h deleted file mode 100644 index 59b4040600..0000000000 --- a/ext/osc/ip/TimerListener.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_TIMERLISTENER_H -#define INCLUDED_OSCPACK_TIMERLISTENER_H - - -class TimerListener{ -public: - virtual ~TimerListener() {} - virtual void TimerExpired() = 0; -}; - -#endif /* INCLUDED_OSCPACK_TIMERLISTENER_H */ diff --git a/ext/osc/ip/UdpSocket.h b/ext/osc/ip/UdpSocket.h deleted file mode 100644 index fd18a7a8e0..0000000000 --- a/ext/osc/ip/UdpSocket.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_UDPSOCKET_H -#define INCLUDED_OSCPACK_UDPSOCKET_H - -#include // size_t - -#include "NetworkingUtils.h" -#include "IpEndpointName.h" - - -class PacketListener; -class TimerListener; - -class UdpSocket; - -class SocketReceiveMultiplexer{ - class Implementation; - Implementation *impl_; - - friend class UdpSocket; - -public: - SocketReceiveMultiplexer(); - ~SocketReceiveMultiplexer(); - - // only call the attach/detach methods _before_ calling Run - - // only one listener per socket, each socket at most once - void AttachSocketListener( UdpSocket *socket, PacketListener *listener ); - void DetachSocketListener( UdpSocket *socket, PacketListener *listener ); - - void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ); - void AttachPeriodicTimerListener( - int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ); - void DetachPeriodicTimerListener( TimerListener *listener ); - - void Run(); // loop and block processing messages indefinitely - void RunUntilSigInt(); - void Break(); // call this from a listener to exit once the listener returns - void AsynchronousBreak(); // call this from another thread or signal handler to exit the Run() state -}; - - -class UdpSocket{ - class Implementation; - Implementation *impl_; - - friend class SocketReceiveMultiplexer::Implementation; - -public: - - // Ctor throws std::runtime_error if there's a problem - // initializing the socket. - UdpSocket(); - virtual ~UdpSocket(); - - // Enable broadcast addresses (e.g. x.x.x.255) - // Sets SO_BROADCAST socket option. - void SetEnableBroadcast( bool enableBroadcast ); - - // Enable multiple listeners for a single port on same - // network interface* - // Sets SO_REUSEADDR (also SO_REUSEPORT on OS X). - // [*] The exact behavior of SO_REUSEADDR and - // SO_REUSEPORT is undefined for some common cases - // and may have drastically different behavior on different - // operating systems. - void SetAllowReuse( bool allowReuse ); - - - // The socket is created in an unbound, unconnected state - // such a socket can only be used to send to an arbitrary - // address using SendTo(). To use Send() you need to first - // connect to a remote endpoint using Connect(). To use - // ReceiveFrom you need to first bind to a local endpoint - // using Bind(). - - // Retrieve the local endpoint name when sending to 'to' - IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const; - - // Connect to a remote endpoint which is used as the target - // for calls to Send() - void Connect( const IpEndpointName& remoteEndpoint ); - void Send( const char *data, std::size_t size ); - void SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ); - - - // Bind a local endpoint to receive incoming data. Endpoint - // can be 'any' for the system to choose an endpoint - void Bind( const IpEndpointName& localEndpoint ); - bool IsBound() const; - - std::size_t ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ); -}; - - -// convenience classes for transmitting and receiving -// they just call Connect and/or Bind in the ctor. -// note that you can still use a receive socket -// for transmitting etc - -class UdpTransmitSocket : public UdpSocket{ -public: - UdpTransmitSocket() = default; - UdpTransmitSocket( const IpEndpointName& remoteEndpoint ) - { Connect( remoteEndpoint ); } -}; - - -class UdpReceiveSocket : public UdpSocket{ -public: - UdpReceiveSocket( const IpEndpointName& localEndpoint ) - { Bind( localEndpoint ); } -}; - - -// UdpListeningReceiveSocket provides a simple way to bind one listener -// to a single socket without having to manually set up a SocketReceiveMultiplexer - -class UdpListeningReceiveSocket : public UdpSocket{ - SocketReceiveMultiplexer mux_; - PacketListener *listener_; -public: - UdpListeningReceiveSocket( const IpEndpointName& localEndpoint, PacketListener *listener ) - : listener_( listener ) - { - Bind( localEndpoint ); - mux_.AttachSocketListener( this, listener_ ); - } - - ~UdpListeningReceiveSocket() - { mux_.DetachSocketListener( this, listener_ ); } - - // see SocketReceiveMultiplexer above for the behaviour of these methods... - void Run() { mux_.Run(); } - void RunUntilSigInt() { mux_.RunUntilSigInt(); } - void Break() { mux_.Break(); } - void AsynchronousBreak() { mux_.AsynchronousBreak(); } -}; - - -#endif /* INCLUDED_OSCPACK_UDPSOCKET_H */ diff --git a/ext/osc/ip/posix/NetworkingUtils.cpp b/ext/osc/ip/posix/NetworkingUtils.cpp deleted file mode 100644 index 00011c98d3..0000000000 --- a/ext/osc/ip/posix/NetworkingUtils.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#include "modules/sonification/ext/osc/ip/NetworkingUtils.h" - -#include -#include -#include - -#include - - - -NetworkInitializer::NetworkInitializer() {} - -NetworkInitializer::~NetworkInitializer() {} - - -unsigned long GetHostByName( const char *name ) -{ - unsigned long result = 0; - - struct hostent *h = gethostbyname( name ); - if( h ){ - struct in_addr a; - std::memcpy( &a, h->h_addr_list[0], h->h_length ); - result = ntohl(a.s_addr); - } - - return result; -} diff --git a/ext/osc/ip/posix/UdpSocket.cpp b/ext/osc/ip/posix/UdpSocket.cpp deleted file mode 100644 index e1fcb375da..0000000000 --- a/ext/osc/ip/posix/UdpSocket.cpp +++ /dev/null @@ -1,605 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#include "ip/UdpSocket.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include // for sockaddr_in - -#include -#include -#include -#include - -#include -#include -#include // for memset -#include -#include - -#include "modules/sonification/ext/osc/ip/PacketListener.h" -#include "modules/sonification/ext/osc/ip/TimerListener.h" - - -#if defined(__APPLE__) && !defined(_SOCKLEN_T) -// pre system 10.3 didn't have socklen_t -typedef ssize_t socklen_t; -#endif - - -static void SockaddrFromIpEndpointName( struct sockaddr_in& sockAddr, const IpEndpointName& endpoint ) -{ - std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) ); - sockAddr.sin_family = AF_INET; - - sockAddr.sin_addr.s_addr = - (endpoint.address == IpEndpointName::ANY_ADDRESS) - ? INADDR_ANY - : htonl( endpoint.address ); - - sockAddr.sin_port = - (endpoint.port == IpEndpointName::ANY_PORT) - ? 0 - : htons( endpoint.port ); -} - - -static IpEndpointName IpEndpointNameFromSockaddr( const struct sockaddr_in& sockAddr ) -{ - return IpEndpointName( - (sockAddr.sin_addr.s_addr == INADDR_ANY) - ? IpEndpointName::ANY_ADDRESS - : ntohl( sockAddr.sin_addr.s_addr ), - (sockAddr.sin_port == 0) - ? IpEndpointName::ANY_PORT - : ntohs( sockAddr.sin_port ) - ); -} - - -class UdpSocket::Implementation{ - bool isBound_; - bool isConnected_; - - int socket_; - struct sockaddr_in connectedAddr_; - struct sockaddr_in sendToAddr_; - -public: - - Implementation() - : isBound_( false ) - , isConnected_( false ) - , socket_( -1 ) - { - if( (socket_ = socket( AF_INET, SOCK_DGRAM, 0 )) == -1 ){ - throw std::runtime_error("unable to create udp socket\n"); - } - - std::memset( &sendToAddr_, 0, sizeof(sendToAddr_) ); - sendToAddr_.sin_family = AF_INET; - } - - ~Implementation() - { - if (socket_ != -1) close(socket_); - } - - void SetEnableBroadcast( bool enableBroadcast ) - { - int broadcast = (enableBroadcast) ? 1 : 0; // int on posix - setsockopt(socket_, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast)); - } - - void SetAllowReuse( bool allowReuse ) - { - int reuseAddr = (allowReuse) ? 1 : 0; // int on posix - setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &reuseAddr, sizeof(reuseAddr)); - -#ifdef __APPLE__ - // needed also for OS X - enable multiple listeners for a single port on same network interface - int reusePort = (allowReuse) ? 1 : 0; // int on posix - setsockopt(socket_, SOL_SOCKET, SO_REUSEPORT, &reusePort, sizeof(reusePort)); -#endif - } - - IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const - { - assert( isBound_ ); - - // first connect the socket to the remote server - - struct sockaddr_in connectSockAddr; - SockaddrFromIpEndpointName( connectSockAddr, remoteEndpoint ); - - if (connect(socket_, (struct sockaddr *)&connectSockAddr, sizeof(connectSockAddr)) < 0) { - throw std::runtime_error("unable to connect udp socket\n"); - } - - // get the address - - struct sockaddr_in sockAddr; - std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) ); - socklen_t length = sizeof(sockAddr); - if (getsockname(socket_, (struct sockaddr *)&sockAddr, &length) < 0) { - throw std::runtime_error("unable to getsockname\n"); - } - - if( isConnected_ ){ - // reconnect to the connected address - - if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) { - throw std::runtime_error("unable to connect udp socket\n"); - } - - }else{ - // unconnect from the remote address - - struct sockaddr_in unconnectSockAddr; - std::memset( (char *)&unconnectSockAddr, 0, sizeof(unconnectSockAddr ) ); - unconnectSockAddr.sin_family = AF_UNSPEC; - // address fields are zero - int connectResult = connect(socket_, (struct sockaddr *)&unconnectSockAddr, sizeof(unconnectSockAddr)); - if ( connectResult < 0 && errno != EAFNOSUPPORT ) { - throw std::runtime_error("unable to un-connect udp socket\n"); - } - } - - return IpEndpointNameFromSockaddr( sockAddr ); - } - - void Connect( const IpEndpointName& remoteEndpoint ) - { - SockaddrFromIpEndpointName( connectedAddr_, remoteEndpoint ); - - if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) { - throw std::runtime_error("unable to connect udp socket\n"); - } - - isConnected_ = true; - } - - void Send( const char *data, std::size_t size ) - { - assert( isConnected_ ); - - int iResult = send( socket_, data, size, 0 ); - if(iResult == SOCKET_ERROR) { - printf("send failed with error: %d\n", WSAGetLastError()); - } - } - - void SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ) - { - sendToAddr_.sin_addr.s_addr = htonl( remoteEndpoint.address ); - sendToAddr_.sin_port = htons( remoteEndpoint.port ); - - sendto( socket_, data, size, 0, (sockaddr*)&sendToAddr_, sizeof(sendToAddr_) ); - } - - void Bind( const IpEndpointName& localEndpoint ) - { - struct sockaddr_in bindSockAddr; - SockaddrFromIpEndpointName( bindSockAddr, localEndpoint ); - - if (bind(socket_, (struct sockaddr *)&bindSockAddr, sizeof(bindSockAddr)) < 0) { - throw std::runtime_error("unable to bind udp socket\n"); - } - - isBound_ = true; - } - - bool IsBound() const { return isBound_; } - - std::size_t ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ) - { - assert( isBound_ ); - - struct sockaddr_in fromAddr; - socklen_t fromAddrLen = sizeof(fromAddr); - - ssize_t result = recvfrom(socket_, data, size, 0, - (struct sockaddr *) &fromAddr, (socklen_t*)&fromAddrLen); - if( result < 0 ) - return 0; - - remoteEndpoint.address = ntohl(fromAddr.sin_addr.s_addr); - remoteEndpoint.port = ntohs(fromAddr.sin_port); - - return (std::size_t)result; - } - - int Socket() { return socket_; } -}; - -UdpSocket::UdpSocket() -{ - impl_ = new Implementation(); -} - -UdpSocket::~UdpSocket() -{ - delete impl_; -} - -void UdpSocket::SetEnableBroadcast( bool enableBroadcast ) -{ - impl_->SetEnableBroadcast( enableBroadcast ); -} - -void UdpSocket::SetAllowReuse( bool allowReuse ) -{ - impl_->SetAllowReuse( allowReuse ); -} - -IpEndpointName UdpSocket::LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const -{ - return impl_->LocalEndpointFor( remoteEndpoint ); -} - -void UdpSocket::Connect( const IpEndpointName& remoteEndpoint ) -{ - impl_->Connect( remoteEndpoint ); -} - -void UdpSocket::Send( const char *data, std::size_t size ) -{ - impl_->Send( data, size ); -} - -void UdpSocket::SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ) -{ - impl_->SendTo( remoteEndpoint, data, size ); -} - -void UdpSocket::Bind( const IpEndpointName& localEndpoint ) -{ - impl_->Bind( localEndpoint ); -} - -bool UdpSocket::IsBound() const -{ - return impl_->IsBound(); -} - -std::size_t UdpSocket::ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ) -{ - return impl_->ReceiveFrom( remoteEndpoint, data, size ); -} - - -struct AttachedTimerListener{ - AttachedTimerListener( int id, int p, TimerListener *tl ) - : initialDelayMs( id ) - , periodMs( p ) - , listener( tl ) {} - int initialDelayMs; - int periodMs; - TimerListener *listener; -}; - - -static bool CompareScheduledTimerCalls( - const std::pair< double, AttachedTimerListener > & lhs, const std::pair< double, AttachedTimerListener > & rhs ) -{ - return lhs.first < rhs.first; -} - - -SocketReceiveMultiplexer *multiplexerInstanceToAbortWithSigInt_ = 0; - -extern "C" /*static*/ void InterruptSignalHandler( int ); -/*static*/ void InterruptSignalHandler( int ) -{ - multiplexerInstanceToAbortWithSigInt_->AsynchronousBreak(); - signal( SIGINT, SIG_DFL ); -} - - -class SocketReceiveMultiplexer::Implementation{ - std::vector< std::pair< PacketListener*, UdpSocket* > > socketListeners_; - std::vector< AttachedTimerListener > timerListeners_; - - volatile bool break_; - int breakPipe_[2]; // [0] is the reader descriptor and [1] the writer - - double GetCurrentTimeMs() const - { - struct timeval t; - - gettimeofday( &t, 0 ); - - return ((double)t.tv_sec*1000.) + ((double)t.tv_usec / 1000.); - } - -public: - Implementation() - { - if( pipe(breakPipe_) != 0 ) - throw std::runtime_error( "creation of asynchronous break pipes failed\n" ); - } - - ~Implementation() - { - close( breakPipe_[0] ); - close( breakPipe_[1] ); - } - - void AttachSocketListener( UdpSocket *socket, PacketListener *listener ) - { - assert( std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ) == socketListeners_.end() ); - // we don't check that the same socket has been added multiple times, even though this is an error - socketListeners_.push_back( std::make_pair( listener, socket ) ); - } - - void DetachSocketListener( UdpSocket *socket, PacketListener *listener ) - { - std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = - std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ); - assert( i != socketListeners_.end() ); - - socketListeners_.erase( i ); - } - - void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ) - { - timerListeners_.push_back( AttachedTimerListener( periodMilliseconds, periodMilliseconds, listener ) ); - } - - void AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ) - { - timerListeners_.push_back( AttachedTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ) ); - } - - void DetachPeriodicTimerListener( TimerListener *listener ) - { - std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin(); - while( i != timerListeners_.end() ){ - if( i->listener == listener ) - break; - ++i; - } - - assert( i != timerListeners_.end() ); - - timerListeners_.erase( i ); - } - - void Run() - { - break_ = false; - char *data = 0; - - try{ - - // configure the master fd_set for select() - - fd_set masterfds, tempfds; - FD_ZERO( &masterfds ); - FD_ZERO( &tempfds ); - - // in addition to listening to the inbound sockets we - // also listen to the asynchronous break pipe, so that AsynchronousBreak() - // can break us out of select() from another thread. - FD_SET( breakPipe_[0], &masterfds ); - int fdmax = breakPipe_[0]; - - for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin(); - i != socketListeners_.end(); ++i ){ - - if( fdmax < i->second->impl_->Socket() ) - fdmax = i->second->impl_->Socket(); - FD_SET( i->second->impl_->Socket(), &masterfds ); - } - - - // configure the timer queue - double currentTimeMs = GetCurrentTimeMs(); - - // expiry time ms, listener - std::vector< std::pair< double, AttachedTimerListener > > timerQueue_; - for( std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin(); - i != timerListeners_.end(); ++i ) - timerQueue_.push_back( std::make_pair( currentTimeMs + i->initialDelayMs, *i ) ); - std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls ); - - const int MAX_BUFFER_SIZE = 4098; - data = new char[ MAX_BUFFER_SIZE ]; - IpEndpointName remoteEndpoint; - - struct timeval timeout; - - while( !break_ ){ - tempfds = masterfds; - - struct timeval *timeoutPtr = 0; - if( !timerQueue_.empty() ){ - double timeoutMs = timerQueue_.front().first - GetCurrentTimeMs(); - if( timeoutMs < 0 ) - timeoutMs = 0; - - long timoutSecondsPart = (long)(timeoutMs * .001); - timeout.tv_sec = (time_t)timoutSecondsPart; - // 1000000 microseconds in a second - timeout.tv_usec = (suseconds_t)((timeoutMs - (timoutSecondsPart * 1000)) * 1000); - timeoutPtr = &timeout; - } - - if( select( fdmax + 1, &tempfds, 0, 0, timeoutPtr ) < 0 ){ - if( break_ ){ - break; - }else if( errno == EINTR ){ - // on returning an error, select() doesn't clear tempfds. - // so tempfds would remain all set, which would cause read( breakPipe_[0]... - // below to block indefinitely. therefore if select returns EINTR we restart - // the while() loop instead of continuing on to below. - continue; - }else{ - throw std::runtime_error("select failed\n"); - } - } - - if( FD_ISSET( breakPipe_[0], &tempfds ) ){ - // clear pending data from the asynchronous break pipe - char c; - read( breakPipe_[0], &c, 1 ); - } - - if( break_ ) - break; - - for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin(); - i != socketListeners_.end(); ++i ){ - - if( FD_ISSET( i->second->impl_->Socket(), &tempfds ) ){ - - std::size_t size = i->second->ReceiveFrom( remoteEndpoint, data, MAX_BUFFER_SIZE ); - if( size > 0 ){ - i->first->ProcessPacket( data, (int)size, remoteEndpoint ); - if( break_ ) - break; - } - } - } - - // execute any expired timers - currentTimeMs = GetCurrentTimeMs(); - bool resort = false; - for( std::vector< std::pair< double, AttachedTimerListener > >::iterator i = timerQueue_.begin(); - i != timerQueue_.end() && i->first <= currentTimeMs; ++i ){ - - i->second.listener->TimerExpired(); - if( break_ ) - break; - - i->first += i->second.periodMs; - resort = true; - } - if( resort ) - std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls ); - } - - delete [] data; - }catch(...){ - if( data ) - delete [] data; - throw; - } - } - - void Break() - { - break_ = true; - } - - void AsynchronousBreak() - { - break_ = true; - - // Send a termination message to the asynchronous break pipe, so select() will return - write( breakPipe_[1], "!", 1 ); - } -}; - - - -SocketReceiveMultiplexer::SocketReceiveMultiplexer() -{ - impl_ = new Implementation(); -} - -SocketReceiveMultiplexer::~SocketReceiveMultiplexer() -{ - delete impl_; -} - -void SocketReceiveMultiplexer::AttachSocketListener( UdpSocket *socket, PacketListener *listener ) -{ - impl_->AttachSocketListener( socket, listener ); -} - -void SocketReceiveMultiplexer::DetachSocketListener( UdpSocket *socket, PacketListener *listener ) -{ - impl_->DetachSocketListener( socket, listener ); -} - -void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ) -{ - impl_->AttachPeriodicTimerListener( periodMilliseconds, listener ); -} - -void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ) -{ - impl_->AttachPeriodicTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ); -} - -void SocketReceiveMultiplexer::DetachPeriodicTimerListener( TimerListener *listener ) -{ - impl_->DetachPeriodicTimerListener( listener ); -} - -void SocketReceiveMultiplexer::Run() -{ - impl_->Run(); -} - -void SocketReceiveMultiplexer::RunUntilSigInt() -{ - assert( multiplexerInstanceToAbortWithSigInt_ == 0 ); /* at present we support only one multiplexer instance running until sig int */ - multiplexerInstanceToAbortWithSigInt_ = this; - signal( SIGINT, InterruptSignalHandler ); - impl_->Run(); - signal( SIGINT, SIG_DFL ); - multiplexerInstanceToAbortWithSigInt_ = 0; -} - -void SocketReceiveMultiplexer::Break() -{ - impl_->Break(); -} - -void SocketReceiveMultiplexer::AsynchronousBreak() -{ - impl_->AsynchronousBreak(); -} - diff --git a/ext/osc/ip/win32/NetworkingUtils.cpp b/ext/osc/ip/win32/NetworkingUtils.cpp deleted file mode 100644 index 91f866d8ce..0000000000 --- a/ext/osc/ip/win32/NetworkingUtils.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#include "ip/NetworkingUtils.h" - -#include // this must come first to prevent errors with MSVC7 -#include - -#include - - -static LONG initCount_ = 0; -static bool winsockInitialized_ = false; - -NetworkInitializer::NetworkInitializer() -{ - if( InterlockedIncrement( &initCount_ ) == 1 ){ - // there is a race condition here if one thread tries to access - // the library while another is still initializing it. - // i can't think of an easy way to fix it so i'm telling you here - // incase you need to init the library from two threads at once. - // this is why the header file advises to instantiate one of these - // in main() so that the initialization happens globally - - // initialize winsock - WSAData wsaData; - int nCode = WSAStartup(MAKEWORD(1, 1), &wsaData); - if( nCode != 0 ){ - //std::cout << "WSAStartup() failed with error code " << nCode << "\n"; - }else{ - winsockInitialized_ = true; - } - } -} - - -NetworkInitializer::~NetworkInitializer() -{ - if( InterlockedDecrement( &initCount_ ) == 0 ){ - if( winsockInitialized_ ){ - WSACleanup(); - winsockInitialized_ = false; - } - } -} - - -unsigned long GetHostByName( const char *name ) -{ - NetworkInitializer networkInitializer; - - unsigned long result = 0; - - struct hostent *h = gethostbyname( name ); - if( h ){ - struct in_addr a; - std::memcpy( &a, h->h_addr_list[0], h->h_length ); - result = ntohl(a.s_addr); - } - - return result; -} diff --git a/ext/osc/ip/win32/UdpSocket.cpp b/ext/osc/ip/win32/UdpSocket.cpp deleted file mode 100644 index 4fd2b12cf1..0000000000 --- a/ext/osc/ip/win32/UdpSocket.cpp +++ /dev/null @@ -1,574 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ - -#include // this must come first to prevent errors with MSVC7 -#include -#include // for timeGetTime() - -#ifndef WINCE -#include -#endif - -#include -#include -#include // for memset -#include -#include - -#include "ip/UdpSocket.h" // usually I'd include the module header first - // but this is causing conflicts with BCB4 due to - // std::size_t usage. - -#include "ip/NetworkingUtils.h" -#include "ip/PacketListener.h" -#include "ip/TimerListener.h" - - -typedef int socklen_t; - - -static void SockaddrFromIpEndpointName( struct sockaddr_in& sockAddr, const IpEndpointName& endpoint ) -{ - std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) ); - sockAddr.sin_family = AF_INET; - - sockAddr.sin_addr.s_addr = - (endpoint.address == IpEndpointName::ANY_ADDRESS) - ? INADDR_ANY - : htonl( endpoint.address ); - - sockAddr.sin_port = - (endpoint.port == IpEndpointName::ANY_PORT) - ? (short)0 - : htons( (short)endpoint.port ); -} - - -static IpEndpointName IpEndpointNameFromSockaddr( const struct sockaddr_in& sockAddr ) -{ - return IpEndpointName( - (sockAddr.sin_addr.s_addr == INADDR_ANY) - ? IpEndpointName::ANY_ADDRESS - : ntohl( sockAddr.sin_addr.s_addr ), - (sockAddr.sin_port == 0) - ? IpEndpointName::ANY_PORT - : ntohs( sockAddr.sin_port ) - ); -} - - -class UdpSocket::Implementation{ - NetworkInitializer networkInitializer_; - - bool isBound_; - bool isConnected_; - - SOCKET socket_; - struct sockaddr_in connectedAddr_; - struct sockaddr_in sendToAddr_; - -public: - - Implementation() - : isBound_( false ) - , isConnected_( false ) - , socket_( INVALID_SOCKET ) - { - if( (socket_ = socket( AF_INET, SOCK_DGRAM, 0 )) == INVALID_SOCKET ){ - throw std::runtime_error("unable to create udp socket\n"); - } - - std::memset( &sendToAddr_, 0, sizeof(sendToAddr_) ); - sendToAddr_.sin_family = AF_INET; - } - - ~Implementation() - { - if (socket_ != INVALID_SOCKET) closesocket(socket_); - } - - void SetEnableBroadcast( bool enableBroadcast ) - { - char broadcast = (char)((enableBroadcast) ? 1 : 0); // char on win32 - setsockopt(socket_, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast)); - } - - void SetAllowReuse( bool allowReuse ) - { - // Note: SO_REUSEADDR is non-deterministic for listening sockets on Win32. See MSDN article: - // "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE" - // http://msdn.microsoft.com/en-us/library/ms740621%28VS.85%29.aspx - - char reuseAddr = (char)((allowReuse) ? 1 : 0); // char on win32 - setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &reuseAddr, sizeof(reuseAddr)); - } - - IpEndpointName LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const - { - assert( isBound_ ); - - // first connect the socket to the remote server - - struct sockaddr_in connectSockAddr; - SockaddrFromIpEndpointName( connectSockAddr, remoteEndpoint ); - - if (connect(socket_, (struct sockaddr *)&connectSockAddr, sizeof(connectSockAddr)) < 0) { - throw std::runtime_error("unable to connect udp socket\n"); - } - - // get the address - - struct sockaddr_in sockAddr; - std::memset( (char *)&sockAddr, 0, sizeof(sockAddr ) ); - socklen_t length = sizeof(sockAddr); - if (getsockname(socket_, (struct sockaddr *)&sockAddr, &length) < 0) { - throw std::runtime_error("unable to getsockname\n"); - } - - if( isConnected_ ){ - // reconnect to the connected address - - if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) { - throw std::runtime_error("unable to connect udp socket\n"); - } - - }else{ - // unconnect from the remote address - - struct sockaddr_in unconnectSockAddr; - SockaddrFromIpEndpointName( unconnectSockAddr, IpEndpointName() ); - - if( connect(socket_, (struct sockaddr *)&unconnectSockAddr, sizeof(unconnectSockAddr)) < 0 - && WSAGetLastError() != WSAEADDRNOTAVAIL ){ - throw std::runtime_error("unable to un-connect udp socket\n"); - } - } - - return IpEndpointNameFromSockaddr( sockAddr ); - } - - void Connect( const IpEndpointName& remoteEndpoint ) - { - SockaddrFromIpEndpointName( connectedAddr_, remoteEndpoint ); - - if (connect(socket_, (struct sockaddr *)&connectedAddr_, sizeof(connectedAddr_)) < 0) { - throw std::runtime_error("unable to connect udp socket\n"); - } - - isConnected_ = true; - } - - void Send( const char *data, std::size_t size ) - { - assert( isConnected_ ); - - int iResult = send( socket_, data, (int)size, 0 ); - if (iResult == SOCKET_ERROR) { - printf("send failed with error: %d\n", WSAGetLastError()); - } - } - - void SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ) - { - sendToAddr_.sin_addr.s_addr = htonl( remoteEndpoint.address ); - sendToAddr_.sin_port = htons( (short)remoteEndpoint.port ); - - sendto( socket_, data, (int)size, 0, (sockaddr*)&sendToAddr_, sizeof(sendToAddr_) ); - } - - void Bind( const IpEndpointName& localEndpoint ) - { - struct sockaddr_in bindSockAddr; - SockaddrFromIpEndpointName( bindSockAddr, localEndpoint ); - - if (bind(socket_, (struct sockaddr *)&bindSockAddr, sizeof(bindSockAddr)) < 0) { - throw std::runtime_error("unable to bind udp socket\n"); - } - - isBound_ = true; - } - - bool IsBound() const { return isBound_; } - - std::size_t ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ) - { - assert( isBound_ ); - - struct sockaddr_in fromAddr; - socklen_t fromAddrLen = sizeof(fromAddr); - - int result = recvfrom(socket_, data, (int)size, 0, - (struct sockaddr *) &fromAddr, (socklen_t*)&fromAddrLen); - if( result < 0 ) - return 0; - - remoteEndpoint.address = ntohl(fromAddr.sin_addr.s_addr); - remoteEndpoint.port = ntohs(fromAddr.sin_port); - - return result; - } - - SOCKET& Socket() { return socket_; } -}; - -UdpSocket::UdpSocket() -{ - impl_ = new Implementation(); -} - -UdpSocket::~UdpSocket() -{ - delete impl_; -} - -void UdpSocket::SetEnableBroadcast( bool enableBroadcast ) -{ - impl_->SetEnableBroadcast( enableBroadcast ); -} - -void UdpSocket::SetAllowReuse( bool allowReuse ) -{ - impl_->SetAllowReuse( allowReuse ); -} - -IpEndpointName UdpSocket::LocalEndpointFor( const IpEndpointName& remoteEndpoint ) const -{ - return impl_->LocalEndpointFor( remoteEndpoint ); -} - -void UdpSocket::Connect( const IpEndpointName& remoteEndpoint ) -{ - impl_->Connect( remoteEndpoint ); -} - -void UdpSocket::Send( const char *data, std::size_t size ) -{ - impl_->Send( data, size ); -} - -void UdpSocket::SendTo( const IpEndpointName& remoteEndpoint, const char *data, std::size_t size ) -{ - impl_->SendTo( remoteEndpoint, data, size ); -} - -void UdpSocket::Bind( const IpEndpointName& localEndpoint ) -{ - impl_->Bind( localEndpoint ); -} - -bool UdpSocket::IsBound() const -{ - return impl_->IsBound(); -} - -std::size_t UdpSocket::ReceiveFrom( IpEndpointName& remoteEndpoint, char *data, std::size_t size ) -{ - return impl_->ReceiveFrom( remoteEndpoint, data, size ); -} - - -struct AttachedTimerListener{ - AttachedTimerListener( int id, int p, TimerListener *tl ) - : initialDelayMs( id ) - , periodMs( p ) - , listener( tl ) {} - int initialDelayMs; - int periodMs; - TimerListener *listener; -}; - - -static bool CompareScheduledTimerCalls( - const std::pair< double, AttachedTimerListener > & lhs, const std::pair< double, AttachedTimerListener > & rhs ) -{ - return lhs.first < rhs.first; -} - - -SocketReceiveMultiplexer *multiplexerInstanceToAbortWithSigInt_ = 0; - -extern "C" /*static*/ void InterruptSignalHandler( int ); -/*static*/ void InterruptSignalHandler( int ) -{ - multiplexerInstanceToAbortWithSigInt_->AsynchronousBreak(); -#ifndef WINCE - signal( SIGINT, SIG_DFL ); -#endif -} - - -class SocketReceiveMultiplexer::Implementation{ - NetworkInitializer networkInitializer_; - - std::vector< std::pair< PacketListener*, UdpSocket* > > socketListeners_; - std::vector< AttachedTimerListener > timerListeners_; - - volatile bool break_; - HANDLE breakEvent_; - - double GetCurrentTimeMs() const - { -#ifndef WINCE - return timeGetTime(); // FIXME: bad choice if you want to run for more than 40 days -#else - return 0; -#endif - } - -public: - Implementation() - { - breakEvent_ = CreateEvent( NULL, FALSE, FALSE, NULL ); - } - - ~Implementation() - { - CloseHandle( breakEvent_ ); - } - - void AttachSocketListener( UdpSocket *socket, PacketListener *listener ) - { - assert( std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ) == socketListeners_.end() ); - // we don't check that the same socket has been added multiple times, even though this is an error - socketListeners_.push_back( std::make_pair( listener, socket ) ); - } - - void DetachSocketListener( UdpSocket *socket, PacketListener *listener ) - { - std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = - std::find( socketListeners_.begin(), socketListeners_.end(), std::make_pair(listener, socket) ); - assert( i != socketListeners_.end() ); - - socketListeners_.erase( i ); - } - - void AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ) - { - timerListeners_.push_back( AttachedTimerListener( periodMilliseconds, periodMilliseconds, listener ) ); - } - - void AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ) - { - timerListeners_.push_back( AttachedTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ) ); - } - - void DetachPeriodicTimerListener( TimerListener *listener ) - { - std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin(); - while( i != timerListeners_.end() ){ - if( i->listener == listener ) - break; - ++i; - } - - assert( i != timerListeners_.end() ); - - timerListeners_.erase( i ); - } - - void Run() - { - break_ = false; - - // prepare the window events which we use to wake up on incoming data - // we use this instead of select() primarily to support the AsyncBreak() - // mechanism. - - std::vector events( socketListeners_.size() + 1, 0 ); - int j=0; - for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin(); - i != socketListeners_.end(); ++i, ++j ){ - - HANDLE event = CreateEvent( NULL, FALSE, FALSE, NULL ); - WSAEventSelect( i->second->impl_->Socket(), event, FD_READ ); // note that this makes the socket non-blocking which is why we can safely call RecieveFrom() on all sockets below - events[j] = event; - } - - - events[ socketListeners_.size() ] = breakEvent_; // last event in the collection is the break event - - - // configure the timer queue - double currentTimeMs = GetCurrentTimeMs(); - - // expiry time ms, listener - std::vector< std::pair< double, AttachedTimerListener > > timerQueue_; - for( std::vector< AttachedTimerListener >::iterator i = timerListeners_.begin(); - i != timerListeners_.end(); ++i ) - timerQueue_.push_back( std::make_pair( currentTimeMs + i->initialDelayMs, *i ) ); - std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls ); - - const int MAX_BUFFER_SIZE = 4098; - char *data = new char[ MAX_BUFFER_SIZE ]; - IpEndpointName remoteEndpoint; - - while( !break_ ){ - - double currentTimeMs = GetCurrentTimeMs(); - - DWORD waitTime = INFINITE; - if( !timerQueue_.empty() ){ - - waitTime = (DWORD)( timerQueue_.front().first >= currentTimeMs - ? timerQueue_.front().first - currentTimeMs - : 0 ); - } - - DWORD waitResult = WaitForMultipleObjects( (DWORD)socketListeners_.size() + 1, &events[0], FALSE, waitTime ); - if( break_ ) - break; - - if( waitResult != WAIT_TIMEOUT ){ - for( int i = waitResult - WAIT_OBJECT_0; i < (int)socketListeners_.size(); ++i ){ - std::size_t size = socketListeners_[i].second->ReceiveFrom( remoteEndpoint, data, MAX_BUFFER_SIZE ); - if( size > 0 ){ - socketListeners_[i].first->ProcessPacket( data, (int)size, remoteEndpoint ); - if( break_ ) - break; - } - } - } - - // execute any expired timers - currentTimeMs = GetCurrentTimeMs(); - bool resort = false; - for( std::vector< std::pair< double, AttachedTimerListener > >::iterator i = timerQueue_.begin(); - i != timerQueue_.end() && i->first <= currentTimeMs; ++i ){ - - i->second.listener->TimerExpired(); - if( break_ ) - break; - - i->first += i->second.periodMs; - resort = true; - } - if( resort ) - std::sort( timerQueue_.begin(), timerQueue_.end(), CompareScheduledTimerCalls ); - } - - delete [] data; - - // free events - j = 0; - for( std::vector< std::pair< PacketListener*, UdpSocket* > >::iterator i = socketListeners_.begin(); - i != socketListeners_.end(); ++i, ++j ){ - - WSAEventSelect( i->second->impl_->Socket(), events[j], 0 ); // remove association between socket and event - CloseHandle( events[j] ); - unsigned long enableNonblocking = 0; - ioctlsocket( i->second->impl_->Socket(), FIONBIO, &enableNonblocking ); // make the socket blocking again - } - } - - void Break() - { - break_ = true; - } - - void AsynchronousBreak() - { - break_ = true; - SetEvent( breakEvent_ ); - } -}; - - - -SocketReceiveMultiplexer::SocketReceiveMultiplexer() -{ - impl_ = new Implementation(); -} - -SocketReceiveMultiplexer::~SocketReceiveMultiplexer() -{ - delete impl_; -} - -void SocketReceiveMultiplexer::AttachSocketListener( UdpSocket *socket, PacketListener *listener ) -{ - impl_->AttachSocketListener( socket, listener ); -} - -void SocketReceiveMultiplexer::DetachSocketListener( UdpSocket *socket, PacketListener *listener ) -{ - impl_->DetachSocketListener( socket, listener ); -} - -void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int periodMilliseconds, TimerListener *listener ) -{ - impl_->AttachPeriodicTimerListener( periodMilliseconds, listener ); -} - -void SocketReceiveMultiplexer::AttachPeriodicTimerListener( int initialDelayMilliseconds, int periodMilliseconds, TimerListener *listener ) -{ - impl_->AttachPeriodicTimerListener( initialDelayMilliseconds, periodMilliseconds, listener ); -} - -void SocketReceiveMultiplexer::DetachPeriodicTimerListener( TimerListener *listener ) -{ - impl_->DetachPeriodicTimerListener( listener ); -} - -void SocketReceiveMultiplexer::Run() -{ - impl_->Run(); -} - -void SocketReceiveMultiplexer::RunUntilSigInt() -{ - assert( multiplexerInstanceToAbortWithSigInt_ == 0 ); /* at present we support only one multiplexer instance running until sig int */ - multiplexerInstanceToAbortWithSigInt_ = this; -#ifndef WINCE - signal( SIGINT, InterruptSignalHandler ); -#endif - impl_->Run(); -#ifndef WINCE - signal( SIGINT, SIG_DFL ); -#endif - multiplexerInstanceToAbortWithSigInt_ = 0; -} - -void SocketReceiveMultiplexer::Break() -{ - impl_->Break(); -} - -void SocketReceiveMultiplexer::AsynchronousBreak() -{ - impl_->AsynchronousBreak(); -} - diff --git a/ext/osc/osc/MessageMappingOscPacketListener.h b/ext/osc/osc/MessageMappingOscPacketListener.h deleted file mode 100644 index bf56b530a2..0000000000 --- a/ext/osc/osc/MessageMappingOscPacketListener.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H -#define INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H - -#include -#include - -#include "OscPacketListener.h" - - - -namespace osc{ - -template< class T > -class MessageMappingOscPacketListener : public OscPacketListener{ -public: - typedef void (T::*function_type)(const osc::ReceivedMessage&, const IpEndpointName&); - -protected: - void RegisterMessageFunction( const char *addressPattern, function_type f ) - { - functions_.insert( std::make_pair( addressPattern, f ) ); - } - - virtual void ProcessMessage( const osc::ReceivedMessage& m, - const IpEndpointName& remoteEndpoint ) - { - typename function_map_type::iterator i = functions_.find( m.AddressPattern() ); - if( i != functions_.end() ) - (dynamic_cast(this)->*(i->second))( m, remoteEndpoint ); - } - -private: - struct cstr_compare{ - bool operator()( const char *lhs, const char *rhs ) const - { return std::strcmp( lhs, rhs ) < 0; } - }; - - typedef std::map function_map_type; - function_map_type functions_; -}; - -} // namespace osc - -#endif /* INCLUDED_OSCPACK_MESSAGEMAPPINGOSCPACKETLISTENER_H */ \ No newline at end of file diff --git a/ext/osc/osc/OscException.h b/ext/osc/osc/OscException.h deleted file mode 100644 index 73981737e0..0000000000 --- a/ext/osc/osc/OscException.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_OSCEXCEPTION_H -#define INCLUDED_OSCPACK_OSCEXCEPTION_H - -#include - -namespace osc{ - -class Exception : public std::exception { - const char *what_; - -public: - Exception() throw() {} - Exception( const Exception& src ) throw() - : std::exception( src ) - , what_( src.what_ ) {} - Exception( const char *w ) throw() - : what_( w ) {} - Exception& operator=( const Exception& src ) throw() - { what_ = src.what_; return *this; } - virtual ~Exception() throw() {} - virtual const char* what() const throw() { return what_; } -}; - -} // namespace osc - -#endif /* INCLUDED_OSCPACK_OSCEXCEPTION_H */ diff --git a/ext/osc/osc/OscHostEndianness.h b/ext/osc/osc/OscHostEndianness.h deleted file mode 100644 index 4682c473a5..0000000000 --- a/ext/osc/osc/OscHostEndianness.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H -#define INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H - -/* - Make sure either OSC_HOST_LITTLE_ENDIAN or OSC_HOST_BIG_ENDIAN is defined - - We try to use preprocessor symbols to deduce the host endianness. - - Alternatively you can define one of the above symbols from the command line. - Usually you do this with the -D flag to the compiler. e.g.: - - $ g++ -DOSC_HOST_LITTLE_ENDIAN ... -*/ - -#if defined(OSC_HOST_LITTLE_ENDIAN) || defined(OSC_HOST_BIG_ENDIAN) - -// endianness defined on the command line. nothing to do here. - -#elif defined(__WIN32__) || defined(WIN32) || defined(WINCE) - -// assume that __WIN32__ is only defined on little endian systems - -#define OSC_HOST_LITTLE_ENDIAN 1 -#undef OSC_HOST_BIG_ENDIAN - -#elif defined(__APPLE__) - -#if defined(__LITTLE_ENDIAN__) - -#define OSC_HOST_LITTLE_ENDIAN 1 -#undef OSC_HOST_BIG_ENDIAN - -#elif defined(__BIG_ENDIAN__) - -#define OSC_HOST_BIG_ENDIAN 1 -#undef OSC_HOST_LITTLE_ENDIAN - -#endif - -#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) - -// should cover gcc and clang - -#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) - -#define OSC_HOST_LITTLE_ENDIAN 1 -#undef OSC_HOST_BIG_ENDIAN - -#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) - -#define OSC_HOST_BIG_ENDIAN 1 -#undef OSC_HOST_LITTLE_ENDIAN - -#endif - -#else - -// gcc defines __LITTLE_ENDIAN__ and __BIG_ENDIAN__ -// for others used here see http://sourceforge.net/p/predef/wiki/Endianness/ -#if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) \ - || (defined(__ARMEL__) && !defined(__ARMEB__)) \ - || (defined(__AARCH64EL__) && !defined(__AARCH64EB__)) \ - || (defined(_MIPSEL) && !defined(_MIPSEB)) \ - || (defined(__MIPSEL) && !defined(__MIPSEB)) \ - || (defined(__MIPSEL__) && !defined(__MIPSEB__)) - -#define OSC_HOST_LITTLE_ENDIAN 1 -#undef OSC_HOST_BIG_ENDIAN - -#elif (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) \ - || (defined(__ARMEB__) && !defined(__ARMEL__)) \ - || (defined(__AARCH64EB__) && !defined(__AARCH64EL__)) \ - || (defined(_MIPSEB) && !defined(_MIPSEL)) \ - || (defined(__MIPSEB) && !defined(__MIPSEL)) \ - || (defined(__MIPSEB__) && !defined(__MIPSEL__)) - -#define OSC_HOST_BIG_ENDIAN 1 -#undef OSC_HOST_LITTLE_ENDIAN - -#endif - -#endif - -#if !defined(OSC_HOST_LITTLE_ENDIAN) && !defined(OSC_HOST_BIG_ENDIAN) - -#error please edit OSCHostEndianness.h or define one of {OSC_HOST_LITTLE_ENDIAN, OSC_HOST_BIG_ENDIAN} to configure endianness - -#endif - -#endif /* INCLUDED_OSCPACK_OSCHOSTENDIANNESS_H */ - diff --git a/ext/osc/osc/OscOutboundPacketStream.cpp b/ext/osc/osc/OscOutboundPacketStream.cpp deleted file mode 100644 index b474b4f01a..0000000000 --- a/ext/osc/osc/OscOutboundPacketStream.cpp +++ /dev/null @@ -1,683 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#include "OscOutboundPacketStream.h" - -#if defined(__WIN32__) || defined(WIN32) || defined(_WIN32) -#include // for alloca -#else -//#include // alloca on Linux (also OSX) -#include // alloca on OSX and FreeBSD (and Linux?) -#endif - -#include -#include // memcpy, memmove, strcpy, strlen -#include // ptrdiff_t - -#include "OscHostEndianness.h" - -#if defined(__BORLANDC__) // workaround for BCB4 release build intrinsics bug -namespace std { -using ::__strcpy__; // avoid error: E2316 '__strcpy__' is not a member of 'std'. -} -#endif - -namespace osc{ - -static void FromInt32( char *p, int32 x ) -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::int32 i; - char c[4]; - } u; - - u.i = x; - - p[3] = u.c[0]; - p[2] = u.c[1]; - p[1] = u.c[2]; - p[0] = u.c[3]; -#else - *reinterpret_cast(p) = x; -#endif -} - - -static void FromUInt32( char *p, uint32 x ) -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::uint32 i; - char c[4]; - } u; - - u.i = x; - - p[3] = u.c[0]; - p[2] = u.c[1]; - p[1] = u.c[2]; - p[0] = u.c[3]; -#else - *reinterpret_cast(p) = x; -#endif -} - - -static void FromInt64( char *p, int64 x ) -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::int64 i; - char c[8]; - } u; - - u.i = x; - - p[7] = u.c[0]; - p[6] = u.c[1]; - p[5] = u.c[2]; - p[4] = u.c[3]; - p[3] = u.c[4]; - p[2] = u.c[5]; - p[1] = u.c[6]; - p[0] = u.c[7]; -#else - *reinterpret_cast(p) = x; -#endif -} - - -static void FromUInt64( char *p, uint64 x ) -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::uint64 i; - char c[8]; - } u; - - u.i = x; - - p[7] = u.c[0]; - p[6] = u.c[1]; - p[5] = u.c[2]; - p[4] = u.c[3]; - p[3] = u.c[4]; - p[2] = u.c[5]; - p[1] = u.c[6]; - p[0] = u.c[7]; -#else - *reinterpret_cast(p) = x; -#endif -} - - -// round up to the next highest multiple of 4. unless x is already a multiple of 4 -static inline std::size_t RoundUp4( std::size_t x ) -{ - return (x + 3) & ~((std::size_t)0x03); -} - - -OutboundPacketStream::OutboundPacketStream( char *buffer, std::size_t capacity ) - : data_( buffer ) - , end_( data_ + capacity ) - , typeTagsCurrent_( end_ ) - , messageCursor_( data_ ) - , argumentCurrent_( data_ ) - , elementSizePtr_( 0 ) - , messageIsInProgress_( false ) -{ - // sanity check integer types declared in OscTypes.h - // you'll need to fix OscTypes.h if any of these asserts fail - assert( sizeof(osc::int32) == 4 ); - assert( sizeof(osc::uint32) == 4 ); - assert( sizeof(osc::int64) == 8 ); - assert( sizeof(osc::uint64) == 8 ); -} - - -OutboundPacketStream::~OutboundPacketStream() -{ - -} - - -char *OutboundPacketStream::BeginElement( char *beginPtr ) -{ - if( elementSizePtr_ == 0 ){ - - elementSizePtr_ = reinterpret_cast(data_); - - return beginPtr; - - }else{ - // store an offset to the old element size ptr in the element size slot - // we store an offset rather than the actual pointer to be 64 bit clean. - *reinterpret_cast(beginPtr) = - (uint32)(reinterpret_cast(elementSizePtr_) - data_); - - elementSizePtr_ = reinterpret_cast(beginPtr); - - return beginPtr + 4; - } -} - - -void OutboundPacketStream::EndElement( char *endPtr ) -{ - assert( elementSizePtr_ != 0 ); - - if( elementSizePtr_ == reinterpret_cast(data_) ){ - - elementSizePtr_ = 0; - - }else{ - // while building an element, an offset to the containing element's - // size slot is stored in the elements size slot (or a ptr to data_ - // if there is no containing element). We retrieve that here - uint32 *previousElementSizePtr = - reinterpret_cast(data_ + *elementSizePtr_); - - // then we store the element size in the slot. note that the element - // size does not include the size slot, hence the - 4 below. - - std::ptrdiff_t d = endPtr - reinterpret_cast(elementSizePtr_); - // assert( d >= 4 && d <= 0x7FFFFFFF ); // assume packets smaller than 2Gb - - uint32 elementSize = static_cast(d - 4); - FromUInt32( reinterpret_cast(elementSizePtr_), elementSize ); - - // finally, we reset the element size ptr to the containing element - elementSizePtr_ = previousElementSizePtr; - } -} - - -bool OutboundPacketStream::ElementSizeSlotRequired() const -{ - return (elementSizePtr_ != 0); -} - - -void OutboundPacketStream::CheckForAvailableBundleSpace() -{ - std::size_t required = Size() + ((ElementSizeSlotRequired())?4:0) + 16; - - if( required > Capacity() ) - throw OutOfBufferMemoryException(); -} - - -void OutboundPacketStream::CheckForAvailableMessageSpace( const char *addressPattern ) -{ - // plus 4 for at least four bytes of type tag - std::size_t required = Size() + ((ElementSizeSlotRequired())?4:0) - + RoundUp4(std::strlen(addressPattern) + 1) + 4; - - if( required > Capacity() ) - throw OutOfBufferMemoryException(); -} - - -void OutboundPacketStream::CheckForAvailableArgumentSpace( std::size_t argumentLength ) -{ - // plus three for extra type tag, comma and null terminator - std::size_t required = (argumentCurrent_ - data_) + argumentLength - + RoundUp4( (end_ - typeTagsCurrent_) + 3 ); - - if( required > Capacity() ) - throw OutOfBufferMemoryException(); -} - - -void OutboundPacketStream::Clear() -{ - typeTagsCurrent_ = end_; - messageCursor_ = data_; - argumentCurrent_ = data_; - elementSizePtr_ = 0; - messageIsInProgress_ = false; -} - - -std::size_t OutboundPacketStream::Capacity() const -{ - return end_ - data_; -} - - -std::size_t OutboundPacketStream::Size() const -{ - std::size_t result = argumentCurrent_ - data_; - if( IsMessageInProgress() ){ - // account for the length of the type tag string. the total type tag - // includes an initial comma, plus at least one terminating \0 - result += RoundUp4( (end_ - typeTagsCurrent_) + 2 ); - } - - return result; -} - - -const char *OutboundPacketStream::Data() const -{ - return data_; -} - - -bool OutboundPacketStream::IsReady() const -{ - return (!IsMessageInProgress() && !IsBundleInProgress()); -} - - -bool OutboundPacketStream::IsMessageInProgress() const -{ - return messageIsInProgress_; -} - - -bool OutboundPacketStream::IsBundleInProgress() const -{ - return (elementSizePtr_ != 0); -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const BundleInitiator& rhs ) -{ - if( IsMessageInProgress() ) - throw MessageInProgressException(); - - CheckForAvailableBundleSpace(); - - messageCursor_ = BeginElement( messageCursor_ ); - - std::memcpy( messageCursor_, "#bundle\0", 8 ); - FromUInt64( messageCursor_ + 8, rhs.timeTag ); - - messageCursor_ += 16; - argumentCurrent_ = messageCursor_; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const BundleTerminator& rhs ) -{ - (void) rhs; - - if( !IsBundleInProgress() ) - throw BundleNotInProgressException(); - if( IsMessageInProgress() ) - throw MessageInProgressException(); - - EndElement( messageCursor_ ); - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const BeginMessage& rhs ) -{ - if( IsMessageInProgress() ) - throw MessageInProgressException(); - - CheckForAvailableMessageSpace( rhs.addressPattern ); - - messageCursor_ = BeginElement( messageCursor_ ); - - std::strcpy( messageCursor_, rhs.addressPattern ); - std::size_t rhsLength = std::strlen(rhs.addressPattern); - messageCursor_ += rhsLength + 1; - - // zero pad to 4-byte boundary - std::size_t i = rhsLength + 1; - while( i & 0x3 ){ - *messageCursor_++ = '\0'; - ++i; - } - - argumentCurrent_ = messageCursor_; - typeTagsCurrent_ = end_; - - messageIsInProgress_ = true; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const MessageTerminator& rhs ) -{ - (void) rhs; - - if( !IsMessageInProgress() ) - throw MessageNotInProgressException(); - - std::size_t typeTagsCount = end_ - typeTagsCurrent_; - - if( typeTagsCount ){ - - char *tempTypeTags = (char*)alloca(typeTagsCount); - std::memcpy( tempTypeTags, typeTagsCurrent_, typeTagsCount ); - - // slot size includes comma and null terminator - std::size_t typeTagSlotSize = RoundUp4( typeTagsCount + 2 ); - - std::size_t argumentsSize = argumentCurrent_ - messageCursor_; - - std::memmove( messageCursor_ + typeTagSlotSize, messageCursor_, argumentsSize ); - - messageCursor_[0] = ','; - // copy type tags in reverse (really forward) order - for( std::size_t i=0; i < typeTagsCount; ++i ) - messageCursor_[i+1] = tempTypeTags[ (typeTagsCount-1) - i ]; - - char *p = messageCursor_ + 1 + typeTagsCount; - for( std::size_t i=0; i < (typeTagSlotSize - (typeTagsCount + 1)); ++i ) - *p++ = '\0'; - - typeTagsCurrent_ = end_; - - // advance messageCursor_ for next message - messageCursor_ += typeTagSlotSize + argumentsSize; - - }else{ - // send an empty type tags string - std::memcpy( messageCursor_, ",\0\0\0", 4 ); - - // advance messageCursor_ for next message - messageCursor_ += 4; - } - - argumentCurrent_ = messageCursor_; - - EndElement( messageCursor_ ); - - messageIsInProgress_ = false; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( bool rhs ) -{ - CheckForAvailableArgumentSpace(0); - - *(--typeTagsCurrent_) = (char)((rhs) ? TRUE_TYPE_TAG : FALSE_TYPE_TAG); - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const NilType& rhs ) -{ - (void) rhs; - CheckForAvailableArgumentSpace(0); - - *(--typeTagsCurrent_) = NIL_TYPE_TAG; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const InfinitumType& rhs ) -{ - (void) rhs; - CheckForAvailableArgumentSpace(0); - - *(--typeTagsCurrent_) = INFINITUM_TYPE_TAG; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( int32 rhs ) -{ - CheckForAvailableArgumentSpace(4); - - *(--typeTagsCurrent_) = INT32_TYPE_TAG; - FromInt32( argumentCurrent_, rhs ); - argumentCurrent_ += 4; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( float rhs ) -{ - CheckForAvailableArgumentSpace(4); - - *(--typeTagsCurrent_) = FLOAT_TYPE_TAG; - -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - float f; - char c[4]; - } u; - - u.f = rhs; - - argumentCurrent_[3] = u.c[0]; - argumentCurrent_[2] = u.c[1]; - argumentCurrent_[1] = u.c[2]; - argumentCurrent_[0] = u.c[3]; -#else - *reinterpret_cast(argumentCurrent_) = rhs; -#endif - - argumentCurrent_ += 4; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( char rhs ) -{ - CheckForAvailableArgumentSpace(4); - - *(--typeTagsCurrent_) = CHAR_TYPE_TAG; - FromInt32( argumentCurrent_, rhs ); - argumentCurrent_ += 4; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const RgbaColor& rhs ) -{ - CheckForAvailableArgumentSpace(4); - - *(--typeTagsCurrent_) = RGBA_COLOR_TYPE_TAG; - FromUInt32( argumentCurrent_, rhs ); - argumentCurrent_ += 4; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const MidiMessage& rhs ) -{ - CheckForAvailableArgumentSpace(4); - - *(--typeTagsCurrent_) = MIDI_MESSAGE_TYPE_TAG; - FromUInt32( argumentCurrent_, rhs ); - argumentCurrent_ += 4; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( int64 rhs ) -{ - CheckForAvailableArgumentSpace(8); - - *(--typeTagsCurrent_) = INT64_TYPE_TAG; - FromInt64( argumentCurrent_, rhs ); - argumentCurrent_ += 8; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const TimeTag& rhs ) -{ - CheckForAvailableArgumentSpace(8); - - *(--typeTagsCurrent_) = TIME_TAG_TYPE_TAG; - FromUInt64( argumentCurrent_, rhs ); - argumentCurrent_ += 8; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( double rhs ) -{ - CheckForAvailableArgumentSpace(8); - - *(--typeTagsCurrent_) = DOUBLE_TYPE_TAG; - -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - double f; - char c[8]; - } u; - - u.f = rhs; - - argumentCurrent_[7] = u.c[0]; - argumentCurrent_[6] = u.c[1]; - argumentCurrent_[5] = u.c[2]; - argumentCurrent_[4] = u.c[3]; - argumentCurrent_[3] = u.c[4]; - argumentCurrent_[2] = u.c[5]; - argumentCurrent_[1] = u.c[6]; - argumentCurrent_[0] = u.c[7]; -#else - *reinterpret_cast(argumentCurrent_) = rhs; -#endif - - argumentCurrent_ += 8; - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const char *rhs ) -{ - CheckForAvailableArgumentSpace( RoundUp4(std::strlen(rhs) + 1) ); - - *(--typeTagsCurrent_) = STRING_TYPE_TAG; - std::strcpy( argumentCurrent_, rhs ); - std::size_t rhsLength = std::strlen(rhs); - argumentCurrent_ += rhsLength + 1; - - // zero pad to 4-byte boundary - std::size_t i = rhsLength + 1; - while( i & 0x3 ){ - *argumentCurrent_++ = '\0'; - ++i; - } - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const Symbol& rhs ) -{ - CheckForAvailableArgumentSpace( RoundUp4(std::strlen(rhs) + 1) ); - - *(--typeTagsCurrent_) = SYMBOL_TYPE_TAG; - std::strcpy( argumentCurrent_, rhs ); - std::size_t rhsLength = std::strlen(rhs); - argumentCurrent_ += rhsLength + 1; - - // zero pad to 4-byte boundary - std::size_t i = rhsLength + 1; - while( i & 0x3 ){ - *argumentCurrent_++ = '\0'; - ++i; - } - - return *this; -} - - -OutboundPacketStream& OutboundPacketStream::operator<<( const Blob& rhs ) -{ - CheckForAvailableArgumentSpace( 4 + RoundUp4(rhs.size) ); - - *(--typeTagsCurrent_) = BLOB_TYPE_TAG; - FromUInt32( argumentCurrent_, rhs.size ); - argumentCurrent_ += 4; - - std::memcpy( argumentCurrent_, rhs.data, rhs.size ); - argumentCurrent_ += rhs.size; - - // zero pad to 4-byte boundary - unsigned long i = rhs.size; - while( i & 0x3 ){ - *argumentCurrent_++ = '\0'; - ++i; - } - - return *this; -} - -OutboundPacketStream& OutboundPacketStream::operator<<( const ArrayInitiator& rhs ) -{ - (void) rhs; - CheckForAvailableArgumentSpace(0); - - *(--typeTagsCurrent_) = ARRAY_BEGIN_TYPE_TAG; - - return *this; -} - -OutboundPacketStream& OutboundPacketStream::operator<<( const ArrayTerminator& rhs ) -{ - (void) rhs; - CheckForAvailableArgumentSpace(0); - - *(--typeTagsCurrent_) = ARRAY_END_TYPE_TAG; - - return *this; -} - -} // namespace osc - - diff --git a/ext/osc/osc/OscOutboundPacketStream.h b/ext/osc/osc/OscOutboundPacketStream.h deleted file mode 100644 index d0afe95421..0000000000 --- a/ext/osc/osc/OscOutboundPacketStream.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_OSCOUTBOUNDPACKETSTREAM_H -#define INCLUDED_OSCPACK_OSCOUTBOUNDPACKETSTREAM_H - -#include // size_t - -#include "OscTypes.h" -#include "OscException.h" - - -namespace osc{ - -class OutOfBufferMemoryException : public Exception{ -public: - OutOfBufferMemoryException( const char *w="out of buffer memory" ) - : Exception( w ) {} -}; - -class BundleNotInProgressException : public Exception{ -public: - BundleNotInProgressException( - const char *w="call to EndBundle when bundle is not in progress" ) - : Exception( w ) {} -}; - -class MessageInProgressException : public Exception{ -public: - MessageInProgressException( - const char *w="opening or closing bundle or message while message is in progress" ) - : Exception( w ) {} -}; - -class MessageNotInProgressException : public Exception{ -public: - MessageNotInProgressException( - const char *w="call to EndMessage when message is not in progress" ) - : Exception( w ) {} -}; - - -class OutboundPacketStream{ -public: - OutboundPacketStream() = default; - OutboundPacketStream( char *buffer, std::size_t capacity ); - ~OutboundPacketStream(); - - void Clear(); - - std::size_t Capacity() const; - - // invariant: size() is valid even while building a message. - std::size_t Size() const; - - const char *Data() const; - - // indicates that all messages have been closed with a matching EndMessage - // and all bundles have been closed with a matching EndBundle - bool IsReady() const; - - bool IsMessageInProgress() const; - bool IsBundleInProgress() const; - - OutboundPacketStream& operator<<( const BundleInitiator& rhs ); - OutboundPacketStream& operator<<( const BundleTerminator& rhs ); - - OutboundPacketStream& operator<<( const BeginMessage& rhs ); - OutboundPacketStream& operator<<( const MessageTerminator& rhs ); - - OutboundPacketStream& operator<<( bool rhs ); - OutboundPacketStream& operator<<( const NilType& rhs ); - OutboundPacketStream& operator<<( const InfinitumType& rhs ); - OutboundPacketStream& operator<<( int32 rhs ); - -#if !(defined(__x86_64__) || defined(_M_X64)) - OutboundPacketStream& operator<<( int rhs ) - { *this << (int32)rhs; return *this; } -#endif - - OutboundPacketStream& operator<<( float rhs ); - OutboundPacketStream& operator<<( char rhs ); - OutboundPacketStream& operator<<( const RgbaColor& rhs ); - OutboundPacketStream& operator<<( const MidiMessage& rhs ); - OutboundPacketStream& operator<<( int64 rhs ); - OutboundPacketStream& operator<<( const TimeTag& rhs ); - OutboundPacketStream& operator<<( double rhs ); - OutboundPacketStream& operator<<( const char* rhs ); - OutboundPacketStream& operator<<( const Symbol& rhs ); - OutboundPacketStream& operator<<( const Blob& rhs ); - - OutboundPacketStream& operator<<( const ArrayInitiator& rhs ); - OutboundPacketStream& operator<<( const ArrayTerminator& rhs ); - -private: - - char *BeginElement( char *beginPtr ); - void EndElement( char *endPtr ); - - bool ElementSizeSlotRequired() const; - void CheckForAvailableBundleSpace(); - void CheckForAvailableMessageSpace( const char *addressPattern ); - void CheckForAvailableArgumentSpace( std::size_t argumentLength ); - - char *data_; - char *end_; - - char *typeTagsCurrent_; // stored in reverse order - char *messageCursor_; - char *argumentCurrent_; - - // elementSizePtr_ has two special values: 0 indicates that a bundle - // isn't open, and elementSizePtr_==data_ indicates that a bundle is - // open but that it doesn't have a size slot (ie the outermost bundle) - uint32 *elementSizePtr_; - - bool messageIsInProgress_; -}; - -} // namespace osc - -#endif /* INCLUDED_OSCPACK_OSCOUTBOUNDPACKETSTREAM_H */ diff --git a/ext/osc/osc/OscPacketListener.h b/ext/osc/osc/OscPacketListener.h deleted file mode 100644 index 472cb1066f..0000000000 --- a/ext/osc/osc/OscPacketListener.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_OSCPACKETLISTENER_H -#define INCLUDED_OSCPACK_OSCPACKETLISTENER_H - -#include "OscReceivedElements.h" -#include "../ip/PacketListener.h" - - -namespace osc{ - -class OscPacketListener : public PacketListener{ -protected: - virtual void ProcessBundle( const osc::ReceivedBundle& b, - const IpEndpointName& remoteEndpoint ) - { - // ignore bundle time tag for now - - for( ReceivedBundle::const_iterator i = b.ElementsBegin(); - i != b.ElementsEnd(); ++i ){ - if( i->IsBundle() ) - ProcessBundle( ReceivedBundle(*i), remoteEndpoint ); - else - ProcessMessage( ReceivedMessage(*i), remoteEndpoint ); - } - } - - virtual void ProcessMessage( const osc::ReceivedMessage& m, - const IpEndpointName& remoteEndpoint ) = 0; - -public: - virtual void ProcessPacket( const char *data, int size, - const IpEndpointName& remoteEndpoint ) - { - osc::ReceivedPacket p( data, size ); - if( p.IsBundle() ) - ProcessBundle( ReceivedBundle(p), remoteEndpoint ); - else - ProcessMessage( ReceivedMessage(p), remoteEndpoint ); - } -}; - -} // namespace osc - -#endif /* INCLUDED_OSCPACK_OSCPACKETLISTENER_H */ diff --git a/ext/osc/osc/OscPrintReceivedElements.cpp b/ext/osc/osc/OscPrintReceivedElements.cpp deleted file mode 100644 index bc1689bc1d..0000000000 --- a/ext/osc/osc/OscPrintReceivedElements.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#include "OscPrintReceivedElements.h" - -#include -#include -#include -#include - -#if defined(__BORLANDC__) // workaround for BCB4 release build intrinsics bug -namespace std { -using ::__strcpy__; // avoid error: E2316 '__strcpy__' is not a member of 'std'. -} -#endif - -namespace osc{ - - -std::ostream& operator<<( std::ostream & os, - const ReceivedMessageArgument& arg ) -{ - switch( arg.TypeTag() ){ - case TRUE_TYPE_TAG: - os << "bool:true"; - break; - - case FALSE_TYPE_TAG: - os << "bool:false"; - break; - - case NIL_TYPE_TAG: - os << "(Nil)"; - break; - - case INFINITUM_TYPE_TAG: - os << "(Infinitum)"; - break; - - case INT32_TYPE_TAG: - os << "int32:" << arg.AsInt32Unchecked(); - break; - - case FLOAT_TYPE_TAG: - os << "float32:" << arg.AsFloatUnchecked(); - break; - - case CHAR_TYPE_TAG: - { - char s[2] = {0}; - s[0] = arg.AsCharUnchecked(); - os << "char:'" << s << "'"; - } - break; - - case RGBA_COLOR_TYPE_TAG: - { - uint32 color = arg.AsRgbaColorUnchecked(); - - os << "RGBA:0x" - << std::hex << std::setfill('0') - << std::setw(2) << (int)((color>>24) & 0xFF) - << std::setw(2) << (int)((color>>16) & 0xFF) - << std::setw(2) << (int)((color>>8) & 0xFF) - << std::setw(2) << (int)(color & 0xFF) - << std::setfill(' '); - os.unsetf(std::ios::basefield); - } - break; - - case MIDI_MESSAGE_TYPE_TAG: - { - uint32 m = arg.AsMidiMessageUnchecked(); - os << "midi (port, status, data1, data2):<<" - << std::hex << std::setfill('0') - << "0x" << std::setw(2) << (int)((m>>24) & 0xFF) - << " 0x" << std::setw(2) << (int)((m>>16) & 0xFF) - << " 0x" << std::setw(2) << (int)((m>>8) & 0xFF) - << " 0x" << std::setw(2) << (int)(m & 0xFF) - << std::setfill(' ') << ">>"; - os.unsetf(std::ios::basefield); - } - break; - - case INT64_TYPE_TAG: - os << "int64:" << arg.AsInt64Unchecked(); - break; - - case TIME_TAG_TYPE_TAG: - { - os << "OSC-timetag:" << arg.AsTimeTagUnchecked() << " "; - - std::time_t t = - (unsigned long)( arg.AsTimeTagUnchecked() >> 32 ); - - const char *timeString = std::ctime( &t ); - size_t len = std::strlen( timeString ); - - // -1 to omit trailing newline from string returned by ctime() - if( len > 1 ) - os.write( timeString, len - 1 ); - } - break; - - case DOUBLE_TYPE_TAG: - os << "double:" << arg.AsDoubleUnchecked(); - break; - - case STRING_TYPE_TAG: - os << "OSC-string:`" << arg.AsStringUnchecked() << "'"; - break; - - case SYMBOL_TYPE_TAG: - os << "OSC-string (symbol):`" << arg.AsSymbolUnchecked() << "'"; - break; - - case BLOB_TYPE_TAG: - { - const void *data; - osc_bundle_element_size_t size; - arg.AsBlobUnchecked( data, size ); - os << "OSC-blob:<<" << std::hex << std::setfill('0'); - unsigned char *p = (unsigned char*)data; - for( osc_bundle_element_size_t i = 0; i < size; ++i ){ - os << "0x" << std::setw(2) << int(p[i]); - if( i != size-1 ) - os << ' '; - } - os.unsetf(std::ios::basefield); - os << ">>" << std::setfill(' '); - } - break; - - case ARRAY_BEGIN_TYPE_TAG: - os << "["; - break; - - case ARRAY_END_TYPE_TAG: - os << "]"; - break; - - default: - os << "unknown"; - } - - return os; -} - - -std::ostream& operator<<( std::ostream & os, const ReceivedMessage& m ) -{ - os << "["; - if( m.AddressPatternIsUInt32() ) - os << m.AddressPatternAsUInt32(); - else - os << m.AddressPattern(); - - bool first = true; - for( ReceivedMessage::const_iterator i = m.ArgumentsBegin(); - i != m.ArgumentsEnd(); ++i ){ - if( first ){ - os << " "; - first = false; - }else{ - os << ", "; - } - - os << *i; - } - - os << "]"; - - return os; -} - - -std::ostream& operator<<( std::ostream & os, const ReceivedBundle& b ) -{ - static int indent = 0; - - for( int j=0; j < indent; ++j ) - os << " "; - os << "{ ( "; - if( b.TimeTag() == 1 ) - os << "immediate"; - else - os << b.TimeTag(); - os << " )\n"; - - ++indent; - - for( ReceivedBundle::const_iterator i = b.ElementsBegin(); - i != b.ElementsEnd(); ++i ){ - if( i->IsBundle() ){ - ReceivedBundle b(*i); - os << b << "\n"; - }else{ - ReceivedMessage m(*i); - for( int j=0; j < indent; ++j ) - os << " "; - os << m << "\n"; - } - } - - --indent; - - for( int j=0; j < indent; ++j ) - os << " "; - os << "}"; - - return os; -} - - -std::ostream& operator<<( std::ostream & os, const ReceivedPacket& p ) -{ - if( p.IsBundle() ){ - ReceivedBundle b(p); - os << b << "\n"; - }else{ - ReceivedMessage m(p); - os << m << "\n"; - } - - return os; -} - -} // namespace osc diff --git a/ext/osc/osc/OscPrintReceivedElements.h b/ext/osc/osc/OscPrintReceivedElements.h deleted file mode 100644 index 8d71391f0c..0000000000 --- a/ext/osc/osc/OscPrintReceivedElements.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H -#define INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H - -#include - -#include "OscReceivedElements.h" - - -namespace osc{ - -std::ostream& operator<<( std::ostream & os, const ReceivedPacket& p ); -std::ostream& operator<<( std::ostream & os, const ReceivedMessageArgument& arg ); -std::ostream& operator<<( std::ostream & os, const ReceivedMessage& m ); -std::ostream& operator<<( std::ostream & os, const ReceivedBundle& b ); - -} // namespace osc - -#endif /* INCLUDED_OSCPACK_OSCPRINTRECEIVEDELEMENTS_H */ diff --git a/ext/osc/osc/OscReceivedElements.cpp b/ext/osc/osc/OscReceivedElements.cpp deleted file mode 100644 index 1d57d3740a..0000000000 --- a/ext/osc/osc/OscReceivedElements.cpp +++ /dev/null @@ -1,796 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#include "OscReceivedElements.h" - -#include "OscHostEndianness.h" - -#include // ptrdiff_t - -namespace osc{ - - -// return the first 4 byte boundary after the end of a str4 -// be careful about calling this version if you don't know whether -// the string is terminated correctly. -static inline const char* FindStr4End( const char *p ) -{ - if( p[0] == '\0' ) // special case for SuperCollider integer address pattern - return p + 4; - - p += 3; - - while( *p ) - p += 4; - - return p + 1; -} - - -// return the first 4 byte boundary after the end of a str4 -// returns 0 if p == end or if the string is unterminated -static inline const char* FindStr4End( const char *p, const char *end ) -{ - if( p >= end ) - return 0; - - if( p[0] == '\0' ) // special case for SuperCollider integer address pattern - return p + 4; - - p += 3; - end -= 1; - - while( p < end && *p ) - p += 4; - - if( *p ) - return 0; - else - return p + 1; -} - - -// round up to the next highest multiple of 4. unless x is already a multiple of 4 -static inline uint32 RoundUp4( uint32 x ) -{ - return (x + 3) & ~((uint32)0x03); -} - - -static inline int32 ToInt32( const char *p ) -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::int32 i; - char c[4]; - } u; - - u.c[0] = p[3]; - u.c[1] = p[2]; - u.c[2] = p[1]; - u.c[3] = p[0]; - - return u.i; -#else - return *(int32*)p; -#endif -} - - -static inline uint32 ToUInt32( const char *p ) -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::uint32 i; - char c[4]; - } u; - - u.c[0] = p[3]; - u.c[1] = p[2]; - u.c[2] = p[1]; - u.c[3] = p[0]; - - return u.i; -#else - return *(uint32*)p; -#endif -} - - -static inline int64 ToInt64( const char *p ) -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::int64 i; - char c[8]; - } u; - - u.c[0] = p[7]; - u.c[1] = p[6]; - u.c[2] = p[5]; - u.c[3] = p[4]; - u.c[4] = p[3]; - u.c[5] = p[2]; - u.c[6] = p[1]; - u.c[7] = p[0]; - - return u.i; -#else - return *(int64*)p; -#endif -} - - -static inline uint64 ToUInt64( const char *p ) -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::uint64 i; - char c[8]; - } u; - - u.c[0] = p[7]; - u.c[1] = p[6]; - u.c[2] = p[5]; - u.c[3] = p[4]; - u.c[4] = p[3]; - u.c[5] = p[2]; - u.c[6] = p[1]; - u.c[7] = p[0]; - - return u.i; -#else - return *(uint64*)p; -#endif -} - -//------------------------------------------------------------------------------ - -bool ReceivedPacket::IsBundle() const -{ - return (Size() > 0 && Contents()[0] == '#'); -} - -//------------------------------------------------------------------------------ - -bool ReceivedBundleElement::IsBundle() const -{ - return (Size() > 0 && Contents()[0] == '#'); -} - - -osc_bundle_element_size_t ReceivedBundleElement::Size() const -{ - return ToInt32( sizePtr_ ); -} - -//------------------------------------------------------------------------------ - -bool ReceivedMessageArgument::AsBool() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == TRUE_TYPE_TAG ) - return true; - else if( *typeTagPtr_ == FALSE_TYPE_TAG ) - return false; - else - throw WrongArgumentTypeException(); -} - - -bool ReceivedMessageArgument::AsBoolUnchecked() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == TRUE_TYPE_TAG ) - return true; - else - return false; -} - - -int32 ReceivedMessageArgument::AsInt32() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == INT32_TYPE_TAG ) - return AsInt32Unchecked(); - else - throw WrongArgumentTypeException(); -} - - -int32 ReceivedMessageArgument::AsInt32Unchecked() const -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - osc::int32 i; - char c[4]; - } u; - - u.c[0] = argumentPtr_[3]; - u.c[1] = argumentPtr_[2]; - u.c[2] = argumentPtr_[1]; - u.c[3] = argumentPtr_[0]; - - return u.i; -#else - return *(int32*)argument_; -#endif -} - - -float ReceivedMessageArgument::AsFloat() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == FLOAT_TYPE_TAG ) - return AsFloatUnchecked(); - else - throw WrongArgumentTypeException(); -} - - -float ReceivedMessageArgument::AsFloatUnchecked() const -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - float f; - char c[4]; - } u; - - u.c[0] = argumentPtr_[3]; - u.c[1] = argumentPtr_[2]; - u.c[2] = argumentPtr_[1]; - u.c[3] = argumentPtr_[0]; - - return u.f; -#else - return *(float*)argument_; -#endif -} - - -char ReceivedMessageArgument::AsChar() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == CHAR_TYPE_TAG ) - return AsCharUnchecked(); - else - throw WrongArgumentTypeException(); -} - - -char ReceivedMessageArgument::AsCharUnchecked() const -{ - return (char)ToInt32( argumentPtr_ ); -} - - -uint32 ReceivedMessageArgument::AsRgbaColor() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == RGBA_COLOR_TYPE_TAG ) - return AsRgbaColorUnchecked(); - else - throw WrongArgumentTypeException(); -} - - -uint32 ReceivedMessageArgument::AsRgbaColorUnchecked() const -{ - return ToUInt32( argumentPtr_ ); -} - - -uint32 ReceivedMessageArgument::AsMidiMessage() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == MIDI_MESSAGE_TYPE_TAG ) - return AsMidiMessageUnchecked(); - else - throw WrongArgumentTypeException(); -} - - -uint32 ReceivedMessageArgument::AsMidiMessageUnchecked() const -{ - return ToUInt32( argumentPtr_ ); -} - - -int64 ReceivedMessageArgument::AsInt64() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == INT64_TYPE_TAG ) - return AsInt64Unchecked(); - else - throw WrongArgumentTypeException(); -} - - -int64 ReceivedMessageArgument::AsInt64Unchecked() const -{ - return ToInt64( argumentPtr_ ); -} - - -uint64 ReceivedMessageArgument::AsTimeTag() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == TIME_TAG_TYPE_TAG ) - return AsTimeTagUnchecked(); - else - throw WrongArgumentTypeException(); -} - - -uint64 ReceivedMessageArgument::AsTimeTagUnchecked() const -{ - return ToUInt64( argumentPtr_ ); -} - - -double ReceivedMessageArgument::AsDouble() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == DOUBLE_TYPE_TAG ) - return AsDoubleUnchecked(); - else - throw WrongArgumentTypeException(); -} - - -double ReceivedMessageArgument::AsDoubleUnchecked() const -{ -#ifdef OSC_HOST_LITTLE_ENDIAN - union{ - double d; - char c[8]; - } u; - - u.c[0] = argumentPtr_[7]; - u.c[1] = argumentPtr_[6]; - u.c[2] = argumentPtr_[5]; - u.c[3] = argumentPtr_[4]; - u.c[4] = argumentPtr_[3]; - u.c[5] = argumentPtr_[2]; - u.c[6] = argumentPtr_[1]; - u.c[7] = argumentPtr_[0]; - - return u.d; -#else - return *(double*)argument_; -#endif -} - - -const char* ReceivedMessageArgument::AsString() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == STRING_TYPE_TAG ) - return argumentPtr_; - else - throw WrongArgumentTypeException(); -} - - -const char* ReceivedMessageArgument::AsSymbol() const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == SYMBOL_TYPE_TAG ) - return argumentPtr_; - else - throw WrongArgumentTypeException(); -} - - -void ReceivedMessageArgument::AsBlob( const void*& data, osc_bundle_element_size_t& size ) const -{ - if( !typeTagPtr_ ) - throw MissingArgumentException(); - else if( *typeTagPtr_ == BLOB_TYPE_TAG ) - AsBlobUnchecked( data, size ); - else - throw WrongArgumentTypeException(); -} - - -void ReceivedMessageArgument::AsBlobUnchecked( const void*& data, osc_bundle_element_size_t& size ) const -{ - // read blob size as an unsigned int then validate - osc_bundle_element_size_t sizeResult = (osc_bundle_element_size_t)ToUInt32( argumentPtr_ ); - if( !IsValidElementSizeValue(sizeResult) ) - throw MalformedMessageException("invalid blob size"); - - size = sizeResult; - data = (void*)(argumentPtr_+ osc::OSC_SIZEOF_INT32); -} - -std::size_t ReceivedMessageArgument::ComputeArrayItemCount() const -{ - // it is only valid to call ComputeArrayItemCount when the argument is the array start marker - if( !IsArrayBegin() ) - throw WrongArgumentTypeException(); - - std::size_t result = 0; - unsigned int level = 0; - const char *typeTag = typeTagPtr_ + 1; - - // iterate through all type tags. note that ReceivedMessage::Init - // has already checked that the message is well formed. - while( *typeTag ) { - switch( *typeTag++ ) { - case ARRAY_BEGIN_TYPE_TAG: - level += 1; - break; - - case ARRAY_END_TYPE_TAG: - if(level == 0) - return result; - level -= 1; - break; - - default: - if( level == 0 ) // only count items at level 0 - ++result; - } - } - - return result; -} - -//------------------------------------------------------------------------------ - -void ReceivedMessageArgumentIterator::Advance() -{ - if( !value_.typeTagPtr_ ) - return; - - switch( *value_.typeTagPtr_++ ){ - case '\0': - // don't advance past end - --value_.typeTagPtr_; - break; - - case TRUE_TYPE_TAG: - case FALSE_TYPE_TAG: - case NIL_TYPE_TAG: - case INFINITUM_TYPE_TAG: - - // zero length - break; - - case INT32_TYPE_TAG: - case FLOAT_TYPE_TAG: - case CHAR_TYPE_TAG: - case RGBA_COLOR_TYPE_TAG: - case MIDI_MESSAGE_TYPE_TAG: - - value_.argumentPtr_ += 4; - break; - - case INT64_TYPE_TAG: - case TIME_TAG_TYPE_TAG: - case DOUBLE_TYPE_TAG: - - value_.argumentPtr_ += 8; - break; - - case STRING_TYPE_TAG: - case SYMBOL_TYPE_TAG: - - // we use the unsafe function FindStr4End(char*) here because all of - // the arguments have already been validated in - // ReceivedMessage::Init() below. - - value_.argumentPtr_ = FindStr4End( value_.argumentPtr_ ); - break; - - case BLOB_TYPE_TAG: - { - // treat blob size as an unsigned int for the purposes of this calculation - uint32 blobSize = ToUInt32( value_.argumentPtr_ ); - value_.argumentPtr_ = value_.argumentPtr_ + osc::OSC_SIZEOF_INT32 + RoundUp4( blobSize ); - } - break; - - case ARRAY_BEGIN_TYPE_TAG: - case ARRAY_END_TYPE_TAG: - - // [ Indicates the beginning of an array. The tags following are for - // data in the Array until a close brace tag is reached. - // ] Indicates the end of an array. - - // zero length, don't advance argument ptr - break; - - default: // unknown type tag - // don't advance - --value_.typeTagPtr_; - break; - } -} - -//------------------------------------------------------------------------------ - -ReceivedMessage::ReceivedMessage( const ReceivedPacket& packet ) - : addressPattern_( packet.Contents() ) -{ - Init( packet.Contents(), packet.Size() ); -} - - -ReceivedMessage::ReceivedMessage( const ReceivedBundleElement& bundleElement ) - : addressPattern_( bundleElement.Contents() ) -{ - Init( bundleElement.Contents(), bundleElement.Size() ); -} - - -bool ReceivedMessage::AddressPatternIsUInt32() const -{ - return (addressPattern_[0] == '\0'); -} - - -uint32 ReceivedMessage::AddressPatternAsUInt32() const -{ - return ToUInt32( addressPattern_ ); -} - - -void ReceivedMessage::Init( const char *message, osc_bundle_element_size_t size ) -{ - if( !IsValidElementSizeValue(size) ) - throw MalformedMessageException( "invalid message size" ); - - if( size == 0 ) - throw MalformedMessageException( "zero length messages not permitted" ); - - if( !IsMultipleOf4(size) ) - throw MalformedMessageException( "message size must be multiple of four" ); - - const char *end = message + size; - - typeTagsBegin_ = FindStr4End( addressPattern_, end ); - if( typeTagsBegin_ == 0 ){ - // address pattern was not terminated before end - throw MalformedMessageException( "unterminated address pattern" ); - } - - if( typeTagsBegin_ == end ){ - // message consists of only the address pattern - no arguments or type tags. - typeTagsBegin_ = 0; - typeTagsEnd_ = 0; - arguments_ = 0; - - }else{ - if( *typeTagsBegin_ != ',' ) - throw MalformedMessageException( "type tags not present" ); - - if( *(typeTagsBegin_ + 1) == '\0' ){ - // zero length type tags - typeTagsBegin_ = 0; - typeTagsEnd_ = 0; - arguments_ = 0; - - }else{ - // check that all arguments are present and well formed - - arguments_ = FindStr4End( typeTagsBegin_, end ); - if( arguments_ == 0 ){ - throw MalformedMessageException( "type tags were not terminated before end of message" ); - } - - ++typeTagsBegin_; // advance past initial ',' - - const char *typeTag = typeTagsBegin_; - const char *argument = arguments_; - unsigned int arrayLevel = 0; - - do{ - switch( *typeTag ){ - case TRUE_TYPE_TAG: - case FALSE_TYPE_TAG: - case NIL_TYPE_TAG: - case INFINITUM_TYPE_TAG: - // zero length - break; - - // [ Indicates the beginning of an array. The tags following are for - // data in the Array until a close brace tag is reached. - // ] Indicates the end of an array. - case ARRAY_BEGIN_TYPE_TAG: - ++arrayLevel; - // (zero length argument data) - break; - - case ARRAY_END_TYPE_TAG: - --arrayLevel; - // (zero length argument data) - break; - - case INT32_TYPE_TAG: - case FLOAT_TYPE_TAG: - case CHAR_TYPE_TAG: - case RGBA_COLOR_TYPE_TAG: - case MIDI_MESSAGE_TYPE_TAG: - - if( argument == end ) - throw MalformedMessageException( "arguments exceed message size" ); - argument += 4; - if( argument > end ) - throw MalformedMessageException( "arguments exceed message size" ); - break; - - case INT64_TYPE_TAG: - case TIME_TAG_TYPE_TAG: - case DOUBLE_TYPE_TAG: - - if( argument == end ) - throw MalformedMessageException( "arguments exceed message size" ); - argument += 8; - if( argument > end ) - throw MalformedMessageException( "arguments exceed message size" ); - break; - - case STRING_TYPE_TAG: - case SYMBOL_TYPE_TAG: - - if( argument == end ) - throw MalformedMessageException( "arguments exceed message size" ); - argument = FindStr4End( argument, end ); - if( argument == 0 ) - throw MalformedMessageException( "unterminated string argument" ); - break; - - case BLOB_TYPE_TAG: - { - if( argument + osc::OSC_SIZEOF_INT32 > end ) - MalformedMessageException( "arguments exceed message size" ); - - // treat blob size as an unsigned int for the purposes of this calculation - uint32 blobSize = ToUInt32( argument ); - argument = argument + osc::OSC_SIZEOF_INT32 + RoundUp4( blobSize ); - if( argument > end ) - MalformedMessageException( "arguments exceed message size" ); - } - break; - - default: - throw MalformedMessageException( "unknown type tag" ); - } - - }while( *++typeTag != '\0' ); - typeTagsEnd_ = typeTag; - - if( arrayLevel != 0 ) - throw MalformedMessageException( "array was not terminated before end of message (expected ']' end of array tag)" ); - } - - // These invariants should be guaranteed by the above code. - // we depend on them in the implementation of ArgumentCount() -#ifndef NDEBUG - std::ptrdiff_t argumentCount = typeTagsEnd_ - typeTagsBegin_; - assert( argumentCount >= 0 ); - assert( argumentCount <= OSC_INT32_MAX ); -#endif - } -} - -//------------------------------------------------------------------------------ - -ReceivedBundle::ReceivedBundle( const ReceivedPacket& packet ) - : elementCount_( 0 ) -{ - Init( packet.Contents(), packet.Size() ); -} - - -ReceivedBundle::ReceivedBundle( const ReceivedBundleElement& bundleElement ) - : elementCount_( 0 ) -{ - Init( bundleElement.Contents(), bundleElement.Size() ); -} - - -void ReceivedBundle::Init( const char *bundle, osc_bundle_element_size_t size ) -{ - - if( !IsValidElementSizeValue(size) ) - throw MalformedBundleException( "invalid bundle size" ); - - if( size < 16 ) - throw MalformedBundleException( "packet too short for bundle" ); - - if( !IsMultipleOf4(size) ) - throw MalformedBundleException( "bundle size must be multiple of four" ); - - if( bundle[0] != '#' - || bundle[1] != 'b' - || bundle[2] != 'u' - || bundle[3] != 'n' - || bundle[4] != 'd' - || bundle[5] != 'l' - || bundle[6] != 'e' - || bundle[7] != '\0' ) - throw MalformedBundleException( "bad bundle address pattern" ); - - end_ = bundle + size; - - timeTag_ = bundle + 8; - - const char *p = timeTag_ + 8; - - while( p < end_ ){ - if( p + osc::OSC_SIZEOF_INT32 > end_ ) - throw MalformedBundleException( "packet too short for elementSize" ); - - // treat element size as an unsigned int for the purposes of this calculation - uint32 elementSize = ToUInt32( p ); - if( (elementSize & ((uint32)0x03)) != 0 ) - throw MalformedBundleException( "bundle element size must be multiple of four" ); - - p += osc::OSC_SIZEOF_INT32 + elementSize; - if( p > end_ ) - throw MalformedBundleException( "packet too short for bundle element" ); - - ++elementCount_; - } - - if( p != end_ ) - throw MalformedBundleException( "bundle contents " ); -} - - -uint64 ReceivedBundle::TimeTag() const -{ - return ToUInt64( timeTag_ ); -} - - -} // namespace osc - diff --git a/ext/osc/osc/OscReceivedElements.h b/ext/osc/osc/OscReceivedElements.h deleted file mode 100644 index b6205f3168..0000000000 --- a/ext/osc/osc/OscReceivedElements.h +++ /dev/null @@ -1,548 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_OSCRECEIVEDELEMENTS_H -#define INCLUDED_OSCPACK_OSCRECEIVEDELEMENTS_H - -#include -#include -#include // size_t - -#include "OscTypes.h" -#include "OscException.h" - - -namespace osc{ - - -class MalformedPacketException : public Exception{ -public: - MalformedPacketException( const char *w="malformed packet" ) - : Exception( w ) {} -}; - -class MalformedMessageException : public Exception{ -public: - MalformedMessageException( const char *w="malformed message" ) - : Exception( w ) {} -}; - -class MalformedBundleException : public Exception{ -public: - MalformedBundleException( const char *w="malformed bundle" ) - : Exception( w ) {} -}; - -class WrongArgumentTypeException : public Exception{ -public: - WrongArgumentTypeException( const char *w="wrong argument type" ) - : Exception( w ) {} -}; - -class MissingArgumentException : public Exception{ -public: - MissingArgumentException( const char *w="missing argument" ) - : Exception( w ) {} -}; - -class ExcessArgumentException : public Exception{ -public: - ExcessArgumentException( const char *w="too many arguments" ) - : Exception( w ) {} -}; - - -class ReceivedPacket{ -public: - // Although the OSC spec is not entirely clear on this, we only support - // packets up to 0x7FFFFFFC bytes long (the maximum 4-byte aligned value - // representable by an int32). An exception will be raised if you pass a - // larger value to the ReceivedPacket() constructor. - - ReceivedPacket( const char *contents, osc_bundle_element_size_t size ) - : contents_( contents ) - , size_( ValidateSize(size) ) {} - - ReceivedPacket( const char *contents, std::size_t size ) - : contents_( contents ) - , size_( ValidateSize( (osc_bundle_element_size_t)size ) ) {} - -#if !(defined(__x86_64__) || defined(_M_X64)) - ReceivedPacket( const char *contents, int size ) - : contents_( contents ) - , size_( ValidateSize( (osc_bundle_element_size_t)size ) ) {} -#endif - - bool IsMessage() const { return !IsBundle(); } - bool IsBundle() const; - - osc_bundle_element_size_t Size() const { return size_; } - const char *Contents() const { return contents_; } - -private: - const char *contents_; - osc_bundle_element_size_t size_; - - static osc_bundle_element_size_t ValidateSize( osc_bundle_element_size_t size ) - { - // sanity check integer types declared in OscTypes.h - // you'll need to fix OscTypes.h if any of these asserts fail - assert( sizeof(osc::int32) == 4 ); - assert( sizeof(osc::uint32) == 4 ); - assert( sizeof(osc::int64) == 8 ); - assert( sizeof(osc::uint64) == 8 ); - - if( !IsValidElementSizeValue(size) ) - throw MalformedPacketException( "invalid packet size" ); - - if( size == 0 ) - throw MalformedPacketException( "zero length elements not permitted" ); - - if( !IsMultipleOf4(size) ) - throw MalformedPacketException( "element size must be multiple of four" ); - - return size; - } -}; - - -class ReceivedBundleElement{ -public: - ReceivedBundleElement( const char *sizePtr ) - : sizePtr_( sizePtr ) {} - - friend class ReceivedBundleElementIterator; - - bool IsMessage() const { return !IsBundle(); } - bool IsBundle() const; - - osc_bundle_element_size_t Size() const; - const char *Contents() const { return sizePtr_ + osc::OSC_SIZEOF_INT32; } - -private: - const char *sizePtr_; -}; - - -class ReceivedBundleElementIterator{ -public: - ReceivedBundleElementIterator( const char *sizePtr ) - : value_( sizePtr ) {} - - ReceivedBundleElementIterator operator++() - { - Advance(); - return *this; - } - - ReceivedBundleElementIterator operator++(int) - { - ReceivedBundleElementIterator old( *this ); - Advance(); - return old; - } - - const ReceivedBundleElement& operator*() const { return value_; } - - const ReceivedBundleElement* operator->() const { return &value_; } - - friend bool operator==(const ReceivedBundleElementIterator& lhs, - const ReceivedBundleElementIterator& rhs ); - -private: - ReceivedBundleElement value_; - - void Advance() { value_.sizePtr_ = value_.Contents() + value_.Size(); } - - bool IsEqualTo( const ReceivedBundleElementIterator& rhs ) const - { - return value_.sizePtr_ == rhs.value_.sizePtr_; - } -}; - -inline bool operator==(const ReceivedBundleElementIterator& lhs, - const ReceivedBundleElementIterator& rhs ) -{ - return lhs.IsEqualTo( rhs ); -} - -inline bool operator!=(const ReceivedBundleElementIterator& lhs, - const ReceivedBundleElementIterator& rhs ) -{ - return !( lhs == rhs ); -} - - -class ReceivedMessageArgument{ -public: - ReceivedMessageArgument( const char *typeTagPtr, const char *argumentPtr ) - : typeTagPtr_( typeTagPtr ) - , argumentPtr_( argumentPtr ) {} - - friend class ReceivedMessageArgumentIterator; - - char TypeTag() const { return *typeTagPtr_; } - - // the unchecked methods below don't check whether the argument actually - // is of the specified type. they should only be used if you've already - // checked the type tag or the associated IsType() method. - - bool IsBool() const - { return *typeTagPtr_ == TRUE_TYPE_TAG || *typeTagPtr_ == FALSE_TYPE_TAG; } - bool AsBool() const; - bool AsBoolUnchecked() const; - - bool IsNil() const { return *typeTagPtr_ == NIL_TYPE_TAG; } - bool IsInfinitum() const { return *typeTagPtr_ == INFINITUM_TYPE_TAG; } - - bool IsInt32() const { return *typeTagPtr_ == INT32_TYPE_TAG; } - int32 AsInt32() const; - int32 AsInt32Unchecked() const; - - bool IsFloat() const { return *typeTagPtr_ == FLOAT_TYPE_TAG; } - float AsFloat() const; - float AsFloatUnchecked() const; - - bool IsChar() const { return *typeTagPtr_ == CHAR_TYPE_TAG; } - char AsChar() const; - char AsCharUnchecked() const; - - bool IsRgbaColor() const { return *typeTagPtr_ == RGBA_COLOR_TYPE_TAG; } - uint32 AsRgbaColor() const; - uint32 AsRgbaColorUnchecked() const; - - bool IsMidiMessage() const { return *typeTagPtr_ == MIDI_MESSAGE_TYPE_TAG; } - uint32 AsMidiMessage() const; - uint32 AsMidiMessageUnchecked() const; - - bool IsInt64() const { return *typeTagPtr_ == INT64_TYPE_TAG; } - int64 AsInt64() const; - int64 AsInt64Unchecked() const; - - bool IsTimeTag() const { return *typeTagPtr_ == TIME_TAG_TYPE_TAG; } - uint64 AsTimeTag() const; - uint64 AsTimeTagUnchecked() const; - - bool IsDouble() const { return *typeTagPtr_ == DOUBLE_TYPE_TAG; } - double AsDouble() const; - double AsDoubleUnchecked() const; - - bool IsString() const { return *typeTagPtr_ == STRING_TYPE_TAG; } - const char* AsString() const; - const char* AsStringUnchecked() const { return argumentPtr_; } - - bool IsSymbol() const { return *typeTagPtr_ == SYMBOL_TYPE_TAG; } - const char* AsSymbol() const; - const char* AsSymbolUnchecked() const { return argumentPtr_; } - - bool IsBlob() const { return *typeTagPtr_ == BLOB_TYPE_TAG; } - void AsBlob( const void*& data, osc_bundle_element_size_t& size ) const; - void AsBlobUnchecked( const void*& data, osc_bundle_element_size_t& size ) const; - - bool IsArrayBegin() const { return *typeTagPtr_ == ARRAY_BEGIN_TYPE_TAG; } - bool IsArrayEnd() const { return *typeTagPtr_ == ARRAY_END_TYPE_TAG; } - // Calculate the number of top-level items in the array. Nested arrays count as one item. - // Only valid at array start. Will throw an exception if IsArrayStart() == false. - std::size_t ComputeArrayItemCount() const; - -private: - const char *typeTagPtr_; - const char *argumentPtr_; -}; - - -class ReceivedMessageArgumentIterator{ -public: - ReceivedMessageArgumentIterator( const char *typeTags, const char *arguments ) - : value_( typeTags, arguments ) {} - - ReceivedMessageArgumentIterator operator++() - { - Advance(); - return *this; - } - - ReceivedMessageArgumentIterator operator++(int) - { - ReceivedMessageArgumentIterator old( *this ); - Advance(); - return old; - } - - const ReceivedMessageArgument& operator*() const { return value_; } - - const ReceivedMessageArgument* operator->() const { return &value_; } - - friend bool operator==(const ReceivedMessageArgumentIterator& lhs, - const ReceivedMessageArgumentIterator& rhs ); - -private: - ReceivedMessageArgument value_; - - void Advance(); - - bool IsEqualTo( const ReceivedMessageArgumentIterator& rhs ) const - { - return value_.typeTagPtr_ == rhs.value_.typeTagPtr_; - } -}; - -inline bool operator==(const ReceivedMessageArgumentIterator& lhs, - const ReceivedMessageArgumentIterator& rhs ) -{ - return lhs.IsEqualTo( rhs ); -} - -inline bool operator!=(const ReceivedMessageArgumentIterator& lhs, - const ReceivedMessageArgumentIterator& rhs ) -{ - return !( lhs == rhs ); -} - - -class ReceivedMessageArgumentStream{ - friend class ReceivedMessage; - ReceivedMessageArgumentStream( const ReceivedMessageArgumentIterator& begin, - const ReceivedMessageArgumentIterator& end ) - : p_( begin ) - , end_( end ) {} - - ReceivedMessageArgumentIterator p_, end_; - -public: - - // end of stream - bool Eos() const { return p_ == end_; } - - ReceivedMessageArgumentStream& operator>>( bool& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs = (*p_++).AsBool(); - return *this; - } - - // not sure if it would be useful to stream Nil and Infinitum - // for now it's not possible - // same goes for array boundaries - - ReceivedMessageArgumentStream& operator>>( int32& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs = (*p_++).AsInt32(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( float& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs = (*p_++).AsFloat(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( char& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs = (*p_++).AsChar(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( RgbaColor& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs.value = (*p_++).AsRgbaColor(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( MidiMessage& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs.value = (*p_++).AsMidiMessage(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( int64& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs = (*p_++).AsInt64(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( TimeTag& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs.value = (*p_++).AsTimeTag(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( double& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs = (*p_++).AsDouble(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( Blob& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - (*p_++).AsBlob( rhs.data, rhs.size ); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( const char*& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs = (*p_++).AsString(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( Symbol& rhs ) - { - if( Eos() ) - throw MissingArgumentException(); - - rhs.value = (*p_++).AsSymbol(); - return *this; - } - - ReceivedMessageArgumentStream& operator>>( MessageTerminator& rhs ) - { - (void) rhs; // suppress unused parameter warning - - if( !Eos() ) - throw ExcessArgumentException(); - - return *this; - } -}; - - -class ReceivedMessage{ - void Init( const char *bundle, osc_bundle_element_size_t size ); -public: - explicit ReceivedMessage( const ReceivedPacket& packet ); - explicit ReceivedMessage( const ReceivedBundleElement& bundleElement ); - - const char *AddressPattern() const { return addressPattern_; } - - // Support for non-standard SuperCollider integer address patterns: - bool AddressPatternIsUInt32() const; - uint32 AddressPatternAsUInt32() const; - - uint32 ArgumentCount() const { return static_cast(typeTagsEnd_ - typeTagsBegin_); } - - const char *TypeTags() const { return typeTagsBegin_; } - - - typedef ReceivedMessageArgumentIterator const_iterator; - - ReceivedMessageArgumentIterator ArgumentsBegin() const - { - return ReceivedMessageArgumentIterator( typeTagsBegin_, arguments_ ); - } - - ReceivedMessageArgumentIterator ArgumentsEnd() const - { - return ReceivedMessageArgumentIterator( typeTagsEnd_, 0 ); - } - - ReceivedMessageArgumentStream ArgumentStream() const - { - return ReceivedMessageArgumentStream( ArgumentsBegin(), ArgumentsEnd() ); - } - -private: - const char *addressPattern_; - const char *typeTagsBegin_; - const char *typeTagsEnd_; - const char *arguments_; -}; - - -class ReceivedBundle{ - void Init( const char *message, osc_bundle_element_size_t size ); -public: - explicit ReceivedBundle( const ReceivedPacket& packet ); - explicit ReceivedBundle( const ReceivedBundleElement& bundleElement ); - - uint64 TimeTag() const; - - uint32 ElementCount() const { return elementCount_; } - - typedef ReceivedBundleElementIterator const_iterator; - - ReceivedBundleElementIterator ElementsBegin() const - { - return ReceivedBundleElementIterator( timeTag_ + 8 ); - } - - ReceivedBundleElementIterator ElementsEnd() const - { - return ReceivedBundleElementIterator( end_ ); - } - -private: - const char *timeTag_; - const char *end_; - uint32 elementCount_; -}; - - -} // namespace osc - - -#endif /* INCLUDED_OSCPACK_OSCRECEIVEDELEMENTS_H */ diff --git a/ext/osc/osc/OscTypes.cpp b/ext/osc/osc/OscTypes.cpp deleted file mode 100644 index 444a9fed48..0000000000 --- a/ext/osc/osc/OscTypes.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#include "OscTypes.h" - -namespace osc{ - -BundleInitiator BeginBundleImmediate(1); -BundleTerminator EndBundle; -MessageTerminator EndMessage; -NilType OscNil; -#ifndef _OBJC_OBJC_H_ -NilType Nil; // Objective-C defines Nil. so our Nil is deprecated. use OscNil instead -#endif -InfinitumType Infinitum; -ArrayInitiator BeginArray; -ArrayTerminator EndArray; - -} // namespace osc diff --git a/ext/osc/osc/OscTypes.h b/ext/osc/osc/OscTypes.h deleted file mode 100644 index 610020182e..0000000000 --- a/ext/osc/osc/OscTypes.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - oscpack -- Open Sound Control (OSC) packet manipulation library - http://www.rossbencina.com/code/oscpack - - Copyright (c) 2004-2013 Ross Bencina - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/* - The text above constitutes the entire oscpack license; however, - the oscpack developer(s) also make the following non-binding requests: - - Any person wishing to distribute modifications to the Software is - requested to send the modifications to the original developer so that - they can be incorporated into the canonical version. It is also - requested that these non-binding requests be included whenever the - above license is reproduced. -*/ -#ifndef INCLUDED_OSCPACK_OSCTYPES_H -#define INCLUDED_OSCPACK_OSCTYPES_H - - -namespace osc{ - -// basic types - -#if defined(__BORLANDC__) || defined(_MSC_VER) - -typedef __int64 int64; -typedef unsigned __int64 uint64; - -#elif defined(__x86_64__) || defined(_M_X64) - -typedef long int64; -typedef unsigned long uint64; - -#else - -typedef long long int64; -typedef unsigned long long uint64; - -#endif - - - -#if defined(__x86_64__) || defined(_M_X64) - -typedef signed int int32; -typedef unsigned int uint32; - -#else - -typedef signed long int32; -typedef unsigned long uint32; - -#endif - - -enum ValueTypeSizes{ - OSC_SIZEOF_INT32 = 4, - OSC_SIZEOF_UINT32 = 4, - OSC_SIZEOF_INT64 = 8, - OSC_SIZEOF_UINT64 = 8, -}; - - -// osc_bundle_element_size_t is used for the size of bundle elements and blobs -// the OSC spec specifies these as int32 (signed) but we ensure that they -// are always positive since negative field sizes make no sense. - -typedef int32 osc_bundle_element_size_t; - -enum { - OSC_INT32_MAX = 0x7FFFFFFF, - - // Element sizes are specified to be int32, and are always rounded up to nearest - // multiple of 4. Therefore their values can't be greater than 0x7FFFFFFC. - OSC_BUNDLE_ELEMENT_SIZE_MAX = 0x7FFFFFFC -}; - - -inline bool IsValidElementSizeValue( osc_bundle_element_size_t x ) -{ - // sizes may not be negative or exceed OSC_BUNDLE_ELEMENT_SIZE_MAX - return x >= 0 && x <= OSC_BUNDLE_ELEMENT_SIZE_MAX; -} - - -inline bool IsMultipleOf4( osc_bundle_element_size_t x ) -{ - return (x & ((osc_bundle_element_size_t)0x03)) == 0; -} - - -enum TypeTagValues { - TRUE_TYPE_TAG = 'T', - FALSE_TYPE_TAG = 'F', - NIL_TYPE_TAG = 'N', - INFINITUM_TYPE_TAG = 'I', - INT32_TYPE_TAG = 'i', - FLOAT_TYPE_TAG = 'f', - CHAR_TYPE_TAG = 'c', - RGBA_COLOR_TYPE_TAG = 'r', - MIDI_MESSAGE_TYPE_TAG = 'm', - INT64_TYPE_TAG = 'h', - TIME_TAG_TYPE_TAG = 't', - DOUBLE_TYPE_TAG = 'd', - STRING_TYPE_TAG = 's', - SYMBOL_TYPE_TAG = 'S', - BLOB_TYPE_TAG = 'b', - ARRAY_BEGIN_TYPE_TAG = '[', - ARRAY_END_TYPE_TAG = ']' -}; - - - -// i/o manipulators used for streaming interfaces - -struct BundleInitiator{ - explicit BundleInitiator( uint64 timeTag_ ) : timeTag( timeTag_ ) {} - uint64 timeTag; -}; - -extern BundleInitiator BeginBundleImmediate; - -inline BundleInitiator BeginBundle( uint64 timeTag=1 ) -{ - return BundleInitiator(timeTag); -} - - -struct BundleTerminator{ -}; - -extern BundleTerminator EndBundle; - -struct BeginMessage{ - explicit BeginMessage( const char *addressPattern_ ) : addressPattern( addressPattern_ ) {} - const char *addressPattern; -}; - -struct MessageTerminator{ -}; - -extern MessageTerminator EndMessage; - - -// osc specific types. they are defined as structs so they can be used -// as separately identifiable types with the streaming operators. - -struct NilType{ -}; - -extern NilType OscNil; - -#ifndef _OBJC_OBJC_H_ -extern NilType Nil; // Objective-C defines Nil. so our Nil is deprecated. use OscNil instead -#endif - -struct InfinitumType{ -}; - -extern InfinitumType Infinitum; - -struct RgbaColor{ - RgbaColor() {} - explicit RgbaColor( uint32 value_ ) : value( value_ ) {} - uint32 value; - - operator uint32() const { return value; } -}; - - -struct MidiMessage{ - MidiMessage() {} - explicit MidiMessage( uint32 value_ ) : value( value_ ) {} - uint32 value; - - operator uint32() const { return value; } -}; - - -struct TimeTag{ - TimeTag() {} - explicit TimeTag( uint64 value_ ) : value( value_ ) {} - uint64 value; - - operator uint64() const { return value; } -}; - - -struct Symbol{ - Symbol() {} - explicit Symbol( const char* value_ ) : value( value_ ) {} - const char* value; - - operator const char *() const { return value; } -}; - - -struct Blob{ - Blob() {} - explicit Blob( const void* data_, osc_bundle_element_size_t size_ ) - : data( data_ ), size( size_ ) {} - const void* data; - osc_bundle_element_size_t size; -}; - -struct ArrayInitiator{ -}; - -extern ArrayInitiator BeginArray; - -struct ArrayTerminator{ -}; - -extern ArrayTerminator EndArray; - -} // namespace osc - - -#endif /* INCLUDED_OSCPACK_OSCTYPES_H */ From c4e763e6a13ba9259799ec06aff5f2a9fb1d92a8 Mon Sep 17 00:00:00 2001 From: Malin E Date: Wed, 8 Dec 2021 10:09:54 +0100 Subject: [PATCH 019/117] Increase maximum number of buttons allowed on a joystick --- include/openspace/interaction/joystickinputstate.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/openspace/interaction/joystickinputstate.h b/include/openspace/interaction/joystickinputstate.h index adcfc028c3..a64d3d99a8 100644 --- a/include/openspace/interaction/joystickinputstate.h +++ b/include/openspace/interaction/joystickinputstate.h @@ -54,10 +54,11 @@ enum class JoystickAction : uint8_t { * The input state of a single joystick. */ struct JoystickInputState { + /// These two are just randomly selected numbers that can be increased if needed /// The maximum number of supported axes static constexpr const int MaxAxes = 8; /// The maximum number of supported buttons - static constexpr const int MaxButtons = 32; + static constexpr const int MaxButtons = 48; /// Marks whether this joystick is connected. If this value is \c false, all other /// members of this struct are undefined From d32af9117a695ac299279582e3253986f0c7d944 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 10 Dec 2021 17:22:40 +0100 Subject: [PATCH 020/117] Code style cleanup --- apps/OpenSpace/main.cpp | 3 +-- ext/ghoul | 2 +- include/openspace/scripting/scriptscheduler.h | 3 ++- modules/base/basemodule.cpp | 8 ++++++-- modules/base/rendering/renderablemodel.cpp | 5 ++++- modules/base/translation/timelinetranslation.cpp | 4 ++-- modules/globebrowsing/src/tileprovider.cpp | 12 ++++++------ modules/space/rendering/renderabletravelspeed.cpp | 12 ++++++------ modules/space/rendering/renderabletravelspeed.h | 2 +- modules/volume/rawvolumereader.inl | 2 +- modules/volume/rendering/basicvolumeraycaster.h | 2 +- .../volume/rendering/renderabletimevaryingvolume.cpp | 4 ++-- src/navigation/pathcurves/avoidcollisioncurve.cpp | 3 ++- src/navigation/pathnavigator_lua.inl | 8 +++----- support/coding/codegen | 2 +- 15 files changed, 39 insertions(+), 33 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 063057d6a5..c5943742a6 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -997,8 +997,7 @@ std::string selectedSgctProfileFromLauncher(LauncherWindow& lw, bool hasCliSGCTC } } else { - if ( (config.length() >= xmlExt.length()) - && (0 == config.compare(config.length() - xmlExt.length(), xmlExt.length(), xmlExt)) ) { + if (std::filesystem::path(config).extension() == ".xml") { //user customzied sgct config } else { diff --git a/ext/ghoul b/ext/ghoul index 692af309c6..6dfb7965bf 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 692af309c607d2e6455718738bf2b8cea0ba8455 +Subproject commit 6dfb7965bf7d44a6d3690634daf21848b3be6df5 diff --git a/include/openspace/scripting/scriptscheduler.h b/include/openspace/scripting/scriptscheduler.h index 07d5ea09bb..7657a8bbb7 100644 --- a/include/openspace/scripting/scriptscheduler.h +++ b/include/openspace/scripting/scriptscheduler.h @@ -138,7 +138,8 @@ public: * * \returns a vector of all scripts that has been loaded */ - std::vector allScripts(std::optional group = std::nullopt) const; + std::vector allScripts( + std::optional group = std::nullopt) const; /** * Sets the mode for how each scheduled script's timestamp will be interpreted. diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index 78a8ae1412..83dc71ef93 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -134,9 +134,13 @@ void BaseModule::internalInitialize(const ghoul::Dictionary&) { fRenderable->registerClass("RenderableNodeLine"); fRenderable->registerClass("RenderablePlaneImageLocal"); fRenderable->registerClass("RenderablePlaneImageOnline"); - fRenderable->registerClass("RenderablePlaneTimeVaryingImage"); + fRenderable->registerClass( + "RenderablePlaneTimeVaryingImage" + ); fRenderable->registerClass("RenderablePrism"); - fRenderable->registerClass("RenderableTimeVaryingSphere"); + fRenderable->registerClass( + "RenderableTimeVaryingSphere" + ); fRenderable->registerClass("RenderableRadialGrid"); fRenderable->registerClass("RenderableSphere"); fRenderable->registerClass("RenderableSphericalGrid"); diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 8f236ec978..cd6bc10587 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -409,7 +409,10 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) else if (std::holds_alternative(*p.animationTimeScale)) { _geometry->setTimeScale(std::get(*p.animationTimeScale)); } - else if (std::holds_alternative(*p.animationTimeScale)) { + else if (std::holds_alternative( + *p.animationTimeScale) + ) + { Parameters::AnimationTimeUnit animationTimeUnit = std::get(*p.animationTimeScale); TimeUnit timeUnit; diff --git a/modules/base/translation/timelinetranslation.cpp b/modules/base/translation/timelinetranslation.cpp index 4ad2e11559..0c51963341 100644 --- a/modules/base/translation/timelinetranslation.cpp +++ b/modules/base/translation/timelinetranslation.cpp @@ -34,8 +34,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ShouldInterpolateInfo = { "ShouldInterpolate", "Should Interpolate", - "If this value is set to 'true', an interpolation is applied between the given keyframes. " - "If this value is set to 'false', the interpolation is not applied." + "If this value is set to 'true', an interpolation is applied between the given " + "keyframes. If this value is set to 'false', the interpolation is not applied." }; struct [[codegen::Dictionary(TimelineTranslation)]] Parameters { diff --git a/modules/globebrowsing/src/tileprovider.cpp b/modules/globebrowsing/src/tileprovider.cpp index 9c5e654b10..9c071f5ef6 100644 --- a/modules/globebrowsing/src/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider.cpp @@ -484,7 +484,7 @@ TileProvider* getTileProvider(TemporalTileProvider& t, const Time& time) { std::string_view prevTileStr = timeStringify(t.timeFormat, prevTile); try { // the necessary tile providers are loaded if they exist within the - // dataset's timespan + // dataset's timespan if (secondToLast.j2000Seconds() > simulationTime.j2000Seconds() && secondToFirst.j2000Seconds() < simulationTime.j2000Seconds()) { @@ -1127,7 +1127,7 @@ bool deinitialize(TileProvider& tp) { // InterpolateTileProvider::InterpolateTileProvider(const ghoul::Dictionary&) { ZoneScoped - + type = Type::InterpolateTileProvider; glGenFramebuffers(1, &fbo); glGenVertexArrays(1, &vaoQuad); @@ -1177,7 +1177,7 @@ InterpolateTileProvider::~InterpolateTileProvider() { Tile InterpolateTileProvider::calculateTile(const TileIndex& tileIndex) { ZoneScoped TracyGpuZone("tile"); - + // prev and next are the two tiles to interpolate between Tile prev = tile(*t1, tileIndex); Tile next = tile(*t2, tileIndex); @@ -1186,7 +1186,7 @@ Tile InterpolateTileProvider::calculateTile(const TileIndex& tileIndex) { Tile prevprev = tile(*before, tileIndex); Tile nextnext = tile(*future, tileIndex); cache::ProviderTileKey key = { tileIndex, uniqueIdentifier }; - + if (!prev.texture || !next.texture) { return Tile{ nullptr, std::nullopt, Tile::Status::Unavailable }; } @@ -1218,7 +1218,7 @@ Tile InterpolateTileProvider::calculateTile(const TileIndex& tileIndex) { writeTexture = ourTile.texture; } else { - // Create a texture with the initialization data + // Create a texture with the initialization data writeTexture = tileCache->texture(initData); // Create a tile with the texture ourTile = Tile{ writeTexture, std::nullopt, Tile::Status::OK }; @@ -1257,7 +1257,7 @@ Tile InterpolateTileProvider::calculateTile(const TileIndex& tileIndex) { // Activate shader and bind uniforms shaderProgram->activate(); shaderProgram->setUniform("blendFactor", factor); - + ghoul::opengl::TextureUnit colormapUnit; colormapUnit.activate(); colormapTexture->bind(); diff --git a/modules/space/rendering/renderabletravelspeed.cpp b/modules/space/rendering/renderabletravelspeed.cpp index 42cf68c768..0d8250e09c 100644 --- a/modules/space/rendering/renderabletravelspeed.cpp +++ b/modules/space/rendering/renderabletravelspeed.cpp @@ -99,10 +99,10 @@ namespace { // [[codegen::verbatim(LineWidthInfo.description)]] std::optional lineWidth; - + // [[codegen::verbatim(IndicatorLengthInfo.description)]] std::optional indicatorLength; - + // [[codegen::verbatim(FadeLengthInfo.description)]] std::optional fadeLength; }; @@ -121,7 +121,7 @@ RenderableTravelSpeed::RenderableTravelSpeed(const ghoul::Dictionary& dictionary , _travelSpeed( SpeedInfo, distanceconstants::LightSecond, - 1.0, + 1.0, distanceconstants::LightSecond ) , _indicatorLength(IndicatorLengthInfo, 1, 1, 360) @@ -156,7 +156,7 @@ RenderableTravelSpeed::RenderableTravelSpeed(const ghoul::Dictionary& dictionary _targetNode = n; _targetPosition = _targetNode->worldPosition(); _lightTravelTime = calculateLightTravelTime( - _sourcePosition, + _sourcePosition, _targetPosition ); calculateDirectionVector(); @@ -234,7 +234,7 @@ void RenderableTravelSpeed::calculateVerticesPositions() { _vertexPositions.endOfFade = glm::vec3(0.0, 0.0, 0.0); // = source node } else { - _vertexPositions.endOfFade = _travelSpeed * + _vertexPositions.endOfFade = _travelSpeed * (_timeSinceStart - _indicatorLength - _fadeLength) * _directionVector; } } @@ -276,7 +276,7 @@ void RenderableTravelSpeed::update(const UpdateData& data) { _sourcePosition = mySGNPointer->worldPosition(); _lightTravelTime = calculateLightTravelTime( - _sourcePosition, + _sourcePosition, _targetPosition ); diff --git a/modules/space/rendering/renderabletravelspeed.h b/modules/space/rendering/renderabletravelspeed.h index 3ac18de100..d5f07fca22 100644 --- a/modules/space/rendering/renderabletravelspeed.h +++ b/modules/space/rendering/renderabletravelspeed.h @@ -92,4 +92,4 @@ private: } // namespace openspace -#endif //__OPENSPACE_MODULE_SPACE___RENDERABLETRAVELSPEED___H__ +#endif // __OPENSPACE_MODULE_SPACE___RENDERABLETRAVELSPEED___H__ diff --git a/modules/volume/rawvolumereader.inl b/modules/volume/rawvolumereader.inl index a2dfd512ce..fae6de07f3 100644 --- a/modules/volume/rawvolumereader.inl +++ b/modules/volume/rawvolumereader.inl @@ -103,7 +103,7 @@ std::unique_ptr> RawVolumeReader::read(bool inve } if (invertZ) { - std::unique_ptr> newVolume = + std::unique_ptr> newVolume = std::make_unique>(dims); for (int i = 0; i < volume->nCells(); ++i) { diff --git a/modules/volume/rendering/basicvolumeraycaster.h b/modules/volume/rendering/basicvolumeraycaster.h index 638a40e2f9..3164d6fc19 100644 --- a/modules/volume/rendering/basicvolumeraycaster.h +++ b/modules/volume/rendering/basicvolumeraycaster.h @@ -76,7 +76,7 @@ public: void setVolumeTexture(std::shared_ptr texture); std::shared_ptr volumeTexture() const; - void setTransferFunction(std::shared_ptr transferFunction); + void setTransferFunction(std::shared_ptr transferFunction); void setStepSize(float stepSize); float opacity() const; diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index fabc33c927..e949f4c24f 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -183,7 +183,7 @@ RenderableTimeVaryingVolume::RenderableTimeVaryingVolume( _transferFunctionPath, [](const openspace::TransferFunction&) {} ); - + _invertDataAtZ = p.invertDataAtZ.value_or(_invertDataAtZ); _gridType.addOptions({ @@ -193,7 +193,7 @@ RenderableTimeVaryingVolume::RenderableTimeVaryingVolume( _gridType = static_cast(volume::VolumeGridType::Cartesian); _stepSize = p.stepSize.value_or(_stepSize); - + if (p.opacity.has_value()) { _opacity = *p.opacity * VolumeMaxOpacity; } diff --git a/src/navigation/pathcurves/avoidcollisioncurve.cpp b/src/navigation/pathcurves/avoidcollisioncurve.cpp index 5c1c1d2623..fec4640976 100644 --- a/src/navigation/pathcurves/avoidcollisioncurve.cpp +++ b/src/navigation/pathcurves/avoidcollisioncurve.cpp @@ -82,7 +82,8 @@ AvoidCollisionCurve::AvoidCollisionCurve(const Waypoint& start, const Waypoint& if (glm::length(startToEnd) > 0.0) { // Add point for moving out if the end state is in opposite direction - double cosAngleToTarget = glm::dot(normalize(-startViewDir), normalize(startToEnd)); + double cosAngleToTarget = + glm::dot(normalize(-startViewDir), normalize(startToEnd)); bool targetInOppositeDirection = cosAngleToTarget > 0.7; if (targetInOppositeDirection) { diff --git a/src/navigation/pathnavigator_lua.inl b/src/navigation/pathnavigator_lua.inl index 9340d47615..2e946a8492 100644 --- a/src/navigation/pathnavigator_lua.inl +++ b/src/navigation/pathnavigator_lua.inl @@ -37,8 +37,6 @@ #include #include -using namespace std::string_literals; - namespace { constexpr const double Epsilon = 1e-5; } // namespace @@ -89,7 +87,7 @@ int goTo(lua_State* L) { } ghoul::Dictionary insDict; - insDict.setValue("TargetType", "Node"s); + insDict.setValue("TargetType", std::string("Node")); insDict.setValue("Target", nodeIdentifier); if (useUpFromTargetOrDuration.has_value()) { if (std::holds_alternative(*useUpFromTargetOrDuration)) { @@ -136,7 +134,7 @@ int goToHeight(lua_State* L) { } ghoul::Dictionary insDict; - insDict.setValue("TargetType", "Node"s); + insDict.setValue("TargetType", std::string("Node")); insDict.setValue("Target", nodeIdentifier); insDict.setValue("Height", height); if (useUpFromTargetOrDuration.has_value()) { @@ -191,7 +189,7 @@ int goToNavigationState(lua_State* L) { } ghoul::Dictionary instruction; - instruction.setValue("TargetType", "NavigationState"s); + instruction.setValue("TargetType", std::string("NavigationState")); instruction.setValue("NavigationState", navigationState); if (duration.has_value()) { diff --git a/support/coding/codegen b/support/coding/codegen index 6b503ca507..f5fdca6ae9 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit 6b503ca507df9ef057991d4acc248cab021a3355 +Subproject commit f5fdca6ae9f467bc6a365f8ff185567237dcb75d From 73a43041fd742169f6ee04d34c51f4fcc5221849 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 18 Dec 2021 00:44:35 +0400 Subject: [PATCH 021/117] Convert XML to JSON files --- apps/OpenSpace/ext/sgct | 2 +- config/equirectangular_gui.json | 58 ++++++++++++++++++++++++++ config/equirectangular_gui.xml | 30 -------------- config/fullscreen1080.json | 47 +++++++++++++++++++++ config/fullscreen1080.xml | 24 ----------- config/gui_projector.json | 64 +++++++++++++++++++++++++++++ config/gui_projector.xml | 33 --------------- config/openvr_htcVive.json | 32 +++++++++++++++ config/openvr_htcVive.xml | 23 ----------- config/openvr_oculusRiftCv1.json | 32 +++++++++++++++ config/openvr_oculusRiftCv1.xml | 23 ----------- config/single.json | 46 +++++++++++++++++++++ config/single.xml | 24 ----------- config/single_fisheye.json | 37 +++++++++++++++++ config/single_fisheye.xml | 37 ----------------- config/single_fisheye_gui.json | 61 ++++++++++++++++++++++++++++ config/single_fisheye_gui.xml | 53 ------------------------ config/single_gui.json | 70 ++++++++++++++++++++++++++++++++ config/single_gui.xml | 37 ----------------- config/single_sbs_stereo.json | 46 +++++++++++++++++++++ config/single_sbs_stereo.xml | 24 ----------- config/single_two_win.json | 59 +++++++++++++++++++++++++++ config/single_two_win.xml | 32 --------------- config/spherical_mirror.json | 40 ++++++++++++++++++ config/spherical_mirror.xml | 34 ---------------- config/spherical_mirror_gui.json | 65 +++++++++++++++++++++++++++++ config/spherical_mirror_gui.xml | 48 ---------------------- config/spout_output.json | 36 ++++++++++++++++ config/spout_output.xml | 19 --------- config/tekniska.json | 47 +++++++++++++++++++++ config/two_nodes.json | 64 +++++++++++++++++++++++++++++ config/two_nodes.xml | 36 ---------------- 32 files changed, 805 insertions(+), 478 deletions(-) create mode 100644 config/equirectangular_gui.json delete mode 100644 config/equirectangular_gui.xml create mode 100644 config/fullscreen1080.json delete mode 100644 config/fullscreen1080.xml create mode 100644 config/gui_projector.json delete mode 100644 config/gui_projector.xml create mode 100644 config/openvr_htcVive.json delete mode 100644 config/openvr_htcVive.xml create mode 100644 config/openvr_oculusRiftCv1.json delete mode 100644 config/openvr_oculusRiftCv1.xml create mode 100644 config/single.json delete mode 100644 config/single.xml create mode 100644 config/single_fisheye.json delete mode 100644 config/single_fisheye.xml create mode 100644 config/single_fisheye_gui.json delete mode 100644 config/single_fisheye_gui.xml create mode 100644 config/single_gui.json delete mode 100644 config/single_gui.xml create mode 100644 config/single_sbs_stereo.json delete mode 100644 config/single_sbs_stereo.xml create mode 100644 config/single_two_win.json delete mode 100644 config/single_two_win.xml create mode 100644 config/spherical_mirror.json delete mode 100644 config/spherical_mirror.xml create mode 100644 config/spherical_mirror_gui.json delete mode 100644 config/spherical_mirror_gui.xml create mode 100644 config/spout_output.json delete mode 100644 config/spout_output.xml create mode 100644 config/tekniska.json create mode 100644 config/two_nodes.json delete mode 100644 config/two_nodes.xml diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 4301011f99..7bc13c11b6 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 4301011f990c76fcb598245b5b6dac7637e692ac +Subproject commit 7bc13c11b62ea1c00836e0fc33a964966aad58d7 diff --git a/config/equirectangular_gui.json b/config/equirectangular_gui.json new file mode 100644 index 0000000000..3a605c26f2 --- /dev/null +++ b/config/equirectangular_gui.json @@ -0,0 +1,58 @@ +{ + "version": 1, + "masterAddress": "localhost", + "externalControlPort": 20500, + "settings": { + "display": { + "swapInterval": 0 + } + }, + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "name": "OpenSpace", + "fullscreen": false, + "draw2D": false, + "stereo": "none", + "pos": { "x": 50, "y": 50 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "EquirectangularProjection", + "quality": "1k" + } + } + ] + }, + { + "name": "GUI", + "tags": [ "GUI" ], + "fullscreen": false, + "draw3D": false, + "stereo": "none", + "pos": { "x": 50, "y": 50 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/equirectangular_gui.xml b/config/equirectangular_gui.xml deleted file mode 100644 index 98c6d545bb..0000000000 --- a/config/equirectangular_gui.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/fullscreen1080.json b/config/fullscreen1080.json new file mode 100644 index 0000000000..b4c10b45cb --- /dev/null +++ b/config/fullscreen1080.json @@ -0,0 +1,47 @@ +{ + "version": 1, + "masterAddress": "localhost", + "externalControlPort": 20500, + "settings": { + "display": { + "swapInterval": 0 + } + }, + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "fullscreen": true, + "name": "OpenSpace", + "msaa": 4, + "stereo": "none", + "pos": { "x": 0, "y": 0 }, + "size": { "x": 1920, "y": 1080 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/fullscreen1080.xml b/config/fullscreen1080.xml deleted file mode 100644 index 52d703f435..0000000000 --- a/config/fullscreen1080.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/gui_projector.json b/config/gui_projector.json new file mode 100644 index 0000000000..92eb74ca04 --- /dev/null +++ b/config/gui_projector.json @@ -0,0 +1,64 @@ +{ + "version": 1, + "masterAddress": "localhost", + "externalControlPort": 20500, + "settings": { + "display": { + "swapInterval": 0 + } + }, + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "fullscreen": true, + "monitor": 1, + "name": "OpenSpace", + "draw2D": false, + "stereo": "none", + "pos": { "x": 0, "y": 0 }, + "size": { "x": 1920, "y": 1080 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + }, + { + "fullscreen": false, + "border": false, + "name": "GUI", + "tags": [ "GUI" ], + "draw3D": false, + "stereo": "none", + "pos": { "x": 0, "y": 0 }, + "size": { "x": 1920, "y": 1080 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/gui_projector.xml b/config/gui_projector.xml deleted file mode 100644 index 9ac213193b..0000000000 --- a/config/gui_projector.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/openvr_htcVive.json b/config/openvr_htcVive.json new file mode 100644 index 0000000000..5d2b20d4b8 --- /dev/null +++ b/config/openvr_htcVive.json @@ -0,0 +1,32 @@ +{ + "version": 1, + "masterAddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "tags": [ "OpenVR" ], + "name": "OpenSpace", + "fullscreen": false, + "stereo": "side_by_side", + "size": { "x": 1332, "y": 840 }, + "res": { "x": 3024, "y": 1680 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "ProjectionPlane", + "lowerleft": { "x": -1.7156, "y": -0.965, "z": 0.0 }, + "upperleft": { "x": -1.7156, "y": 0.965, "z": 0.0 }, + "upperright": { "x": 1.7156, "y": 0.965, "z": 0.0 } + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/config/openvr_htcVive.xml b/config/openvr_htcVive.xml deleted file mode 100644 index c5ab46597a..0000000000 --- a/config/openvr_htcVive.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/openvr_oculusRiftCv1.json b/config/openvr_oculusRiftCv1.json new file mode 100644 index 0000000000..1debee6785 --- /dev/null +++ b/config/openvr_oculusRiftCv1.json @@ -0,0 +1,32 @@ +{ + "version": 1, + "masterAddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "tags": [ "OpenVR" ], + "name": "OpenSpace", + "fullscreen": false, + "stereo": "side_by_side", + "size": { "x": 1332, "y": 793 }, + "res": { "x": 2664, "y": 1586 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "ProjectionPlane", + "lowerleft": { "x": -1.7156, "y": -0.965, "z": 0.0 }, + "upperleft": { "x": -1.7156, "y": 0.965, "z": 0.0 }, + "upperright": { "x": 1.7156, "y": 0.965, "z": 0.0 } + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/config/openvr_oculusRiftCv1.xml b/config/openvr_oculusRiftCv1.xml deleted file mode 100644 index 665715fb53..0000000000 --- a/config/openvr_oculusRiftCv1.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/single.json b/config/single.json new file mode 100644 index 0000000000..d2ddb5103f --- /dev/null +++ b/config/single.json @@ -0,0 +1,46 @@ +{ + "version": 1, + "masterAddress": "localhost", + "externalControlPort": 20500, + "settings": { + "display": { + "swapInterval": 0 + } + }, + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "name": "OpenSpace", + "fullscreen": false, + "stereo": "none", + "pos": { "x": 50, "y": 50 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/single.xml b/config/single.xml deleted file mode 100644 index 6ec2d5a125..0000000000 --- a/config/single.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/single_fisheye.json b/config/single_fisheye.json new file mode 100644 index 0000000000..9e3ed6423b --- /dev/null +++ b/config/single_fisheye.json @@ -0,0 +1,37 @@ +{ + "version": 1, + "masterAddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "name": "OpenSpace", + "fullscreen": false, + "stereo": "none", + "size": { "x": 1024, "y": 1024 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "FisheyeProjection", + "fov": 180.0, + "quality": "1k", + "tilt": 27.0, + "background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.06, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/single_fisheye.xml b/config/single_fisheye.xml deleted file mode 100644 index e27230e520..0000000000 --- a/config/single_fisheye.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/single_fisheye_gui.json b/config/single_fisheye_gui.json new file mode 100644 index 0000000000..291bdddc33 --- /dev/null +++ b/config/single_fisheye_gui.json @@ -0,0 +1,61 @@ +{ + "version": 1, + "masterAddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "name": "OpenSpace", + "fullscreen": false, + "draw2D": false, + "stereo": "none", + "size": { "x": 1024, "y": 1024 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "FisheyeProjection", + "fov": 180.0, + "quality": "1k", + "tilt": 27.0, + "background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 } + } + } + ] + }, + { + "name": "GUI", + "tags": [ "GUI" ], + "fullscreen": false, + "draw3D": false, + "stereo": "none", + "pos": { "x": 50, "y": 50 }, + "size": { "x": 1024, "y": 1024 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.06, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/single_fisheye_gui.xml b/config/single_fisheye_gui.xml deleted file mode 100644 index 794a03b056..0000000000 --- a/config/single_fisheye_gui.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/single_gui.json b/config/single_gui.json new file mode 100644 index 0000000000..269ecd571c --- /dev/null +++ b/config/single_gui.json @@ -0,0 +1,70 @@ +{ + "version": 1, + "masterAddress": "localhost", + "externalControlPort": 20500, + "settings": { + "display": { + "swapInterval": 0 + } + }, + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "name": "OpenSpace", + "fullscreen": false, + "draw2D": false, + "stereo": "none", + "pos": { "x": 50, "y": 50 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + }, + { + "name": "GUI", + "tags": [ "GUI" ], + "fullscreen": false, + "draw3D": false, + "stereo": "none", + "pos": { "x": 50, "y": 50 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/single_gui.xml b/config/single_gui.xml deleted file mode 100644 index 832273090e..0000000000 --- a/config/single_gui.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/single_sbs_stereo.json b/config/single_sbs_stereo.json new file mode 100644 index 0000000000..24edc5033f --- /dev/null +++ b/config/single_sbs_stereo.json @@ -0,0 +1,46 @@ +{ + "version": 1, + "masterAddress": "localhost", + "externalControlPort": 20500, + "settings": { + "display": { + "swapInterval": 0 + } + }, + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "name": "OpenSpace", + "fullscreen": false, + "stereo": "side_by_side", + "pos": { "x": 50, "y": 50 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/single_sbs_stereo.xml b/config/single_sbs_stereo.xml deleted file mode 100644 index e0707559c1..0000000000 --- a/config/single_sbs_stereo.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/single_two_win.json b/config/single_two_win.json new file mode 100644 index 0000000000..8f3017271c --- /dev/null +++ b/config/single_two_win.json @@ -0,0 +1,59 @@ +{ + "version": 1, + "masterAddress": "127.0.0.1", + "nodes": [ + { + "address": "127.0.0.1", + "port": 20401, + "windows": [ + { + "border": true, + "fullscreen": false, + "pos": { "x": 10, "y": 100 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + }, + { + "border": true, + "fullscreen": false, + "pos": { "x": 340, "y": 100 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 4.0 } + } + ] +} \ No newline at end of file diff --git a/config/single_two_win.xml b/config/single_two_win.xml deleted file mode 100644 index ed1b09fc04..0000000000 --- a/config/single_two_win.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/config/spherical_mirror.json b/config/spherical_mirror.json new file mode 100644 index 0000000000..b618a36165 --- /dev/null +++ b/config/spherical_mirror.json @@ -0,0 +1,40 @@ +{ + "version": 1, + "masterAddress": "127.0.0.1", + "nodes": [ + { + "address": "127.0.0.1", + "port": 20401, + "windows": [ + { + "fullscreen": false, + "name": "Spherical Projection", + "stereo": "none", + "pos": { "x": 0, "y": 100 }, + "size": { "x": 1280, "y": 720 }, + "res": { "x": 2048, "y": 2048 }, + "viewports": [ + { + "mesh": "mesh/standard_16x9.data", + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "FisheyeProjection", + "fov": 180.0, + "quality": "2k", + "tilt": 30.0, + "background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.06, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/spherical_mirror.xml b/config/spherical_mirror.xml deleted file mode 100644 index f15de39d45..0000000000 --- a/config/spherical_mirror.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/spherical_mirror_gui.json b/config/spherical_mirror_gui.json new file mode 100644 index 0000000000..36828b0333 --- /dev/null +++ b/config/spherical_mirror_gui.json @@ -0,0 +1,65 @@ +{ + "version": 1, + "masterAddress": "127.0.0.1", + "nodes": [ + { + "address": "127.0.0.1", + "port": 20401, + "windows": [ + { + "fullscreen": false, + "name": "Spherical Projection", + "stereo": "none", + "draw2D": false, + "pos": { "x": 0, "y": 100 }, + "size": { "x": 1280, "y": 720 }, + "res": { "x": 2048, "y": 2048 }, + "viewports": [ + { + "mesh": "mesh/standard_16x9.data", + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "FisheyeProjection", + "fov": 180.0, + "quality": "2k", + "tilt": 30.0, + "background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 } + } + } + ] + }, + { + "fullscreen": false, + "name": "GUI", + "tags": [ "GUI" ], + "draw3D": false, + "stereo": "none", + "pos": { "x": 50, "y": 50 }, + "size": { "x": 1280, "y": 720 }, + "res": { "x": 2048, "y": 2048 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.06, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/spherical_mirror_gui.xml b/config/spherical_mirror_gui.xml deleted file mode 100644 index e1e84e46df..0000000000 --- a/config/spherical_mirror_gui.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/spout_output.json b/config/spout_output.json new file mode 100644 index 0000000000..03352217ab --- /dev/null +++ b/config/spout_output.json @@ -0,0 +1,36 @@ +{ + "version": 1, + "masterAddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "fullscreen": false, + "name": "OpenSpace", + "stereo": "none", + "size": { "x": 1024, "y": 1024 }, + "viewports": [ + { + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "SpoutOutputProjection", + "quality": "1k", + "mappingSpoutName": "OpenSpace", + "background": { "r": 0.1, "g": 0.1, "b": 0.1, "a": 1.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.06, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/spout_output.xml b/config/spout_output.xml deleted file mode 100644 index da4efdc48f..0000000000 --- a/config/spout_output.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/config/tekniska.json b/config/tekniska.json new file mode 100644 index 0000000000..27fe513cf9 --- /dev/null +++ b/config/tekniska.json @@ -0,0 +1,47 @@ +{ + "version": 1, + "masterAddress": "localhost", + "externalControlPort": 20500, + "settings": { + "display": { + "swapInterval": 1 + } + }, + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "name": "OpenSpace", + "border": false, + "fullscreen": false, + "stereo": "none", + "pos": { "x": 1920, "y": 900 }, + "size": { "x": 1920, "y": 1080 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } + } + ] +} \ No newline at end of file diff --git a/config/two_nodes.json b/config/two_nodes.json new file mode 100644 index 0000000000..fc3051cc09 --- /dev/null +++ b/config/two_nodes.json @@ -0,0 +1,64 @@ +{ + "version": 1, + "masterAddress": "127.0.0.1", + "nodes": [ + { + "address": "127.0.0.1", + "port": 20401, + "windows": [ + { + "fullscreen": false, + "pos": { "x": 0, "y": 300 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + }, + { + "address": "127.0.0.2", + "port": 20402, + "windows": [ + { + "fullscreen": false, + "pos": { "x": 640, "y": 300 }, + "size": { "x": 1280, "y": 720 }, + "viewports": [ + { + "tracked": true, + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "projection": { + "type": "PlanarProjection", + "fov": { + "hFov": 80.0, + "vFov": 50.534015846724 + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } + } + ] + } + ] + } + ], + "users": [ + { + "eyeSeparation": 0.065, + "pos": { "x": 0.0, "y": 0.0, "z": 4.0 } + } + ] +} \ No newline at end of file diff --git a/config/two_nodes.xml b/config/two_nodes.xml deleted file mode 100644 index e47946d5ef..0000000000 --- a/config/two_nodes.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 914316c5268299115ba79ea64db6ecef089d386a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Dec 2021 09:29:25 +0400 Subject: [PATCH 022/117] Update SGCT repository --- apps/OpenSpace/ext/sgct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 7bc13c11b6..f86a0023bd 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 7bc13c11b62ea1c00836e0fc33a964966aad58d7 +Subproject commit f86a0023bd3f5c60cb970da8def863a8b6ea7bba From 426c7fce4227f2a2648dc281802c7643f4511038 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Dec 2021 10:19:48 +0400 Subject: [PATCH 023/117] Update SGCT repository --- apps/OpenSpace/ext/sgct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index f86a0023bd..b4cb1b540f 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit f86a0023bd3f5c60cb970da8def863a8b6ea7bba +Subproject commit b4cb1b540f4f52aaa2e36c8b3fdc4f918993a5fa From 3f6b98ca3818b30c14fd4288834c66cc1663b5b8 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Dec 2021 14:11:57 +0400 Subject: [PATCH 024/117] Removing some unused parameters from the configuration script --- scripts/configuration_helper.lua | 58 ++++---------------------------- 1 file changed, 7 insertions(+), 51 deletions(-) diff --git a/scripts/configuration_helper.lua b/scripts/configuration_helper.lua index deb3b94651..e0df9dc444 100644 --- a/scripts/configuration_helper.lua +++ b/scripts/configuration_helper.lua @@ -10,8 +10,8 @@ sgct = {} sgct.config = {} --- This function takes a text definition for an SGCT configuration file and returns the path --- to a temporary file containing the string which SGCT can use +-- This function takes a text definition for an SGCT configuration file and returns the +-- path to a temporary file containing the string which SGCT can use function sgct.makeConfig(config) end -- Creates a configuration file similar to the default 'single.xml': @@ -27,14 +27,10 @@ function sgct.makeConfig(config) end -- shared: Determines whether the contents of the window should be shared using the SPOUT library [example: shared=true] {default: false} -- Expert settings: --- name: The name of the window [example: window="Foobar"] {default: "OpenSpace"} --- tags: A list of string tags that are passed to the window [example: tags ={"GUI"}] {default: {}} -- vsync: Whether the rendering speed is locked to the refreshrate [example: vsync=true] {default: false} -- refreshRate: If vsync is enabled, this is the target framerate [example: refreshRate=30] {default: infinity} -- stereo: Select the stereo rendering mode as supported by SGCT [example: stereo='anaglyph_red_cyan'] {default: 'none'} -- msaa: The multisampling anti-aliasing factor [example: msaa=8] {default: 4} --- eyeSep: The base eye separation in m [example: eyeSep=0.1] {default: 0.065} --- eyePos: The location of the user [example: eyePos={0.0, 1.0, 0.0}] {default: {0.0, 0.0, 0.0}} -- scene: Global settings to all scene objects (offset, orientation, scaling; each optional) -- [example: scene = {offset = {x = 1.0, y = 1.0, z = 2.0}, orientation = { yaw = 120, pitch = 15, roll = 0.0 }, scale = 10.0}] -- capture: Settings to configure the image capture [example: capture = { path = "./images"] @@ -62,14 +58,10 @@ function sgct.config.single(arg) end -- shared: Determines whether the contents of the window should be shared using the SPOUT library [example: shared=true] {default: false} -- Expert settings: --- name: The name of the window [example: window="Foobar"] {default: "OpenSpace"} --- tags: A list of string tags that are passed to the window [example: tags ={"GUI"}] {default: {}} -- vsync: Whether the rendering speed is locked to the refreshrate [example: vsync=true] {default: false} -- refreshRate: If vsync is enabled, this is the target framerate [example: refreshRate=30] {default: infinity} -- stereo: Select the stereo rendering mode as supported by SGCT [example: stereo='anaglyph_red_cyan'] {default: 'none'} -- msaa: The multisampling anti-aliasing factor [example: msaa=8] {default: 4} --- eyeSep: The base eye separation in m [example: eyeSep=0.1] {default: 0.065} --- eyePos: The location of the user [example: eyePos={0.0, 1.0, 0.0}] {default: {0.0, 0.0, 0.0}} -- scene: Global settings to all scene objects (offset, orientation, scaling; each optional) -- [example: scene = {offset = {x = 1.0, y = 1.0, z = 2.0}, orientation = { yaw = 120, pitch = 15, roll = 0.0 }, scale = 10.0}] -- capture: Settings to configure the image capture [example: capture = { path = "./images"] @@ -190,7 +182,7 @@ function generateWindow(arg) ]] end - local tags = "" + local tags if arg["tags"] then tags = table.concat(arg["tags"], ",") end @@ -202,7 +194,7 @@ function generateWindow(arg) fullScreen="]] .. tostring(arg["fullScreen"]) .. [[" numberOfSamples="]] .. arg["msaa"] .. [[" border="]] .. tostring(arg["border"]) .. [[" - name="]] .. arg["name"] .. [[" + name="OpenSpace" monitor="]] .. arg["monitor"] .. [[" tags="]] .. tags .. [[" > @@ -222,12 +214,8 @@ end function generateUser(arg) return [[ - - + + ]] end @@ -404,11 +392,6 @@ function generateSingleWindowConfig(arg) assert(type(arg["windowPos"][2]) == "number", "windowPos[2] must be a number") end - assert( - type(arg["name"]) == "string" or type(arg["name"]) == "nil", - "name must be a string or nil" - ) - assert( type(arg["fullScreen"]) == "boolean" or type(arg["fullScreen"]) == "nil", "fullScreen must be a boolean or nil" @@ -444,21 +427,6 @@ function generateSingleWindowConfig(arg) "stereo must be a boolean or nil" ) - assert( - type(arg["eyeSep"]) == "number" or type(arg["eyeSep"]) == "nil", - "eyeSep must be a number or nil" - ) - - assert( - type(arg["eyePos"]) == "table" or type(arg["eyePos"]) == "nil", - "eyePos must be a table or nil" - ) - if (type(arg["eyePos"]) == "table") then - assert(type(arg["eyePos"][1]) == "number", "eyePos[1] must be a number") - assert(type(arg["eyePos"][2]) == "number", "eyePos[2] must be a number") - assert(type(arg["eyePos"][3]) == "number", "eyePos[3] must be a number") - end - assert( type(arg["sgctDebug"]) == "boolean" or type(arg["sgctDebug"]) == "nil", "sgctDebug must be a boolean or nil" @@ -558,10 +526,6 @@ function generateSingleWindowConfig(arg) t[#t + 1] = "Spout" end - if arg["name"] == nil then - arg["name"] = "OpenSpace" - end - if arg["stereo"] == nil then arg["stereo"] = "none" end @@ -570,14 +534,6 @@ function generateSingleWindowConfig(arg) arg["windowPos"] = { 50, 50 } end - if arg["eyeSep"] == nil then - arg["eyeSep"] = 0.065 - end - - if arg["eyePos"] == nil then - arg["eyePos"] = { 0.0, 0.0, 0.0 } - end - if arg["sgctDebug"] == nil then arg["sgctDebug"] = false end @@ -627,7 +583,7 @@ end function sgct.makeConfig(config) - local configFile = os.tmpname() + local configFile = os.tmpname() .. ".xml" local file = io.open(configFile, "w+") From 2bb93a56de9ba9372288d8eb9bb1c1e408451447 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Dec 2021 14:38:06 +0400 Subject: [PATCH 025/117] Rename windowPos to pos for consistency; Additional cleanup of parameters --- scripts/configuration_helper.lua | 290 +++++-------------------------- 1 file changed, 43 insertions(+), 247 deletions(-) diff --git a/scripts/configuration_helper.lua b/scripts/configuration_helper.lua index e0df9dc444..837577a895 100644 --- a/scripts/configuration_helper.lua +++ b/scripts/configuration_helper.lua @@ -1,26 +1,20 @@ -- Helper functions that are useful to customize the openspace.cfg loading ---[[ -########################################################################################## - Public functions -########################################################################################## -]]-- +-- ####################################################################################### +-- ## Public functions ## +-- ####################################################################################### -- SGCT related functions sgct = {} sgct.config = {} --- This function takes a text definition for an SGCT configuration file and returns the --- path to a temporary file containing the string which SGCT can use -function sgct.makeConfig(config) end - -- Creates a configuration file similar to the default 'single.xml': -- The parameter is a table and can contain the follow attributes: -- first argument: horizontal window size {default: 1280} -- second argument: vertical window size {default: 720} -- res: A table containing the horizontal and vertical resolution [example: res={3840, 2160}] --- windowPos: The position of the window on the screen [example: windowPos={50, 100}] {default: {50, 50}} +-- pos: The position of the window on the screen [example: pos={50, 100}] {default: {50, 50}} -- fullScreen: Whether the application should run in exclusive full screen [example: fullScreen=true] {default: false} -- border: Whether the application should have window decorations (aka. border) [example: border=false] {default: true} -- monitor: Determines the monitor on which the application is started [example: monitor=2] {default: 0} @@ -33,7 +27,6 @@ function sgct.makeConfig(config) end -- msaa: The multisampling anti-aliasing factor [example: msaa=8] {default: 4} -- scene: Global settings to all scene objects (offset, orientation, scaling; each optional) -- [example: scene = {offset = {x = 1.0, y = 1.0, z = 2.0}, orientation = { yaw = 120, pitch = 15, roll = 0.0 }, scale = 10.0}] --- capture: Settings to configure the image capture [example: capture = { path = "./images"] -- sgctDebug: Determines whether a higher debug level in SGCT is enabled [example: sgctDebug=true] {default: false} -- fov: The field of view settings [example: fov={ left=20, right=30, up=10, down=50}] {default: { left=40.0, right=40.0, up=22.5, down=22.5}} -- tracked: Determines whether the aspect ratio of the camera defined at application startup should persist when the window is resized [example: tracked=false] {default: true} @@ -45,13 +38,15 @@ function sgct.makeConfig(config) end -- sgct.config.single(msaa=1) -> 1280x720 resolution without multisampling function sgct.config.single(arg) end + + -- Creates a configuration file similar to the default 'single_fisheye.xml' -- The parameter is a table and can contain the follow attributes: -- first argument: horizontal window size {default: 1280} -- second argument: vertical window size {default: 720} -- res: A table containing the horizontal and vertical resolution [example: res={3840, 2160}] --- windowPos: The position of the window on the screen [example: windowPos={50, 100}] {default: {50, 50}} +-- pos: The position of the window on the screen [example: pos={50, 100}] {default: {50, 50}} -- fullScreen: Whether the application should run in exclusive full screen [example: fullScreen=true] {default: false} -- border: Whether the application should have window decorations (aka. border) [example: border=false] {default: true} -- monitor: Determines the monitor on which the application is started [example: monitor=2] {default: 0} @@ -64,7 +59,6 @@ function sgct.config.single(arg) end -- msaa: The multisampling anti-aliasing factor [example: msaa=8] {default: 4} -- scene: Global settings to all scene objects (offset, orientation, scaling; each optional) -- [example: scene = {offset = {x = 1.0, y = 1.0, z = 2.0}, orientation = { yaw = 120, pitch = 15, roll = 0.0 }, scale = 10.0}] --- capture: Settings to configure the image capture [example: capture = { path = "./images"] -- sgctDebug: Determines whether a higher debug level in SGCT is enabled [example: sgctDebug=true] {default: false} -- fov: The field of view for the fisheye [example: fov=360] {default: 180} -- quality: The quality setting for the cubemap textures [example: quality="4k"] {default: "1k"} @@ -78,8 +72,6 @@ function sgct.config.single(arg) end -- sgct.config.fisheye(msaa=1) -> 1280x720 resolution without multisampling function sgct.config.fisheye(arg) end -function sgct.config.cube(arg) end - -- Global variable storing the name of the config function called at initialization sgctconfiginitializeString = "" @@ -105,23 +97,6 @@ end -function generateSingleViewport(lowerLeft, upperLeft, upperRight, tracked) - return -[[ - - - - - - - - - -]] -end - - - function generateFisheyeViewport(fov, quality, tilt, background, crop, offset, trackedSpecifier) local b = [[ - + ]]..resolution.. [[ ]].. @@ -227,46 +202,33 @@ function generateScene(arg) if scene == nil then return "" - else - local offset = nil - if scene["offset"] then - local o = scene["offset"] - offset = [[]] - end - - local orientation = nil - if scene["orientation"] then - local o = scene["orientation"] - orientation = [[]] - end - - local scale = nil - if scene["scale"] then - scale = [[]] - end - - local sceneString = " " - if offset then - sceneString = sceneString .. "\n " .. offset .. "\n" - end - if orientation then - sceneString = sceneString .. "\n " .. orientation .. "\n" - end - if scale then - sceneString = sceneString .. "\n " .. scale .. "\n" - end - - sceneString = sceneString .. " \n" - - return sceneString - - -- return [[ - -- - -- ]]..offset..[[ - -- ]]..orientation..[[ - -- ]]..scale..[[ - -- ]] end + + local offset = "" + if scene["offset"] then + local o = scene["offset"] + offset = [[]] + end + + local orientation = "" + if scene["orientation"] then + local o = scene["orientation"] + orientation = [[]] + end + + local scale = "" + if scene["scale"] then + scale = [[]] + end + + return +[[ + + ]] .. offset .. [[ + ]] .. orientation .. [[ + ]] .. scale .. [[ + +]] end @@ -295,39 +257,6 @@ end -function generateCapture(arg) - if arg["capture"] == nil then - return "" - else - local path = "" - if arg["capture"]["path"] then - path = 'path="' .. arg["capture"]["path"] .. '" ' - end - - local monoPath = "" - if arg["capture"]["monoPath"] then - path = 'monoPath="' .. arg["capture"]["monoPath"] .. '" ' - end - - local leftPath = "" - if arg["capture"]["leftPath"] then - path = 'leftPath="' .. arg["capture"]["leftPath"] .. '" ' - end - - local rightPath = "" - if arg["capture"]["rightPath"] then - path = 'rightPath="' .. arg["capture"]["rightPath"] .. '" ' - end - - local format = "" - if arg["capture"]["format"] then - path = 'format="' .. arg["capture"]["format"] .. '" ' - end - end -end - - - function generateCluster(arg) return [[ @@ -341,7 +270,6 @@ function generateCluster(arg) ]] .. arg["window"] ..[[ ]] .. arg["user"] .. [[ -]] .. (arg["capture"] or "") .. [[ ]] end @@ -375,21 +303,12 @@ function generateSingleWindowConfig(arg) end assert( - type(arg["windowSize"]) == "table" or type(arg["windowSize"]) == "nil", - "windowSize must be a table or nil" + type(arg["pos"]) == "table" or type(arg["pos"]) == "nil", + "pos must be a table or nil" ) - if (type(arg["windowSize"]) == "table") then - assert(type(arg["windowSize"][1]) == "number", "windowPos[1] must be a number") - assert(type(arg["windowSize"][2]) == "number", "windowPos[2] must be a number") - end - - assert( - type(arg["windowPos"]) == "table" or type(arg["windowPos"]) == "nil", - "windowPos must be a table or nil" - ) - if (type(arg["windowPos"]) == "table") then - assert(type(arg["windowPos"][1]) == "number", "windowPos[1] must be a number") - assert(type(arg["windowPos"][2]) == "number", "windowPos[2] must be a number") + if (type(arg["pos"]) == "table") then + assert(type(arg["pos"][1]) == "number", "pos[1] must be a number") + assert(type(arg["pos"][2]) == "number", "pos[2] must be a number") end assert( @@ -466,34 +385,6 @@ function generateSingleWindowConfig(arg) ) end - assert( - type(arg["capture"]) == "table" or type(arg["capture"]) == "nil", - "capture must be a table or nil" - ) - if type(arg["capture"]) == "table" then - local c = arg["capture"] - assert( - type(c["path"]) == "string" or type(c["path"]) == "nil", - "capture['path'] must be a string or nil" - ) - assert( - type(c["monoPath"]) == "string" or type(c["monoPath"]) == "nil", - "capture['monoPath'] must be a string or nil" - ) - assert( - type(c["leftPath"]) == "string" or type(c["leftPath"]) == "nil", - "capture['leftPath'] must be a string or nil" - ) - assert( - type(c["rightPath"]) == "string" or type(c["rightPath"]) == "nil", - "capture['rightPath'] must be a string or nil" - ) - assert( - type(c["format"]) == "string" or type(c["format"]) == "nil", - "capture['format'] must be a string or nil" - ) - end - assert(type(arg["viewport"]) == "string", "viewport must be a string") -- Then setting reasonable default values @@ -530,8 +421,8 @@ function generateSingleWindowConfig(arg) arg["stereo"] = "none" end - if arg["windowPos"] == nil then - arg["windowPos"] = { 50, 50 } + if arg["pos"] == nil then + arg["pos"] = { 50, 50 } end if arg["sgctDebug"] == nil then @@ -546,7 +437,6 @@ function generateSingleWindowConfig(arg) arg["settings"] = generateSettings(arg) arg["window"] = generateWindow(arg) arg["user"] = generateUser(arg) - arg["capture"] = generateCapture(arg) return generateCluster(arg) end @@ -555,12 +445,6 @@ end function normalizeArg(arg) arg = arg or {} - if (type(arg["windowSize"]) == "table") then - assert( - type(arg[1]) == "nil" and type(arg[2]) == "nil", - "Only windowSize or the first and second arguments can be set. Not both" - ) - end assert( type(arg[1]) == "number" or type(arg[1]) == "nil", "First argument must be a number or nil" @@ -618,8 +502,8 @@ function sgct.config.single(arg) local tanDefaultFov = math.tan(math.pi * defaultFov / 180) if (type(arg["windowSize"]) == "table") then - assert(type(arg["windowSize"][1]) == "number", "windowPos[1] must be a number") - assert(type(arg["windowSize"][2]) == "number", "windowPos[2] must be a number") + assert(type(arg["windowSize"][1]) == "number", "windowSize[1] must be a number") + assert(type(arg["windowSize"][2]) == "number", "windowSize[2] must be a number") local tanHorizontalFov = tanDefaultFov local tanVerticalFov = tanDefaultFov @@ -677,7 +561,6 @@ end function sgct.config.fisheye(arg) - arg = normalizeArg(arg) assert( @@ -772,90 +655,3 @@ function sgct.config.fisheye(arg) return sgct.makeConfig(generateSingleWindowConfig(arg)) end - - - -function sgct.config.cube(arg) - function getCubeWindow(location, res, size, trackedSpecifier) - local pos - local lowerLeft - local upperLeft - local upperRight - if location == 'left' then - pos = { 0, size[2] } - lowerLeft = { -1, -1, 1 } - upperLeft = { -1, 1, 1 } - upperRight = { -1, 1, -1 } - elseif location == 'right' then - pos = { 2 * size[1], size[2] } - lowerLeft = { 1, -1, -1 } - upperLeft = { 1, 1, -1 } - upperRight = { 1, 1, 1 } - elseif location == 'up' then - pos = { size[1], 0 } - lowerLeft = { 1, 1, -1 } - upperLeft = { 1, 1, 1 } - upperRight = { -1, 1, 1 } - elseif location == 'down' then - pos = { size[1], 2 * size[2] } - lowerLeft = { -1, -1, 1 } - upperLeft = { -1, -1, -1 } - upperRight = { 1, -1, -1 } - elseif location == 'back' then - pos = { 2 * size[1], 2 * size[2] } - lowerLeft = { 1, -1, 1 } - upperLeft = { 1, 1, 1 } - upperRight = { -1, 1, 1 } - elseif location == 'front' then - pos = { size[1], size[2] } - lowerLeft = { -1, -1, -1 } - upperLeft = { -1, 1, -1 } - upperRight = { 1, 1, -1 } - end - - arg = {} - arg["msaa"] = 8 - arg["border"] = false - arg["name"] = "OpenSpace_" .. location - arg["tags"] = { "Spout" } - arg["windowSize"] = size - arg["windowPos"] = pos - arg["res"] = { res, res } - arg["viewport"] = generateSingleViewport(lowerLeft, upperLeft, upperRight, trackedSpecifier) - - return generateWindow(arg) - end - - function getControlWindow(down, up, left, right, trackedSpecifier) - arg = {} - arg["viewport"] = generateSingleViewportFOV(down, up, left, right, trackedSpecifier) - return generateWindow(arg) - end - - sgctconfiginitializeString = "sgct.config.cube" - - res = 1024 - size = { 640, 360 } - - arg["scene"] = generateScene(arg) - arg["settings"] = generateSettings(arg) - if (arg["tracked"] ~= nil and arg["tracked"] == true) then - trackedSpecifier = "tracked=\"true\"" - else - trackedSpecifier = "tracked=\"false\"" - end - - arg["window"] = getControlWindow(16.875, 16.875, 30.0, 30.0, trackedSpecifier) .. - getCubeWindow('front', res, size, trackedSpecifier) .. - getCubeWindow('back', res, size, trackedSpecifier) .. - getCubeWindow('left', res, size, trackedSpecifier) .. - getCubeWindow('right', res, size, trackedSpecifier) .. - getCubeWindow('up', res, size, trackedSpecifier) .. - getCubeWindow('down', res, size, trackedSpecifier) - - arg["user"] = generateUser(arg) - arg["capture"] = generateCapture(arg) - - return sgct.makeConfig(generateCluster(arg)) -end - From c28387e9c05ca0c99ab7c4832761cab81bdf16fc Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Dec 2021 17:57:28 +0400 Subject: [PATCH 026/117] General cleanup of configuration helper --- scripts/configuration_helper.lua | 829 ++++++++++++++----------------- 1 file changed, 385 insertions(+), 444 deletions(-) diff --git a/scripts/configuration_helper.lua b/scripts/configuration_helper.lua index 837577a895..66418ad44e 100644 --- a/scripts/configuration_helper.lua +++ b/scripts/configuration_helper.lua @@ -82,193 +82,187 @@ sgctconfiginitializeString = "" ]]-- function generateSingleViewportFOV(down, up, left, right, tracked) - return -[[ - - - - - - - + return [[ + + + + + + + ]] end -function generateFisheyeViewport(fov, quality, tilt, background, crop, offset, trackedSpecifier) - local b = [[ - +function generateFisheyeViewport(fov, quality, tilt, background, crop, offset, tracked) + local background_fragment = [[ + ]] - local c = "" - if crop then - c = [[ - +local crop_fragment = "" +if crop then + crop_fragment = [[ + ]] - end + end - local o = "" - if offset then - o = [[ - + local offset_fragment = "" + if offset then + offset_fragment = [[ + ]] - end + end - return [[ - - - - -]]..b..[[ -]]..c..[[ -]]..o..[[ - - + return [[ + + + + +]] .. background_fragment .. [[ +]] .. crop_fragment .. [[ +]] .. offset_fragment .. [[ + + ]] end function generateWindow(arg) - local resolution = "" - if arg["res"] then - arg["res"][1] = arg["res"][1] or arg["windowSize"][1] - arg["res"][2] = arg["res"][2] or arg["windowSize"][2] + local resolution_fragment = "" + if arg["res"] then + arg["res"][1] = arg["res"][1] or arg["windowSize"][1] + arg["res"][2] = arg["res"][2] or arg["windowSize"][2] - resolution = -[[ - -]] - end + resolution_fragment = + [[]] + end - local tags - if arg["tags"] then - tags = table.concat(arg["tags"], ",") - end + local tags + if arg["tags"] then + tags = table.concat(arg["tags"], ",") + end - return + return [[ - - - - -]]..resolution.. -[[ -]].. -arg["viewport"].. -[[ - + + + + +]] .. resolution_fragment .. [[ +]] .. arg["viewport"].. [[ + ]] end function generateUser(arg) - return [[ - - - + return [[ + + + ]] end function generateScene(arg) - local scene = arg["scene"] + local scene = arg["scene"] - if scene == nil then - return "" - end + if scene == nil then + return "" + end - local offset = "" - if scene["offset"] then - local o = scene["offset"] - offset = [[]] - end + local offset_fragment = "" + if scene["offset"] then + local o = scene["offset"] + offset_fragment = [[]] + end - local orientation = "" - if scene["orientation"] then - local o = scene["orientation"] - orientation = [[]] - end + local orientation_fragment = "" + if scene["orientation"] then + local o = scene["orientation"] + orientation_fragment = [[]] + end - local scale = "" - if scene["scale"] then - scale = [[]] - end + local scale_fragment = "" + if scene["scale"] then + scale_fragment = [[]] + end - return + return [[ - - ]] .. offset .. [[ - ]] .. orientation .. [[ - ]] .. scale .. [[ - + +]] .. offset_fragment .. [[ +]] .. orientation_fragment .. [[ +]] .. scale_fragment .. [[ + ]] end function generateSettings(arg) - local v - if arg["vsync"] then - v = 1 - else - v = 0 - end + local v + if arg["vsync"] then + v = 1 + else + v = 0 + end - local refresh = "" - if arg["refreshRate"] then - refresh = "refreshRate=\"" .. arg["refreshRate"] .. "\" " - end + local refresh_fragment = "" + if arg["refreshRate"] then + refresh_fragment = "refreshRate=\"" .. arg["refreshRate"] .. "\" " + end - return [[ - - - + return [[ + + + ]] end function generateCluster(arg) - return [[ + return [[ ]] .. (arg["settings"] or "") .. [[ ]] .. (arg["scene"] or "") .. [[ - + ]] .. arg["window"] ..[[ - + ]] .. arg["user"] .. [[ ]] @@ -277,381 +271,328 @@ end function generateSingleWindowConfig(arg) - -- First some type checking + assert( + type(arg["res"]) == "table" or type(arg["res"]) == "nil", + "res must be a table or nil" + ) + if (type(arg["res"]) == "table") then + assert(type(arg["res"][1]) == "number", "res[1] must be a number") + assert(type(arg["res"][2]) == "number", "res[2] must be a number") + end + + assert( + type(arg["shared"]) == "boolean" or type(arg["shared"]) == "nil", + "shared must be a boolean or nil" + ) + + assert( + type(arg["tags"]) == "table" or type(arg["tags"]) == "nil", + "tags must be a table or nil" + ) + if (type(arg["tags"]) == "table") and (next(arg["tags"]) ~= nil) then + for index, value in ipairs(arg["tags"]) do + assert(type(value) == "string", "Each tag must be a string") + end + end + + assert( + type(arg["pos"]) == "table" or type(arg["pos"]) == "nil", + "pos must be a table or nil" + ) + if (type(arg["pos"]) == "table") then + assert(type(arg["pos"][1]) == "number", "pos[1] must be a number") + assert(type(arg["pos"][2]) == "number", "pos[2] must be a number") + end + + assert( + type(arg["fullScreen"]) == "boolean" or type(arg["fullScreen"]) == "nil", + "fullScreen must be a boolean or nil" + ) + + assert( + type(arg["monitor"]) == "number" or type(arg["monitor"]) == "nil", + "monitor must be a number or nil" + ) + + assert( + type(arg["border"]) == "boolean" or type(arg["border"]) == "nil", + "border must be a boolean or nil" + ) + + assert( + type(arg["msaa"]) == "number" or type(arg["msaa"]) == "nil", + "msaa must be a number or nil" + ) + + assert( + type(arg["vsync"]) == "boolean" or type(arg["vsync"]) == "nil", + "vsync must be a boolean or nil" + ) + + assert( + type(arg["refreshRate"]) == "number" or type(arg["refreshRate"]) == "nil", + "refreshRate must be a number or nil" + ) + + assert( + type(arg["stereo"]) == "string" or type(arg["stereo"]) == "nil", + "stereo must be a boolean or nil" + ) + + assert( + type(arg["sgctDebug"]) == "boolean" or type(arg["sgctDebug"]) == "nil", + "sgctDebug must be a boolean or nil" + ) + + assert( + type(arg["scene"]) == "table" or type(arg["scene"]) == "nil", + "scene must be a table or nil" + ) + if type(arg["scene"]) == "table" then + local offset = arg["scene"]["offset"] assert( - type(arg["res"]) == "table" or type(arg["res"]) == "nil", - "res must be a table or nil" + type(offset) == "table" or type(offset) == "nil", + "scene['offset'] must be a table or nil" ) - if (type(arg["res"]) == "table") then - assert(type(arg["res"][1]) == "number", "res[1] must be a number") - assert(type(arg["res"][2]) == "number", "res[2] must be a number") + if type(offset) == "table" then + assert(type(offset["x"]) == "number", "scene['offset']['x'] must be a number") + assert(type(offset["y"]) == "number", "scene['offset']['y'] must be a number") + assert(type(offset["z"]) == "number", "scene['offset']['z'] must be a number") end + local orientation = arg["scene"]["orientation"] assert( - type(arg["shared"]) == "boolean" or type(arg["shared"]) == "nil", - "shared must be a boolean or nil" + type(orientation) == "table" or type(orientation) == "nil", + "scene['orientation] must be a table or nil" ) + if type(orientation) == "table" then + assert(type(orientation["yaw"]) == "number", "orientation['yaw'] must be a number") + assert(type(orientation["pitch"]) == "number", "orientation['pitch'] must be a number") + assert(type(orientation["roll"]) == "number", "orientation['roll'] must be a number") + end + local scale = arg["scene"]["scale"] assert( - type(arg["tags"]) == "table" or type(arg["tags"]) == "nil", - "tags must be a table or nil" + type(scale) == "number" or type(scale) == "nil", + "scene['scale'] must be a number or nil" ) - if (type(arg["tags"]) == "table") and (next(arg["tags"]) ~= nil) then - for index, value in ipairs(arg["tags"]) do - assert(type(value) == "string", "Each tag must be a string") - end - end + end - assert( - type(arg["pos"]) == "table" or type(arg["pos"]) == "nil", - "pos must be a table or nil" - ) - if (type(arg["pos"]) == "table") then - assert(type(arg["pos"][1]) == "number", "pos[1] must be a number") - assert(type(arg["pos"][2]) == "number", "pos[2] must be a number") - end + assert(type(arg["viewport"]) == "string", "viewport must be a string") - assert( - type(arg["fullScreen"]) == "boolean" or type(arg["fullScreen"]) == "nil", - "fullScreen must be a boolean or nil" - ) + -- Then setting reasonable default values + arg["vsync"] = arg["vsync"] or false + arg["fullScreen"] = arg["fullScreen"] or false + arg["monitor"] = arg["monitor"] or 0 + arg["tags"] = arg["tags"] or {} + arg["msaa"] = arg["msaa"] or 4 + arg["border"] = arg["border"] or true + arg["stereo"] = arg["stereo"] or "none" + arg["pos"] = arg["pos"] or { 50, 50 } + arg["sgctDebug"] = arg["sgctDebug"] or false + arg["windowSize"] = arg["windowSize"] or { 1280, 720 } - assert( - type(arg["monitor"]) == "number" or type(arg["monitor"]) == "nil", - "monitor must be a number or nil" - ) + if arg["shared"] then + local t = arg["tags"] + t[#t + 1] = "Spout" + end - assert( - type(arg["border"]) == "boolean" or type(arg["border"]) == "nil", - "border must be a boolean or nil" - ) - assert( - type(arg["msaa"]) == "number" or type(arg["msaa"]) == "nil", - "msaa must be a number or nil" - ) + arg["scene"] = generateScene(arg) + arg["settings"] = generateSettings(arg) + arg["window"] = generateWindow(arg) + arg["user"] = generateUser(arg) - assert( - type(arg["vsync"]) == "boolean" or type(arg["vsync"]) == "nil", - "vsync must be a boolean or nil" - ) - - assert( - type(arg["refreshRate"]) == "number" or type(arg["refreshRate"]) == "nil", - "refreshRate must be a number or nil" - ) - - assert( - type(arg["stereo"]) == "string" or type(arg["stereo"]) == "nil", - "stereo must be a boolean or nil" - ) - - assert( - type(arg["sgctDebug"]) == "boolean" or type(arg["sgctDebug"]) == "nil", - "sgctDebug must be a boolean or nil" - ) - - assert( - type(arg["scene"]) == "table" or type(arg["scene"]) == "nil", - "scene must be a table or nil" - ) - if type(arg["scene"]) == "table" then - local offset = arg["scene"]["offset"] - assert( - type(offset) == "table" or type(offset) == "nil", - "scene['offset'] must be a table or nil" - ) - if type(offset) == "table" then - assert(type(offset["x"]) == "number", "scene['offset']['x'] must be a number") - assert(type(offset["y"]) == "number", "scene['offset']['y'] must be a number") - assert(type(offset["z"]) == "number", "scene['offset']['z'] must be a number") - end - - local orientation = arg["scene"]["orientation"] - assert( - type(orientation) == "table" or type(orientation) == "nil", - "scene['orientation] must be a table or nil" - ) - if type(orientation) == "table" then - assert(type(orientation["yaw"]) == "number", "orientation['yaw'] must be a number") - assert(type(orientation["pitch"]) == "number", "orientation['pitch'] must be a number") - assert(type(orientation["roll"]) == "number", "orientation['roll'] must be a number") - end - - local scale = arg["scene"]["scale"] - assert( - type(scale) == "number" or type(scale) == "nil", - "scene['scale'] must be a number or nil" - ) - end - - assert(type(arg["viewport"]) == "string", "viewport must be a string") - - -- Then setting reasonable default values - if arg["vsync"] == nil then - arg["vsync"] = false - end - - if arg["fullScreen"] == nil then - arg["fullScreen"] = false - end - - if arg["monitor"] == nil then - arg["monitor"] = 0 - end - - if arg["tags"] == nil then - arg["tags"] = {} - end - - if arg["msaa"] == nil then - arg["msaa"] = 4 - end - - if arg["border"] == nil then - arg["border"] = true - end - - if arg["shared"] then - local t = arg["tags"] - t[#t + 1] = "Spout" - end - - if arg["stereo"] == nil then - arg["stereo"] = "none" - end - - if arg["pos"] == nil then - arg["pos"] = { 50, 50 } - end - - if arg["sgctDebug"] == nil then - arg["sgctDebug"] = false - end - - if not arg["windowSize"] then - arg["windowSize"] = {1280, 720} - end - - arg["scene"] = generateScene(arg) - arg["settings"] = generateSettings(arg) - arg["window"] = generateWindow(arg) - arg["user"] = generateUser(arg) - - return generateCluster(arg) + return generateCluster(arg) end function normalizeArg(arg) - arg = arg or {} + arg = arg or {} - assert( - type(arg[1]) == "number" or type(arg[1]) == "nil", - "First argument must be a number or nil" - ) - assert( - type(arg[2]) == "number" or type(arg[2]) == "nil", - "Second argument must be a number or nil" - ) - if (type(arg[1]) == "number") then - if (type(arg[2]) == "nil") then - arg[2] = arg[1] * 9/16 - end - arg["windowSize"] = { arg[1], arg[2] } - arg[1] = nil - arg[2] = nil + assert( + type(arg[1]) == "number" or type(arg[1]) == "nil", + "First argument must be a number or nil" + ) + assert( + type(arg[2]) == "number" or type(arg[2]) == "nil", + "Second argument must be a number or nil" + ) + if (type(arg[1]) == "number") then + if (type(arg[2]) == "nil") then + arg[2] = arg[1] * 9/16 end + arg["windowSize"] = { arg[1], arg[2] } + arg[1] = nil + arg[2] = nil + end - return arg + return arg end function sgct.makeConfig(config) - local configFile = os.tmpname() .. ".xml" - - local file = io.open(configFile, "w+") - - file:write(config) - - io.close(file) - return configFile + local configFile = os.tmpname() .. ".xml" + local file = io.open(configFile, "w+") + file:write(config) + io.close(file) + return configFile end function sgct.config.single(arg) - arg = normalizeArg(arg) + arg = normalizeArg(arg) - assert( - type(arg["windowSize"]) == "table" or type(arg["windowSize"]) == "nil", - "windowSize must be a table or nil" - ) + assert( + type(arg["windowSize"]) == "table" or type(arg["windowSize"]) == "nil", + "windowSize must be a table or nil" + ) - assert( - type(arg["fov"]) == "table" or type(arg["fov"]) == "nil", - "fov must be a table or nil" - ) - if (type(arg["fov"]) == "table") then - assert(type(arg["fov"]["left"]) == "number", "fov['left'] must be a number") - assert(type(arg["fov"]["right"]) == "number", "fov['right'] must be a number") - assert(type(arg["fov"]["up"]) == "number", "fov['up'] must be a number") - assert(type(arg["fov"]["down"]) == "number", "fov['down'] must be a number") + assert( + type(arg["fov"]) == "table" or type(arg["fov"]) == "nil", + "fov must be a table or nil" + ) + if (type(arg["fov"]) == "table") then + assert(type(arg["fov"]["left"]) == "number", "fov['left'] must be a number") + assert(type(arg["fov"]["right"]) == "number", "fov['right'] must be a number") + assert(type(arg["fov"]["up"]) == "number", "fov['up'] must be a number") + assert(type(arg["fov"]["down"]) == "number", "fov['down'] must be a number") + else + local defaultFov = 40 + local defaultRatio = 16/9 -- comes from default res 1280 x 720 + local tanDefaultFov = math.tan(math.pi * defaultFov / 180) + + if (type(arg["windowSize"]) == "table") then + assert(type(arg["windowSize"][1]) == "number", "windowSize[1] must be a number") + assert(type(arg["windowSize"][2]) == "number", "windowSize[2] must be a number") + local tanHorizontalFov = tanDefaultFov + local tanVerticalFov = tanDefaultFov + + local ratio = arg["windowSize"][1] / arg["windowSize"][2] + + -- ratio between w and h should be + -- same as tan(horizontalFov) and tan(verticalFov) + + if (ratio > 1) then + tanVerticalFov = tanHorizontalFov / ratio + else + tanHorizontalFov = tanVerticalFov * ratio + end + + -- sgct expects fov in degrees + arg["fov"] = { + down = 180 * math.atan(tanVerticalFov) / math.pi, + up = 180 * math.atan(tanVerticalFov) / math.pi, + left = 180 * math.atan(tanHorizontalFov) / math.pi, + right = 180 * math.atan(tanHorizontalFov) / math.pi + } else - local defaultFov = 40 - local defaultRatio = 16/9 -- comes from default res 1280 x 720 - local tanDefaultFov = math.tan(math.pi * defaultFov / 180) - - if (type(arg["windowSize"]) == "table") then - assert(type(arg["windowSize"][1]) == "number", "windowSize[1] must be a number") - assert(type(arg["windowSize"][2]) == "number", "windowSize[2] must be a number") - local tanHorizontalFov = tanDefaultFov - local tanVerticalFov = tanDefaultFov - - local ratio = arg["windowSize"][1] / arg["windowSize"][2] - - -- ratio between w and h should be - -- same as tan(horizontalFov) and tan(verticalFov) - - if (ratio > 1) then - tanVerticalFov = tanHorizontalFov / ratio - else - tanHorizontalFov = tanVerticalFov * ratio - end - - -- sgct expects fov in degrees - arg["fov"] = { - down = 180 * math.atan(tanVerticalFov) / math.pi, - up = 180 * math.atan(tanVerticalFov) / math.pi, - left = 180 * math.atan(tanHorizontalFov) / math.pi, - right = 180 * math.atan(tanHorizontalFov) / math.pi - } - else - -- sgct expects fov in degrees - arg["fov"] = { - down = 180 * math.atan(tanDefaultFov / defaultRatio) / math.pi, - up = 180 * math.atan(tanDefaultFov / defaultRatio) / math.pi, - left = 180 * math.atan(tanDefaultFov) / math.pi, - right = 180 * math.atan(tanDefaultFov) / math.pi - } - end + -- sgct expects fov in degrees + arg["fov"] = { + down = 180 * math.atan(tanDefaultFov / defaultRatio) / math.pi, + up = 180 * math.atan(tanDefaultFov / defaultRatio) / math.pi, + left = 180 * math.atan(tanDefaultFov) / math.pi, + right = 180 * math.atan(tanDefaultFov) / math.pi + } end + end - assert( - type(arg["tracked"]) == "boolean" or type(arg["tracked"]) == "nil", - "tracked must be a boolean or nil" - ) - sgctconfiginitializeString = "sgct.config.single" + assert( + type(arg["tracked"]) == "boolean" or type(arg["tracked"]) == "nil", + "tracked must be a boolean or nil" + ) + sgctconfiginitializeString = "sgct.config.single" - local trackedSpecifier = "tracked=\"true\"" + arg["tracked"] = arg["tracked"] or false - if (arg["tracked"] ~= nil and arg["tracked"] == false) then - trackedSpecifier = "tracked=\"false\"" - end - - arg["viewport"] = generateSingleViewportFOV( - arg["fov"]["down"], - arg["fov"]["up"], - arg["fov"]["left"], - arg["fov"]["right"], - trackedSpecifier - ) - return sgct.makeConfig(generateSingleWindowConfig(arg)) + arg["viewport"] = generateSingleViewportFOV( + arg["fov"]["down"], + arg["fov"]["up"], + arg["fov"]["left"], + arg["fov"]["right"], + arg["tracked"] + ) + return sgct.makeConfig(generateSingleWindowConfig(arg)) end function sgct.config.fisheye(arg) - arg = normalizeArg(arg) + arg = normalizeArg(arg) + assert( + type(arg["fov"]) == "number" or type(arg["fov"]) == "nil", + "fov must be a number or nil" + ) + + assert( + type(arg["quality"]) == "string" or type(arg["quality"]) == "nil", + "quality must be a string or nil" + ) + + assert( + type(arg["tilt"]) == "number" or type(arg["tilt"]) == "nil", + "tilt must be a number or nil" + ) + + assert( + type(arg["background"]) == "table" or type(arg["background"]) == "nil", + "background must be a table or nil" + ) + if type(arg["background"]) == "table" then + assert(type(background["r"]) == "number", "backgroud['r'] must be a number") + assert(type(background["g"]) == "number", "backgroud['g'] must be a number") + assert(type(background["b"]) == "number", "backgroud['b'] must be a number") + assert(type(background["a"]) == "number", "backgroud['a'] must be a number") + end + + assert( + type(arg["crop"]) == "table" or type(arg["crop"]) == "nil", + "crop must be a table or nil" + ) + if type(arg["crop"]) == "table" then assert( - type(arg["fov"]) == "number" or type(arg["fov"]) == "nil", - "fov must be a number or nil" + type(arg["crop"]["left"]) == "number", "crop['left'] must be a number" ) - assert( - type(arg["quality"]) == "string" or type(arg["quality"]) == "nil", - "quality must be a string or nil" + type(arg["crop"]["right"]) == "number", "crop['right'] must be a number" ) - assert( - type(arg["tilt"]) == "number" or type(arg["tilt"]) == "nil", - "tilt must be a number or nil" + type(arg["crop"]["top"]) == "number", "crop['top'] must be a number" ) - assert( - type(arg["background"]) == "table" or type(arg["background"]) == "nil", - "background must be a table or nil" + type(arg["crop"]["bottom"]) == "number", "crop['bottom'] must be a number" ) - if type(arg["background"]) == "table" then - assert(type(background["r"]) == "number", "backgroud['r'] must be a number") - assert(type(background["g"]) == "number", "backgroud['g'] must be a number") - assert(type(background["b"]) == "number", "backgroud['b'] must be a number") - assert(type(background["a"]) == "number", "backgroud['a'] must be a number") - end + end - assert( - type(arg["crop"]) == "table" or type(arg["crop"]) == "nil", - "crop must be a table or nil" - ) - if type(arg["crop"]) == "table" then - assert( - type(arg["crop"]["left"]) == "number", "crop['left'] must be a number" - ) - assert( - type(arg["crop"]["right"]) == "number", "crop['right'] must be a number" - ) - assert( - type(arg["crop"]["top"]) == "number", "crop['top'] must be a number" - ) - assert( - type(arg["crop"]["bottom"]) == "number", "crop['bottom'] must be a number" - ) - end + assert( + type(arg["offset"]) == "table" or type(arg["offset"]) == "nil", + "offset must be a table or nil" + ) + if type(arg["offset"]) == "table" then + assert(type(arg["offset"]["x"]) == "number", "offset['x'] must be a number") + assert(type(arg["offset"]["y"]) == "number", "offset['y'] must be a number") + assert(type(arg["offset"]["z"]) == "number", "offset['z'] must be a number") + end - assert( - type(arg["offset"]) == "table" or type(arg["offset"]) == "nil", - "offset must be a table or nil" - ) - if type(arg["offset"]) == "table" then - assert(type(arg["offset"]["x"]) == "number", "offset['x'] must be a number") - assert(type(arg["offset"]["y"]) == "number", "offset['y'] must be a number") - assert(type(arg["offset"]["z"]) == "number", "offset['z'] must be a number") - end + sgctconfiginitializeString = "sgct.config.fisheye" - sgctconfiginitializeString = "sgct.config.fisheye" + arg["fov"] = arg["fov"] or 180.0 + arg["quality"] = arg["quality"] or "1k" + arg["tilt"] = arg["tilt"] or 90.0 + arg["background"] = arg["background"] or { r = 0.0, g = 0.0, b = 0.0, a = 1.0 } + arg["tracked"] = arg["tracked"] or false - if arg["fov"] == nil then - arg["fov"] = 180 - end + arg["viewport"] = generateFisheyeViewport( + arg["fov"], + arg["quality"], + arg["tilt"], + arg["background"], + arg["crop"], + arg["offset"], + arg["tracked"] + ) - if arg["quality"] == nil then - arg["quality"] = "1k" - end - - if arg["tilt"] == nil then - arg["tilt"] = 90 - end - - if arg["background"] == nil then - arg["background"] = { r = 0.0, g = 0.0, b = 0.0, a = 1.0 } - end - - local trackedSpecifier = "" - if (arg["tracked"] ~= nil and arg["tracked"] == true) then - trackedSpecifier = "tracked=\"true\"" - else - trackedSpecifier = "tracked=\"false\"" - end - - arg["viewport"] = generateFisheyeViewport( - arg["fov"], - arg["quality"], - arg["tilt"], - arg["background"], - arg["crop"], - arg["offset"], - trackedSpecifier - ) - - return sgct.makeConfig(generateSingleWindowConfig(arg)) + return sgct.makeConfig(generateSingleWindowConfig(arg)) end From 79cca73abff0ed2596feddf6e68b795c39f75bb6 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Dec 2021 19:55:25 +0400 Subject: [PATCH 027/117] First version of generating JSON --- scripts/configuration_helper.lua | 226 +++++++++++++++++-------------- 1 file changed, 121 insertions(+), 105 deletions(-) diff --git a/scripts/configuration_helper.lua b/scripts/configuration_helper.lua index 66418ad44e..4520ae77be 100644 --- a/scripts/configuration_helper.lua +++ b/scripts/configuration_helper.lua @@ -83,62 +83,75 @@ sgctconfiginitializeString = "" function generateSingleViewportFOV(down, up, left, right, tracked) return [[ - - - - - - - - +{ + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "tracked": ]] .. tostring(tracked) .. [[, + "projection": { + "type": "PlanarProjection", + "fov": { + "left": ]] .. left .. [[, + "right": ]] .. right .. [[, + "up": ]] .. up .. [[, + "down": ]] .. down .. [[ + }, + "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } + } +} ]] end -function generateFisheyeViewport(fov, quality, tilt, background, crop, offset, tracked) +function generateFisheyeViewport(fov, quality, tilt, background, crop, offset, tracked) local background_fragment = [[ - -]] +{ + "r": ]] .. background["r"] .. [[, + "g": ]] .. background["g"] .. [[, + "b": ]] .. background["b"] .. [[, + "a": ]] .. background["a"] .. [[ +}]] local crop_fragment = "" -if crop then - crop_fragment = [[ - -]] + if crop then + crop_fragment = [[ +{ + "left": ]] .. crop["left"] .. [[, + "right": ]] .. crop["right"] .. [[, + "top": ]] .. crop["top"] .. [[, + "bottom": ]] .. crop["bottom"] .. [[ +}]] + else + crop_fragment = "{}" end local offset_fragment = "" if offset then offset_fragment = [[ - -]] +{ + "x": ]] .. offset["x"] .. [[, + "y": ]] .. offset["y"] .. [[, + "z": ]] .. offset["z"] .. [[ +}]] + else + offset_fragment = "{}" end return [[ - - - - -]] .. background_fragment .. [[ -]] .. crop_fragment .. [[ -]] .. offset_fragment .. [[ - - +{ + "pos": { "x": 0.0, "y": 0.0 }, + "size": { "x": 1.0, "y": 1.0 }, + "tracked": ]] .. tostring(tracked) .. [[, + "projection": { + "type": "FisheyeProjection", + "fov": ]] .. fov .. [[, + "quality": "]] .. quality .. [[", + "tilt": ]] .. tilt .. [[, + "background": ]] .. background_fragment .. [[, + "crop": ]] .. crop_fragment .. [[, + "offset": ]] .. offset_fragment .. [[ + } +} ]] end @@ -151,7 +164,7 @@ function generateWindow(arg) arg["res"][2] = arg["res"][2] or arg["windowSize"][2] resolution_fragment = - [[]] + [[ "res": { "x": ]] .. arg["res"][1] .. [[ "y": ]] .. arg["res"][1] .. [[},]] end local tags @@ -159,23 +172,22 @@ function generateWindow(arg) tags = table.concat(arg["tags"], ",") end - - return -[[ - - - - -]] .. resolution_fragment .. [[ -]] .. arg["viewport"].. [[ - + return [[ +{ + "name": "OpenSpace", + "fullscreen": ]] .. tostring(arg["fullScreen"]) .. [[, + "msaa": ]] .. arg["msaa"] .. [[, + "border": ]] .. tostring(arg["border"]) .. [[, + "monitor": ]] .. arg["monitor"] .. [[, + "tags": [ ]] .. tags .. [[ ], + "stereo": "]] .. arg["stereo"] .. [[", + "size": { "x": ]] .. arg["windowSize"][1] .. [[, "y": ]] .. arg["windowSize"][2] .. [[ }, + "pos": { "x": ]] .. arg["pos"][1] .. [[, "y": ]] .. arg["pos"][2] .. [[ }, + ]] .. resolution_fragment .. [[ + "viewports": [ + ]] .. arg["viewport"] .. [[ + ] +} ]] end @@ -183,9 +195,10 @@ end function generateUser(arg) return [[ - - - +{ + "eyeSeparation": 0.06, + "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } +} ]] end @@ -195,33 +208,27 @@ function generateScene(arg) local scene = arg["scene"] if scene == nil then - return "" + return "{}" end - local offset_fragment = "" - if scene["offset"] then - local o = scene["offset"] - offset_fragment = [[]] - end + local offset = scene["offset"] or { x = 0.0, y = 0.0, z = 0.0 } + local orientation = scene["orientation"] or { yaw = 0.0, pitch = 0.0, roll = 0.0 } + local scale = scene["scale"] or 1.0 - local orientation_fragment = "" - if scene["orientation"] then - local o = scene["orientation"] - orientation_fragment = [[]] - end - - local scale_fragment = "" - if scene["scale"] then - scale_fragment = [[]] - end - - return -[[ - -]] .. offset_fragment .. [[ -]] .. orientation_fragment .. [[ -]] .. scale_fragment .. [[ - + return [[ +{ + "offset": { + "x": ]] .. offset["x"] .. [[, + "y": ]] .. offset["y"] .. [[, + "z": ]] .. offset["z"] .. [[ + }, + "orientation": { + "yaw": ]] .. orientation["yaw"] .. [[, + "pitch": ]] .. orientation["pitch"] .. [[, + "roll": ]] .. orientation["roll"] .. [[ + }, + "scale": ]] .. scale .. [[ +} ]] end @@ -237,15 +244,16 @@ function generateSettings(arg) local refresh_fragment = "" if arg["refreshRate"] then - refresh_fragment = "refreshRate=\"" .. arg["refreshRate"] .. "\" " + refresh_fragment = [[ "refreshRate": ]] .. arg["refreshRate"] .. "," end - - return [[ - - - +{ + "display": { + ]] .. refresh_fragment .. [[ + "swapInterval": ]] .. v .. [[ + } +} ]] end @@ -253,18 +261,25 @@ end function generateCluster(arg) return [[ - - -]] .. (arg["settings"] or "") .. [[ -]] .. (arg["scene"] or "") .. [[ - -]] .. arg["window"] ..[[ - -]] .. arg["user"] .. [[ - +{ + "version": 1, + "masterAddress": "127.0.0.1", + "debug": ]] .. tostring(arg["sgctDebug"]) .. [[, + "settings": ]] .. (arg["settings"] or "{}") .. [[, + "scene": ]] .. (arg["scene"] or "{}") .. [[, + "nodes": [ + { + "address": "127.0.0.1", + "port": 20401, + "windows": [ + ]] .. arg["window"] .. [[ + ] + } + ], + "users": [ + ]] .. arg["user"] .. [[ + ] +} ]] end @@ -385,7 +400,7 @@ function generateSingleWindowConfig(arg) arg["fullScreen"] = arg["fullScreen"] or false arg["monitor"] = arg["monitor"] or 0 arg["tags"] = arg["tags"] or {} - arg["msaa"] = arg["msaa"] or 4 + arg["msaa"] = arg["msaa"] or 1 arg["border"] = arg["border"] or true arg["stereo"] = arg["stereo"] or "none" arg["pos"] = arg["pos"] or { 50, 50 } @@ -432,7 +447,8 @@ end function sgct.makeConfig(config) - local configFile = os.tmpname() .. ".xml" + -- local configFile = os.tmpname() .. ".json" + local configFile = "C:/Development/testing.json" local file = io.open(configFile, "w+") file:write(config) io.close(file) From debcb43ade7863d4bbc0e42b377087b07ea22fe3 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 19 Dec 2021 21:04:01 +0400 Subject: [PATCH 028/117] Feature/assets (#1784) General overhaul of the Asset loading system --- apps/OpenSpace/ext/sgct | 2 +- data/assets/examples/urlsynchronization.asset | 6 - data/assets/scene/digitaluniverse/hdf.asset | 8 +- .../exoplanets/exoplanets_textures.asset | 7 +- .../dwarf_planets/pluto/charon/charon.asset | 8 +- .../dwarf_planets/pluto/pluto.asset | 7 +- .../pluto/pluto_globelabels.asset | 7 - .../pluto/pluto_trail_kepler.asset | 52 +- .../missions/apollo/11/apollo11.asset | 19 +- .../solarsystem/missions/apollo/11/lem.asset | 9 +- .../missions/apollo/11/models.asset | 8 - .../missions/apollo/15/apollo15.asset | 8 +- .../missions/apollo/17/boulder_models.asset | 8 - .../missions/apollo/17/bouldersstation2.asset | 8 +- .../missions/apollo/17/bouldersstation6.asset | 8 +- .../missions/apollo/17/bouldersstation7.asset | 8 +- .../solarsystem/missions/apollo/17/lem.asset | 9 +- .../missions/apollo/8/launch_model.asset | 8 +- .../solarsystem/missions/apollo/8/model.asset | 8 +- .../missions/apollo/csm_model.asset | 8 - .../missions/apollo/lem_model.asset | 8 - .../solarsystem/missions/dawn/ceres.asset | 11 +- .../solarsystem/missions/dawn/dawn.asset | 8 +- .../missions/dawn/dawn_kernels.asset | 8 - .../solarsystem/missions/dawn/vesta.asset | 8 +- .../solarsystem/missions/jwst/horizons.asset | 8 - .../solarsystem/missions/jwst/jwst.asset | 8 +- .../solarsystem/missions/jwst/kernels.asset | 8 - .../solarsystem/missions/jwst/model.asset | 8 - .../solarsystem/missions/jwst/trail.asset | 16 +- .../missions/jwst/transforms.asset | 8 +- .../missions/osirisrex/bennu.asset | 8 +- .../missions/osirisrex/bennu_projection.asset | 7 +- .../missions/osirisrex/models.asset | 8 - .../solarsystem/missions/voyager/model.asset | 8 - .../missions/voyager/voyager1.asset | 8 +- .../missions/voyager/voyager2.asset | 8 +- .../solarsystem/planets/earth/earth.asset | 8 +- .../planets/earth/earth_globelabels.asset | 7 - .../planets/earth/earth_textures.asset | 7 - .../planets/earth/lagrange_points/L1.asset | 16 +- .../planets/earth/lagrange_points/L2.asset | 16 +- .../planets/earth/lagrange_points/L4.asset | 16 +- .../planets/earth/lagrange_points/L5.asset | 16 +- .../lagrange_points/lagrange_kernels.asset | 8 - .../colorlayers/fallbacks/blue_marble.asset | 8 +- .../fallbacks/blue_marble_height.asset | 7 +- .../fallbacks/earth_night_texture.asset | 7 +- .../solarsystem/planets/earth/markers.asset | 7 +- .../solarsystem/planets/earth/moon/moon.asset | 8 +- .../planets/earth/moon/moon_labels.asset | 8 - .../planets/jupiter/callisto/callisto.asset | 8 +- .../jupiter/callisto/callisto_textures.asset | 7 - .../layers/colorlayers/callisto_texture.asset | 8 +- .../planets/jupiter/europa/europa.asset | 8 +- .../jupiter/europa/europa_textures.asset | 7 - .../layers/colorlayers/europa_texture.asset | 8 +- .../voyager_global_mosaic_local.asset | 8 +- .../planets/jupiter/ganymede/ganymede.asset | 8 +- .../jupiter/ganymede/ganymede_textures.asset | 7 - .../layers/colorlayers/ganymede_texture.asset | 8 +- .../solarsystem/planets/jupiter/io/io.asset | 8 +- .../planets/jupiter/io/io_textures.asset | 7 - .../io/layers/colorlayers/io_texture.asset | 8 +- .../planets/jupiter/jupiter_globelabels.asset | 7 - .../planets/jupiter/jupiter_textures.asset | 7 - .../layers/colorlayers/jupiter_texture.asset | 8 +- .../colorlayers/fallbacks/mars_texture.asset | 7 +- .../layers/colorlayers/mars_texture.asset | 8 +- .../solarsystem/planets/mars/mar097.asset | 8 - .../scene/solarsystem/planets/mars/mars.asset | 8 +- .../planets/mars/mars_globelabels.asset | 7 - .../planets/mars/mars_textures.asset | 7 - .../planets/mars/moons/deimos.asset | 12 +- .../planets/mars/moons/phobos.asset | 12 +- .../layers/colorlayers/alsimap_02122015.asset | 8 +- .../layers/colorlayers/casimap_02122015.asset | 8 +- .../layers/colorlayers/fesimap_02122015.asset | 8 +- .../layers/colorlayers/mgsimap_02122015.asset | 8 +- .../layers/colorlayers/ssimap_02122015.asset | 8 +- .../solarsystem/planets/mercury/mercury.asset | 8 +- .../planets/mercury/mercury_globelabels.asset | 7 - .../planets/mercury/mercury_textures.asset | 7 - .../layers/colorlayers/neptune_texture.asset | 8 +- .../planets/neptune/neptune_textures.asset | 7 - .../planets/saturn/dione/dione.asset | 8 +- .../planets/saturn/dione/dione_textures.asset | 7 - .../layers/colorlayers/dione_texture.asset | 8 +- .../planets/saturn/enceladus/enceladus.asset | 8 +- .../saturn/enceladus/enceladus_textures.asset | 7 - .../colorlayers/enceladus_texture.asset | 8 +- .../planets/saturn/hyperion/hyperion.asset | 8 +- .../planets/saturn/iapetus/iapetus.asset | 8 +- .../saturn/iapetus/iapetus_textures.asset | 7 - .../layers/colorlayers/iapetus_texture.asset | 8 +- .../layers/colorlayers/saturn_texture.asset | 8 +- .../layers/colorlayers/mimas_texture.asset | 8 +- .../planets/saturn/mimas/mimas.asset | 8 +- .../planets/saturn/mimas/mimas_textures.asset | 7 - .../layers/colorlayers/rhea_texture.asset | 8 +- .../planets/saturn/rhea/rhea.asset | 8 +- .../planets/saturn/rhea/rhea_textures.asset | 7 - .../solarsystem/planets/saturn/saturn.asset | 7 +- .../planets/saturn/saturn_globelabels.asset | 7 - .../planets/saturn/saturn_textures.asset | 7 - .../layers/colorlayers/tethys_texture.asset | 8 +- .../planets/saturn/tethys/tethys.asset | 8 +- .../saturn/tethys/tethys_textures.asset | 7 - .../cassini_iss_global_mosaic_4km_local.asset | 8 +- .../planets/saturn/titan/titan.asset | 8 +- .../planets/saturn/titan/titan_textures.asset | 7 - .../layers/colorlayers/uranus_texture.asset | 8 +- .../planets/uranus/uranus_textures.asset | 7 - .../layers/colorlayers/venus_texture.asset | 8 +- .../solarsystem/planets/venus/venus.asset | 8 +- .../planets/venus/venus_globelabels.asset | 7 - .../planets/venus/venus_textures.asset | 7 - data/assets/scene/solarsystem/sun/glare.asset | 7 +- .../sun/layers/colorlayers/sun_texture.asset | 9 +- .../assets/scene/solarsystem/sun/marker.asset | 7 +- .../scene/solarsystem/sun/sun_textures.asset | 18 - data/assets/sync/everything.asset | 6 +- data/assets/util/circle.asset | 8 - data/profiles/bastille-day.profile | 3 +- data/tasks/full_sync.task | 34 - data/tasks/gaia/gaia_download.task | 6 - ext/CMakeLists.txt | 2 - include/openspace/engine/openspaceengine.h | 6 +- include/openspace/scene/asset.h | 312 +++-- include/openspace/scene/assetlistener.h | 42 - include/openspace/scene/assetloader.h | 225 ---- include/openspace/scene/assetmanager.h | 188 ++- include/openspace/util/httprequest.h | 565 ++++++--- .../openspace/util/resourcesynchronization.h | 210 +++- .../openspace/util/synchronizationwatcher.h | 75 -- include/openspace/util/versionchecker.h | 2 +- modules/imgui/CMakeLists.txt | 2 - modules/imgui/include/gui.h | 5 +- modules/imgui/include/guiassetcomponent.h | 46 - modules/imgui/src/guiassetcomponent.cpp | 145 --- modules/sync/CMakeLists.txt | 2 - modules/sync/syncmodule.cpp | 62 +- modules/sync/syncmodule.h | 9 +- modules/sync/syncmodule_lua.inl | 15 +- modules/sync/syncs/httpsynchronization.cpp | 242 ++-- modules/sync/syncs/httpsynchronization.h | 67 +- modules/sync/syncs/urlsynchronization.cpp | 253 ++-- modules/sync/syncs/urlsynchronization.h | 57 +- modules/sync/tasks/syncassettask.cpp | 119 -- modules/sync/tasks/syncassettask.h | 49 - src/CMakeLists.txt | 6 - src/engine/downloadmanager.cpp | 14 +- src/engine/openspaceengine.cpp | 137 +- src/rendering/loadingscreen.cpp | 19 +- src/scene/asset.cpp | 1109 +++++------------ src/scene/assetloader.cpp | 846 ------------- src/scene/assetloader_lua.inl | 97 -- src/scene/assetmanager.cpp | 814 +++++++++++- src/scene/assetmanager_lua.inl | 28 +- src/scene/scene.cpp | 7 - src/scene/scene_lua.inl | 8 - src/scene/scenelicensewriter.cpp | 4 +- src/util/httprequest.cpp | 553 ++++---- src/util/resourcesynchronization.cpp | 92 +- src/util/synchronizationwatcher.cpp | 99 -- src/util/versionchecker.cpp | 7 +- tests/test_assetloader.cpp | 52 +- 167 files changed, 3251 insertions(+), 4441 deletions(-) delete mode 100644 data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_globelabels.asset delete mode 100644 data/assets/scene/solarsystem/missions/apollo/11/models.asset delete mode 100644 data/assets/scene/solarsystem/missions/apollo/17/boulder_models.asset delete mode 100644 data/assets/scene/solarsystem/missions/apollo/csm_model.asset delete mode 100644 data/assets/scene/solarsystem/missions/apollo/lem_model.asset delete mode 100644 data/assets/scene/solarsystem/missions/dawn/dawn_kernels.asset delete mode 100644 data/assets/scene/solarsystem/missions/jwst/horizons.asset delete mode 100644 data/assets/scene/solarsystem/missions/jwst/kernels.asset delete mode 100644 data/assets/scene/solarsystem/missions/jwst/model.asset delete mode 100644 data/assets/scene/solarsystem/missions/osirisrex/models.asset delete mode 100644 data/assets/scene/solarsystem/missions/voyager/model.asset delete mode 100644 data/assets/scene/solarsystem/planets/earth/earth_globelabels.asset delete mode 100644 data/assets/scene/solarsystem/planets/earth/earth_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels.asset delete mode 100644 data/assets/scene/solarsystem/planets/earth/moon/moon_labels.asset delete mode 100644 data/assets/scene/solarsystem/planets/jupiter/callisto/callisto_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/jupiter/europa/europa_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/jupiter/io/io_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/jupiter/jupiter_globelabels.asset delete mode 100644 data/assets/scene/solarsystem/planets/jupiter/jupiter_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/mars/mar097.asset delete mode 100644 data/assets/scene/solarsystem/planets/mars/mars_globelabels.asset delete mode 100644 data/assets/scene/solarsystem/planets/mars/mars_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/mercury/mercury_globelabels.asset delete mode 100644 data/assets/scene/solarsystem/planets/mercury/mercury_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/neptune/neptune_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/dione/dione_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/mimas/mimas_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/rhea/rhea_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/saturn_globelabels.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/saturn_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/tethys/tethys_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/saturn/titan/titan_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/uranus/uranus_textures.asset delete mode 100644 data/assets/scene/solarsystem/planets/venus/venus_globelabels.asset delete mode 100644 data/assets/scene/solarsystem/planets/venus/venus_textures.asset delete mode 100644 data/assets/scene/solarsystem/sun/sun_textures.asset delete mode 100644 data/assets/util/circle.asset delete mode 100644 data/tasks/full_sync.task delete mode 100644 data/tasks/gaia/gaia_download.task delete mode 100644 include/openspace/scene/assetlistener.h delete mode 100644 include/openspace/scene/assetloader.h delete mode 100644 include/openspace/util/synchronizationwatcher.h delete mode 100644 modules/imgui/include/guiassetcomponent.h delete mode 100644 modules/imgui/src/guiassetcomponent.cpp delete mode 100644 modules/sync/tasks/syncassettask.cpp delete mode 100644 modules/sync/tasks/syncassettask.h delete mode 100644 src/scene/assetloader.cpp delete mode 100644 src/scene/assetloader_lua.inl delete mode 100644 src/util/synchronizationwatcher.cpp diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 4301011f99..0a4596ff2e 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 4301011f990c76fcb598245b5b6dac7637e692ac +Subproject commit 0a4596ff2ea90c9f0dfbddd7b14f7ecee783baf1 diff --git a/data/assets/examples/urlsynchronization.asset b/data/assets/examples/urlsynchronization.asset index de55aaaf82..3cae4f2179 100644 --- a/data/assets/examples/urlsynchronization.asset +++ b/data/assets/examples/urlsynchronization.asset @@ -35,12 +35,6 @@ asset.syncedResource({ Override = true }) -asset.syncedResource({ - Name = "Example No ident", - Type = "UrlSynchronization", - Url = "http://ipv4.download.thinkbroadband.com/5MB.zip" -}) - asset.syncedResource({ Name = "Example No Hash", Type = "UrlSynchronization", diff --git a/data/assets/scene/digitaluniverse/hdf.asset b/data/assets/scene/digitaluniverse/hdf.asset index 353ae96fdc..c943e1542f 100644 --- a/data/assets/scene/digitaluniverse/hdf.asset +++ b/data/assets/scene/digitaluniverse/hdf.asset @@ -1,5 +1,11 @@ local assetHelper = asset.require('util/asset_helper') -local circle = asset.require('util/circle').circle + +local circle = asset.syncedResource({ + Name = "Circle", + Type = "HttpSynchronization", + Identifier = "circle_image", + Version = 1 +}) local HUDFSpeck = asset.syncedResource({ Name = "HUDF Speck", diff --git a/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset b/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset index dd80929b3d..2aaf885944 100644 --- a/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset +++ b/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset @@ -1,7 +1,12 @@ local habitableZoneTextures = asset.require('./../habitable_zones/habitable_zone_textures').TexturesPath -local sunTextures = asset.require('scene/solarsystem/sun/sun_textures').TexturesPath +local sunTextures = asset.syncedResource({ + Type = "HttpSynchronization", + Name = "Sun textures", + Identifier = "sun_textures", + Version = 4 +}) local TexturesPath = asset.syncedResource({ Name = "Exoplanet Textures", diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset index e2411ef264..01ba4be29a 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset @@ -2,10 +2,16 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./../transforms') asset.require("spice/base") asset.require('../trail') -local labelsPath = asset.require('./../pluto_globelabels').LabelsPath +local labelsPath = asset.syncedResource({ + Name = "Pluto Labels", + Type = "HttpSynchronization", + Identifier = "pluto_labels", + Version = 1 +}) + local Charon = { Identifier = "Charon", Parent = transforms.PlutoBarycenter.Identifier, diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index 947b762858..2a80986180 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -2,9 +2,14 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./transforms') asset.require("spice/base") asset.require('./trail') -local labelsPath = asset.require('./pluto_globelabels').LabelsPath +local labelsPath = asset.syncedResource({ + Name = "Pluto Labels", + Type = "HttpSynchronization", + Identifier = "pluto_labels", + Version = 1 +}) local Pluto = { Identifier = "Pluto", diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_globelabels.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_globelabels.asset deleted file mode 100644 index 4a045b3e9d..0000000000 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_globelabels.asset +++ /dev/null @@ -1,7 +0,0 @@ -local LabelsPath = asset.syncedResource({ - Name = "Pluto Labels", - Type = "HttpSynchronization", - Identifier = "pluto_labels", - Version = 1 -}) -asset.export("LabelsPath", LabelsPath) diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset index 95cc754503..f8272f2726 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset @@ -3,33 +3,35 @@ local transforms = asset.require('scene/solarsystem/sun/transforms') asset.require("spice/base") local kernels = asset.require('./kernels').PlutoKernels local OneAU = 1.496e+8 + + local PlutoKeplerianTrail = { - Identifier = "PlutoKeplerianTrail", - Parent = transforms.SunECLIPJ2000.Identifier, - Renderable = { - Type = "RenderableTrailOrbit", - Translation = { - Type = "KeplerTranslation", - Eccentricity = 2.543033082909471E-01, - SemiMajorAxis = 3.974407237841206E+01 * OneAU, - Inclination = 1.736609481151430E+01, - AscendingNode = 1.102099981996057E+02, - ArgumentOfPeriapsis = 1.142248569189779E+02, - MeanAnomaly = 14.53, - Epoch = '2000 01 01 00:00', - Period = 7.82438e+9 - }, - Color = { 0.2, 0.8, 0.3 }, - Period = 90487.27692706819, - Resolution = 1000, - Enabled = false + Identifier = "PlutoKeplerianTrail", + Parent = transforms.SunECLIPJ2000.Identifier, + Renderable = { + Type = "RenderableTrailOrbit", + Translation = { + Type = "KeplerTranslation", + Eccentricity = 2.543033082909471E-01, + SemiMajorAxis = 3.974407237841206E+01 * OneAU, + Inclination = 1.736609481151430E+01, + AscendingNode = 1.102099981996057E+02, + ArgumentOfPeriapsis = 1.142248569189779E+02, + MeanAnomaly = 14.53, + Epoch = '2000 01 01 00:00', + Period = 7.82438e+9 }, - Tag = { "planetTrail_dwarf" }, - GUI = { - Name = "Pluto Keplerian Trail", - Path = "/Solar System/Dwarf Planets/Pluto", - Description = "Keplerian trail of Pluto. Contains full orbit." - } + Color = { 0.2, 0.8, 0.3 }, + Period = 90487.27692706819, + Resolution = 1000, + Enabled = false + }, + Tag = { "planetTrail_dwarf" }, + GUI = { + Name = "Pluto Keplerian Trail", + Path = "/Solar System/Dwarf Planets/Pluto", + Description = "Keplerian trail of Pluto. Contains full orbit." + } } assetHelper.registerSceneGraphNodesAndExport(asset, { PlutoKeplerianTrail }) diff --git a/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset b/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset index 92b5cb3525..b353169587 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset @@ -5,10 +5,21 @@ local moon_transforms = asset.require('scene/solarsystem/planets/earth/moon/moon local descentKeyframes = asset.require('./lem_descent.asset') local descentRotationKeyframes = asset.require('./lem_descent_rotation.asset') -local lem_model = asset.require('scene/solarsystem/missions/apollo/lem_model') local kernels = asset.require('./kernels').kernels -local models = asset.require('./models').models +local models = asset.syncedResource({ + Name = "Apollo Models", + Type = "HttpSynchronization", + Identifier = "apollo_11_models", + Version = 1 +}) + +local lem_model = asset.syncedResource({ + Name = "Apollo Lem Models", + Type = "HttpSynchronization", + Identifier = "apollo_lem_model", + Version = 4 +}) asset.require('spice/base') @@ -171,7 +182,7 @@ local Apollo11LemDescentModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = lem_model.modelFolder .. "/lmremoved.obj", + GeometryFile = lem_model .. "/lmremoved.obj", SpecularIntensity = 0.0, RotationVector = { 273.750,28.0,309.85 }, LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) @@ -197,7 +208,7 @@ local Apollo11LemLandedModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = lem_model.modelFolder .. "/LM-2_ver2clean.obj", + GeometryFile = lem_model .. "/LM-2_ver2clean.obj", SpecularIntensity = 0.0, RotationVector = { 273.750,28.0,309.85 }, LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) diff --git a/data/assets/scene/solarsystem/missions/apollo/11/lem.asset b/data/assets/scene/solarsystem/missions/apollo/11/lem.asset index bb5a78ec79..3739de848d 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/lem.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/lem.asset @@ -3,8 +3,13 @@ local asset_helper = asset.require('util/asset_helper') local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') -local lem_model = asset.require('scene/solarsystem/missions/apollo/lem_model') +local lem_model = asset.syncedResource({ + Name = "Apollo Lem Models", + Type = "HttpSynchronization", + Identifier = "apollo_lem_model", + Version = 4 +}) local Apollo11Lem = { Identifier = "Apollo11Lem", @@ -36,7 +41,7 @@ local Apollo11LemModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = lem_model.modelFolder .. "/LM-2_ver2clean.obj", + GeometryFile = lem_model .. "/LM-2_ver2clean.obj", RotationVector = { 91.044090,171.229706,111.666664 }, LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) }, diff --git a/data/assets/scene/solarsystem/missions/apollo/11/models.asset b/data/assets/scene/solarsystem/missions/apollo/11/models.asset deleted file mode 100644 index 46b87d9ba3..0000000000 --- a/data/assets/scene/solarsystem/missions/apollo/11/models.asset +++ /dev/null @@ -1,8 +0,0 @@ -local modelFolder = asset.syncedResource({ - Name = "Apollo Models", - Type = "HttpSynchronization", - Identifier = "apollo_11_models", - Version = 1 -}) - -asset.export('models', modelFolder) diff --git a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset index 0fe0283e1e..4cf0e06419 100644 --- a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset +++ b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset @@ -2,7 +2,13 @@ local assetHelper = asset.require('util/asset_helper') local moon_transforms = asset.require('scene/solarsystem/planets/earth/moon/moon') local sun_transforms = asset.require('scene/solarsystem/sun/transforms') asset.require('spice/base') -local models = asset.require('scene/solarsystem/missions/apollo/csm_model').models + +local models = asset.syncedResource({ + Name = "Apollo Models", + Type = "HttpSynchronization", + Identifier = "apollo_models", + Version = 4 +}) local kernels = asset.require('scene/solarsystem/missions/apollo/15/kernels').kernels diff --git a/data/assets/scene/solarsystem/missions/apollo/17/boulder_models.asset b/data/assets/scene/solarsystem/missions/apollo/17/boulder_models.asset deleted file mode 100644 index 9e5e6545e8..0000000000 --- a/data/assets/scene/solarsystem/missions/apollo/17/boulder_models.asset +++ /dev/null @@ -1,8 +0,0 @@ -local models = asset.syncedResource({ - Name = "Apollo Boulders Models", - Type = "HttpSynchronization", - Identifier = "apollo_boulders", - Version = 2 -}) - -asset.export('models', models) diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset index 79d44f2fe0..715cda0ffe 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset @@ -1,7 +1,13 @@ local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local asset_helper = asset.require('util/asset_helper') local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') -local models = asset.require('./boulder_models').models + +local models = asset.syncedResource({ + Name = "Apollo Boulders Models", + Type = "HttpSynchronization", + Identifier = "apollo_boulders", + Version = 2 +}) local LightSources = { { diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset index 8574725776..ced25ff21e 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset @@ -1,7 +1,13 @@ local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local asset_helper = asset.require('util/asset_helper') local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') -local models = asset.require('./boulder_models').models + +local models = asset.syncedResource({ + Name = "Apollo Boulders Models", + Type = "HttpSynchronization", + Identifier = "apollo_boulders", + Version = 2 +}) local LightSources = { { diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset index 7a185e33d8..ab596e44f8 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset @@ -1,7 +1,13 @@ local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local asset_helper = asset.require('util/asset_helper') local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') -local models = asset.require('./boulder_models').models + +local models = asset.syncedResource({ + Name = "Apollo Boulders Models", + Type = "HttpSynchronization", + Identifier = "apollo_boulders", + Version = 2 +}) local LightSources = { { diff --git a/data/assets/scene/solarsystem/missions/apollo/17/lem.asset b/data/assets/scene/solarsystem/missions/apollo/17/lem.asset index 74dc722275..95339b0979 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/lem.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/lem.asset @@ -2,7 +2,12 @@ local asset_helper = asset.require('util/asset_helper') local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') -local model = asset.require('scene/solarsystem/missions/apollo/lem_model') +local model = asset.syncedResource({ + Name = "Apollo Lem Models", + Type = "HttpSynchronization", + Identifier = "apollo_lem_model", + Version = 4 +}) local Apollo17Lem = { Identifier = "Apollo17Lem", @@ -34,7 +39,7 @@ local Apollo17LemModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model.modelFolder .. "/LM-2_ver2clean.obj", + GeometryFile = model .. "/LM-2_ver2clean.obj", SpecularIntensity = 0.0, RotationVector = { 110.255219,171.229706,126.666664 }, LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) diff --git a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset index 448df1dd70..c5f39164b5 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset @@ -2,7 +2,13 @@ local asset_helper = asset.require('util/asset_helper') local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local kernels = asset.require('./kernels').kernels -local models = asset.require('scene/solarsystem/missions/apollo/csm_model').models + +local models = asset.syncedResource({ + Name = "Apollo Models", + Type = "HttpSynchronization", + Identifier = "apollo_models", + Version = 4 +}) local apolloSpiceId = "-908" diff --git a/data/assets/scene/solarsystem/missions/apollo/8/model.asset b/data/assets/scene/solarsystem/missions/apollo/8/model.asset index 30d2e70a15..a110a45646 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/model.asset @@ -2,7 +2,13 @@ local asset_helper = asset.require('util/asset_helper') local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') local sun_transforms = asset.require('scene/solarsystem/sun/transforms') local kernels = asset.require('./kernels').kernels -local models = asset.require('scene/solarsystem/missions/apollo/csm_model').models + +local models = asset.syncedResource({ + Name = "Apollo Models", + Type = "HttpSynchronization", + Identifier = "apollo_models", + Version = 4 +}) local apolloSpiceId = "-908" diff --git a/data/assets/scene/solarsystem/missions/apollo/csm_model.asset b/data/assets/scene/solarsystem/missions/apollo/csm_model.asset deleted file mode 100644 index 68ce09e62c..0000000000 --- a/data/assets/scene/solarsystem/missions/apollo/csm_model.asset +++ /dev/null @@ -1,8 +0,0 @@ -local models = asset.syncedResource({ - Name = "Apollo Models", - Type = "HttpSynchronization", - Identifier = "apollo_models", - Version = 4 -}) - -asset.export('models', models) diff --git a/data/assets/scene/solarsystem/missions/apollo/lem_model.asset b/data/assets/scene/solarsystem/missions/apollo/lem_model.asset deleted file mode 100644 index 5490471d7e..0000000000 --- a/data/assets/scene/solarsystem/missions/apollo/lem_model.asset +++ /dev/null @@ -1,8 +0,0 @@ -local modelFolder = asset.syncedResource({ - Name = "Apollo Lem Models", - Type = "HttpSynchronization", - Identifier = "apollo_lem_model", - Version = 4 -}) - -asset.export('modelFolder', modelFolder) diff --git a/data/assets/scene/solarsystem/missions/dawn/ceres.asset b/data/assets/scene/solarsystem/missions/dawn/ceres.asset index 3b5bcc41f9..ec16cb3d4c 100644 --- a/data/assets/scene/solarsystem/missions/dawn/ceres.asset +++ b/data/assets/scene/solarsystem/missions/dawn/ceres.asset @@ -1,9 +1,15 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('scene/solarsystem/sun/transforms') -local kernels = asset.require('./dawn_kernels').Kernels +local kernels = asset.syncedResource({ + Name = "Dawn Kernels", + Type = "HttpSynchronization", + Identifier = "dawn_kernels", + Version = 2 +}) + local textures = asset.syncedResource({ Name = "Ceres Textures", Type = "HttpSynchronization", @@ -43,8 +49,7 @@ local Ceres = { Layers = { ColorLayers = { { - Name = "Texture", - Identifier = "CeresTexture", + Identifier = "Texture", FilePath = textures .. "/gray.png", Enabled = true } diff --git a/data/assets/scene/solarsystem/missions/dawn/dawn.asset b/data/assets/scene/solarsystem/missions/dawn/dawn.asset index 5887fb10d0..6b9db76edd 100644 --- a/data/assets/scene/solarsystem/missions/dawn/dawn.asset +++ b/data/assets/scene/solarsystem/missions/dawn/dawn.asset @@ -1,9 +1,15 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('scene/solarsystem/sun/transforms') -local kernels = asset.require('./dawn_kernels').Kernels local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local kernels = asset.syncedResource({ + Name = "Dawn Kernels", + Type = "HttpSynchronization", + Identifier = "dawn_kernels", + Version = 2 +}) + local textures = asset.syncedResource({ Name = "Dawn Textures", Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/missions/dawn/dawn_kernels.asset b/data/assets/scene/solarsystem/missions/dawn/dawn_kernels.asset deleted file mode 100644 index ab4e5d4c2e..0000000000 --- a/data/assets/scene/solarsystem/missions/dawn/dawn_kernels.asset +++ /dev/null @@ -1,8 +0,0 @@ -local Kernels = asset.syncedResource({ - Name = "Dawn Kernels", - Type = "HttpSynchronization", - Identifier = "dawn_kernels", - Version = 2 -}) - -asset.export("Kernels", Kernels) diff --git a/data/assets/scene/solarsystem/missions/dawn/vesta.asset b/data/assets/scene/solarsystem/missions/dawn/vesta.asset index 247e009502..d4f79dc20f 100644 --- a/data/assets/scene/solarsystem/missions/dawn/vesta.asset +++ b/data/assets/scene/solarsystem/missions/dawn/vesta.asset @@ -1,8 +1,14 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('scene/solarsystem/sun/transforms') -local kernels = asset.require('./dawn_kernels').Kernels +local kernels = asset.syncedResource({ + Name = "Dawn Kernels", + Type = "HttpSynchronization", + Identifier = "dawn_kernels", + Version = 2 +}) + local textures = asset.syncedResource({ Name = "Vesta Textures", Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/missions/jwst/horizons.asset b/data/assets/scene/solarsystem/missions/jwst/horizons.asset deleted file mode 100644 index 937fbdd60a..0000000000 --- a/data/assets/scene/solarsystem/missions/jwst/horizons.asset +++ /dev/null @@ -1,8 +0,0 @@ -local horizons = asset.syncedResource({ - Name = "JWST Horizons", - Type = "HttpSynchronization", - Identifier = "jwst_horizons", - Version = 2 -}) - -asset.export('horizons', horizons) diff --git a/data/assets/scene/solarsystem/missions/jwst/jwst.asset b/data/assets/scene/solarsystem/missions/jwst/jwst.asset index bd47eec1f3..bbe6322584 100644 --- a/data/assets/scene/solarsystem/missions/jwst/jwst.asset +++ b/data/assets/scene/solarsystem/missions/jwst/jwst.asset @@ -1,9 +1,15 @@ local assetHelper = asset.require('util/asset_helper') local sunTransforms = asset.require('scene/solarsystem/sun/transforms') local transforms = asset.require('./transforms') -local models = asset.require('./model').models asset.require('spice/base') +local models = asset.syncedResource({ + Name = "JWST Model", + Type = "HttpSynchronization", + Identifier = "jwst_model", + Version = 3 +}) + local band = asset.syncedResource({ Name = "JWST band texture", Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/missions/jwst/kernels.asset b/data/assets/scene/solarsystem/missions/jwst/kernels.asset deleted file mode 100644 index 4dca85d6ec..0000000000 --- a/data/assets/scene/solarsystem/missions/jwst/kernels.asset +++ /dev/null @@ -1,8 +0,0 @@ -local kernels = asset.syncedResource({ - Name = "JWST Kernel", - Type = "HttpSynchronization", - Identifier = "jwst_kernels", - Version = 1 -}) - -asset.export('kernels', kernels) diff --git a/data/assets/scene/solarsystem/missions/jwst/model.asset b/data/assets/scene/solarsystem/missions/jwst/model.asset deleted file mode 100644 index 0e0298d916..0000000000 --- a/data/assets/scene/solarsystem/missions/jwst/model.asset +++ /dev/null @@ -1,8 +0,0 @@ -local models = asset.syncedResource({ - Name = "JWST Model", - Type = "HttpSynchronization", - Identifier = "jwst_model", - Version = 3 -}) - -asset.export('models', models) diff --git a/data/assets/scene/solarsystem/missions/jwst/trail.asset b/data/assets/scene/solarsystem/missions/jwst/trail.asset index 820c1a7b62..9a34011434 100644 --- a/data/assets/scene/solarsystem/missions/jwst/trail.asset +++ b/data/assets/scene/solarsystem/missions/jwst/trail.asset @@ -2,10 +2,22 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('scene/solarsystem/planets/earth/lagrange_points/L2') local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local horizons = asset.require('./horizons').horizons -local kernels = asset.require('./kernels').kernels asset.require("spice/base") +local horizons = asset.syncedResource({ + Name = "JWST Horizons", + Type = "HttpSynchronization", + Identifier = "jwst_horizons", + Version = 2 +}) + +local kernels = asset.syncedResource({ + Name = "JWST Kernel", + Type = "HttpSynchronization", + Identifier = "jwst_kernels", + Version = 1 +}) + -- (malej 2021-10-04) In general, there is no trajectery data of JWST for the scheduled -- launch in December 2021, no horizons and no SPICE. Instead data from the 2018 launch -- is used, old data from an old launch time that never happened because of delays. diff --git a/data/assets/scene/solarsystem/missions/jwst/transforms.asset b/data/assets/scene/solarsystem/missions/jwst/transforms.asset index 0ce7e4defa..53b55f8132 100644 --- a/data/assets/scene/solarsystem/missions/jwst/transforms.asset +++ b/data/assets/scene/solarsystem/missions/jwst/transforms.asset @@ -1,9 +1,15 @@ local assetHelper = asset.require('util/asset_helper') local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local horizons = asset.require('./horizons').horizons asset.require('spice/base') +local horizons = asset.syncedResource({ + Name = "JWST Horizons", + Type = "HttpSynchronization", + Identifier = "jwst_horizons", + Version = 2 +}) + local JWSTPosition = { Identifier = "JWSTPosition", Parent = earthTransforms.EarthCenter.Identifier, diff --git a/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset b/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset index 5ebbea22e2..c6f7811eec 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset @@ -1,7 +1,13 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./transforms') local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local models = asset.require('./models').models + +local models = asset.syncedResource({ + Name = "Bennu Models", + Type = "HttpSynchronization", + Identifier = "bennu_models", + Version = 2 +}) local BENNU_BODY = "2101955" diff --git a/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset b/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset index c78fbef4b2..9a81496a37 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset @@ -2,7 +2,12 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./transforms') local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local models = asset.require('./models').models +local models = asset.syncedResource({ + Name = "Bennu Models", + Type = "HttpSynchronization", + Identifier = "bennu_models", + Version = 2 +}) local BENNU_BODY = "2101955" diff --git a/data/assets/scene/solarsystem/missions/osirisrex/models.asset b/data/assets/scene/solarsystem/missions/osirisrex/models.asset deleted file mode 100644 index cdd95678ff..0000000000 --- a/data/assets/scene/solarsystem/missions/osirisrex/models.asset +++ /dev/null @@ -1,8 +0,0 @@ -local models = asset.syncedResource({ - Name = "Bennu Models", - Type = "HttpSynchronization", - Identifier = "bennu_models", - Version = 2 -}) - -asset.export('models', models) diff --git a/data/assets/scene/solarsystem/missions/voyager/model.asset b/data/assets/scene/solarsystem/missions/voyager/model.asset deleted file mode 100644 index c72367fd35..0000000000 --- a/data/assets/scene/solarsystem/missions/voyager/model.asset +++ /dev/null @@ -1,8 +0,0 @@ -local models = asset.syncedResource({ - Name = "Voyager Model", - Type = "HttpSynchronization", - Identifier = "voyager_model", - Version = 1 -}) - -asset.export('modelFolder', models) diff --git a/data/assets/scene/solarsystem/missions/voyager/voyager1.asset b/data/assets/scene/solarsystem/missions/voyager/voyager1.asset index a0d0d4ae22..6021db412f 100644 --- a/data/assets/scene/solarsystem/missions/voyager/voyager1.asset +++ b/data/assets/scene/solarsystem/missions/voyager/voyager1.asset @@ -1,6 +1,12 @@ local assetHelper = asset.require('util/asset_helper') local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local models = asset.require("./model" ).modelFolder; + +local models = asset.syncedResource({ + Name = "Voyager Model", + Type = "HttpSynchronization", + Identifier = "voyager_model", + Version = 1 +}) local kernels = asset.syncedResource({ Name = "Voyager 1 Kernels", diff --git a/data/assets/scene/solarsystem/missions/voyager/voyager2.asset b/data/assets/scene/solarsystem/missions/voyager/voyager2.asset index d2e7e80a17..87d32f852b 100644 --- a/data/assets/scene/solarsystem/missions/voyager/voyager2.asset +++ b/data/assets/scene/solarsystem/missions/voyager/voyager2.asset @@ -1,8 +1,14 @@ local assetHelper = asset.require('util/asset_helper') local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local models = asset.require("./model" ).modelFolder; +local models = asset.syncedResource({ + Name = "Voyager Model", + Type = "HttpSynchronization", + Identifier = "voyager_model", + Version = 1 +}) + local kernels = asset.syncedResource({ Name = "Voyager 2 Kernels", Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index ef29f8c1f3..501140a5b5 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -1,6 +1,12 @@ local transforms = asset.require('./transforms') local assetHelper = asset.require('util/asset_helper') -local labelsPath = asset.require('./earth_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Earth Labels", + Type = "HttpSynchronization", + Identifier = "earth_labels", + Version = 1 +}) -- local earthEllipsoid = { 6378137.0, 6378137.0, 6356752.314245 } local earthEllipsoid = { 6378137.0, 6378137.0, 6378137.0 } diff --git a/data/assets/scene/solarsystem/planets/earth/earth_globelabels.asset b/data/assets/scene/solarsystem/planets/earth/earth_globelabels.asset deleted file mode 100644 index f454309a56..0000000000 --- a/data/assets/scene/solarsystem/planets/earth/earth_globelabels.asset +++ /dev/null @@ -1,7 +0,0 @@ -local LabelsPath = asset.syncedResource({ - Name = "Earth Labels", - Type = "HttpSynchronization", - Identifier = "earth_labels", - Version = 1 -}) -asset.export("LabelsPath", LabelsPath) diff --git a/data/assets/scene/solarsystem/planets/earth/earth_textures.asset b/data/assets/scene/solarsystem/planets/earth/earth_textures.asset deleted file mode 100644 index 73448a46b7..0000000000 --- a/data/assets/scene/solarsystem/planets/earth/earth_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Earth Textures", - Type = "HttpSynchronization", - Identifier = "earth_textures", - Version = 2 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset index 42cbb85eab..94822c0af6 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset @@ -1,9 +1,21 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('scene/solarsystem/sun/transforms') -local circle = asset.require('util/circle').circle -local kernels = asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels').kernels asset.require('spice/base') +local circle = asset.syncedResource({ + Name = "Circle", + Type = "HttpSynchronization", + Identifier = "circle_image", + Version = 1 +}) + +local kernels = asset.syncedResource({ + Name = "Lagrange Kernels", + Type = "HttpSynchronization", + Identifier = "earth_lagrange_kernels", + Version = 1 +}) + local L1 = { Identifier = "L1", Parent = transforms.SolarSystemBarycenter.Identifier, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset index c93a1c882f..645def7014 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset @@ -1,9 +1,21 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('scene/solarsystem/sun/transforms') -local circle = asset.require('util/circle').circle -local kernels = asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels').kernels asset.require('spice/base') +local circle = asset.syncedResource({ + Name = "Circle", + Type = "HttpSynchronization", + Identifier = "circle_image", + Version = 1 +}) + +local kernels = asset.syncedResource({ + Name = "Lagrange Kernels", + Type = "HttpSynchronization", + Identifier = "earth_lagrange_kernels", + Version = 1 +}) + local L2Small = { Identifier = "L2Small", Parent = transforms.SolarSystemBarycenter.Identifier, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset index c49044f076..0b5faad71e 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset @@ -1,9 +1,21 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('scene/solarsystem/sun/transforms') -local circle = asset.require('util/circle').circle -local kernels = asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels').kernels asset.require('spice/base') +local circle = asset.syncedResource({ + Name = "Circle", + Type = "HttpSynchronization", + Identifier = "circle_image", + Version = 1 +}) + +local kernels = asset.syncedResource({ + Name = "Lagrange Kernels", + Type = "HttpSynchronization", + Identifier = "earth_lagrange_kernels", + Version = 1 +}) + local L4 = { Identifier = "L4", Parent = transforms.SolarSystemBarycenter.Identifier, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset index ece822fd03..ed3bb40514 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset @@ -1,9 +1,21 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('scene/solarsystem/sun/transforms') -local circle = asset.require('util/circle').circle -local kernels = asset.require('scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels').kernels asset.require('spice/base') +local circle = asset.syncedResource({ + Name = "Circle", + Type = "HttpSynchronization", + Identifier = "circle_image", + Version = 1 +}) + +local kernels = asset.syncedResource({ + Name = "Lagrange Kernels", + Type = "HttpSynchronization", + Identifier = "earth_lagrange_kernels", + Version = 1 +}) + local L5 = { Identifier = "L5", Parent = transforms.SolarSystemBarycenter.Identifier, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels.asset deleted file mode 100644 index b78370a3a8..0000000000 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/lagrange_kernels.asset +++ /dev/null @@ -1,8 +0,0 @@ -local kernels = asset.syncedResource({ - Name = "Lagrange Kernels", - Type = "HttpSynchronization", - Identifier = "earth_lagrange_kernels", - Version = 1 -}) - -asset.export('kernels', kernels) diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset index ef07346d05..cded8f8ea0 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../../earth_textures").TexturesPath local globeIdentifier = asset.require("./../../../earth").Earth.Identifier +local texturesPath = asset.syncedResource({ + Name = "Earth Textures", + Type = "HttpSynchronization", + Identifier = "earth_textures", + Version = 2 +}) + local layer = { Identifier = "Blue_Marble", Name = "Blue Marble", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset index 116faf265f..e45c0fe506 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset @@ -1,4 +1,9 @@ -local texturesPath = asset.require("./../../../earth_textures").TexturesPath +local texturesPath = asset.syncedResource({ + Name = "Earth Textures", + Type = "HttpSynchronization", + Identifier = "earth_textures", + Version = 2 +}) local layer = { Name = "Earth Bluemarble Height", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset index 8ceae0261f..1779e8a5b6 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset @@ -1,4 +1,9 @@ -local texturesPath = asset.require("./../../../earth_textures").TexturesPath +local texturesPath = asset.syncedResource({ + Name = "Earth Textures", + Type = "HttpSynchronization", + Identifier = "earth_textures", + Version = 2 +}) local layer = { Identifier = "Earth_Night_Texture", diff --git a/data/assets/scene/solarsystem/planets/earth/markers.asset b/data/assets/scene/solarsystem/planets/earth/markers.asset index 79971e6339..975bb4b8b6 100644 --- a/data/assets/scene/solarsystem/planets/earth/markers.asset +++ b/data/assets/scene/solarsystem/planets/earth/markers.asset @@ -1,8 +1,13 @@ local transforms = asset.require('./transforms') local assetHelper = asset.require('util/asset_helper') -local texturesPath = asset.require('./earth_textures').TexturesPath +local texturesPath = asset.syncedResource({ + Name = "Earth Textures", + Type = "HttpSynchronization", + Identifier = "earth_textures", + Version = 2 +}) local EarthMarker = { Identifier = "EarthMarker", diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset index f3cd2cea9a..6c3cf10831 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset @@ -3,7 +3,13 @@ local transforms = asset.require('scene/solarsystem/planets/earth/transforms') local sunAsset = asset.require('scene/solarsystem/sun/sun') local earthAsset = asset.require('../earth') asset.require('spice/base') -local labelsPath = asset.require('./moon_labels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Moon Labels", + Type = "HttpSynchronization", + Identifier = "moon_labels", + Version = 1 +}) local Moon = { Identifier = "Moon", diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon_labels.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon_labels.asset deleted file mode 100644 index 7cdc6f6c2a..0000000000 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon_labels.asset +++ /dev/null @@ -1,8 +0,0 @@ -local LabelsPath = asset.syncedResource({ - Name = "Moon Labels", - Type = "HttpSynchronization", - Identifier = "moon_labels", - Version = 1 -}) - -asset.export("LabelsPath", LabelsPath) diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset index c4503abea0..f6417fdb88 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset @@ -3,7 +3,13 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.require('./trail') local kernel = asset.require('../kernels').jup310 -local labelsPath = asset.require('../jupiter_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Jupiter Labels", + Type = "HttpSynchronization", + Identifier = "jupiter_labels", + Version = 1 +}) local Callisto = { Identifier = "Callisto", diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto_textures.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto_textures.asset deleted file mode 100644 index c6cc74bb68..0000000000 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Callisto Textures", - Type = "HttpSynchronization", - Identifier = "callisto_textures", - Version = 2 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset index 21653cde87..113938eaf8 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../callisto_textures").TexturesPath local globeIdentifier = asset.require("./../../callisto").Callisto.Identifier +local texturesPath = asset.syncedResource({ + Name = "Callisto Textures", + Type = "HttpSynchronization", + Identifier = "callisto_textures", + Version = 2 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/callisto_os.tif", diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset index 1ecfb93b34..f6f5dae90e 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset @@ -3,7 +3,13 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.require('./trail') local kernel = asset.require('../kernels').jup310 -local labelsPath = asset.require('../jupiter_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Jupiter Labels", + Type = "HttpSynchronization", + Identifier = "jupiter_labels", + Version = 1 +}) local Europa = { Identifier = "Europa", diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa_textures.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa_textures.asset deleted file mode 100644 index 259bec7da5..0000000000 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Europa Textures", - Type = "HttpSynchronization", - Identifier = "europa_textures", - Version = 2 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset index 1e690211b2..ff04cd262f 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../europa_textures").TexturesPath local globeIdentifier = asset.require("./../../europa").Europa.Identifier +local texturesPath = asset.syncedResource({ + Name = "Europa Textures", + Type = "HttpSynchronization", + Identifier = "europa_textures", + Version = 2 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/europa_os.tif", diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset index 36e08d3c16..c4991eb4e7 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../europa_textures").TexturesPath local globeIdentifier = asset.require("./../../europa").Europa.Identifier +local texturesPath = asset.syncedResource({ + Name = "Europa Textures", + Type = "HttpSynchronization", + Identifier = "europa_textures", + Version = 2 +}) + local layer = { Identifier = "Voyager_Global_Mosaic_Local", Name = "Voyager Global Mosaic [Local]", diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset index ccda9c129a..182c3aefeb 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset @@ -3,7 +3,13 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.require('./trail') local kernel = asset.require('../kernels').jup310 -local labelsPath = asset.require('../jupiter_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Jupiter Labels", + Type = "HttpSynchronization", + Identifier = "jupiter_labels", + Version = 1 +}) local Ganymede = { Identifier = "Ganymede", diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede_textures.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede_textures.asset deleted file mode 100644 index e27f858103..0000000000 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Ganymede Textures", - Type = "HttpSynchronization", - Identifier = "ganymede_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset index 6cddc4d319..5bfd9aa607 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../ganymede_textures").TexturesPath local globeIdentifier = asset.require("./../../ganymede").Ganymede.Identifier +local texturesPath = asset.syncedResource({ + Name = "Ganymede Textures", + Type = "HttpSynchronization", + Identifier = "ganymede_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/ganymede.jpg", diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset index 641cf411f6..3bf82f2cc8 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset @@ -3,7 +3,13 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.require('./trail') local kernel = asset.require('../kernels').jup310 -local labelsPath = asset.require('../jupiter_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Jupiter Labels", + Type = "HttpSynchronization", + Identifier = "jupiter_labels", + Version = 1 +}) local Io = { Identifier = "Io", diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io_textures.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io_textures.asset deleted file mode 100644 index 36b55fdc1e..0000000000 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Io Textures", - Type = "HttpSynchronization", - Identifier = "io_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset index 1e7eb5517e..baa929c659 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../io_textures").TexturesPath local globeIdentifier = asset.require("./../../io").Io.Identifier +local texturesPath = asset.syncedResource({ + Name = "Io Textures", + Type = "HttpSynchronization", + Identifier = "io_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/io.jpg", diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter_globelabels.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter_globelabels.asset deleted file mode 100644 index 9de72c055c..0000000000 --- a/data/assets/scene/solarsystem/planets/jupiter/jupiter_globelabels.asset +++ /dev/null @@ -1,7 +0,0 @@ -local LabelsPath = asset.syncedResource({ - Name = "Jupiter Labels", - Type = "HttpSynchronization", - Identifier = "jupiter_labels", - Version = 1 -}) -asset.export("LabelsPath", LabelsPath) diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter_textures.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter_textures.asset deleted file mode 100644 index c310a1906b..0000000000 --- a/data/assets/scene/solarsystem/planets/jupiter/jupiter_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Jupiter Textures", - Type = "HttpSynchronization", - Identifier = "jupiter_textures", - Version = 2 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset index 98b2d1543d..b1253cd604 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../jupiter_textures").TexturesPath local globeIdentifier = asset.require("./../../jupiter").Jupiter.Identifier +local texturesPath = asset.syncedResource({ + Name = "Jupiter Textures", + Type = "HttpSynchronization", + Identifier = "jupiter_textures", + Version = 2 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/jupiter_os.tif", diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/fallbacks/mars_texture.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/fallbacks/mars_texture.asset index beb227466d..c9094eaa85 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/fallbacks/mars_texture.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/fallbacks/mars_texture.asset @@ -1,4 +1,9 @@ -local texturesPath = asset.require("./../../../mars_textures").TexturesPath +local texturesPath = asset.syncedResource({ + Name = "Mars Textures", + Type = "HttpSynchronization", + Identifier = "mars_textures", + Version = 1 +}) local layer = { Identifier = "Mars_Texture", diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset index 125d653a4b..18bf3f5e92 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../mars_textures").TexturesPath local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local texturesPath = asset.syncedResource({ + Name = "Mars Textures", + Type = "HttpSynchronization", + Identifier = "mars_textures", + Version = 1 +}) + local layer = { Identifier = "Mars_Texture", Name = "Mars Texture", diff --git a/data/assets/scene/solarsystem/planets/mars/mar097.asset b/data/assets/scene/solarsystem/planets/mars/mar097.asset deleted file mode 100644 index 70af8b1c5f..0000000000 --- a/data/assets/scene/solarsystem/planets/mars/mar097.asset +++ /dev/null @@ -1,8 +0,0 @@ -local Kernels = asset.syncedResource({ - Name = "Mars Spice Kernels", - Type = "HttpSynchronization", - Identifier = "mars_kernels", - Version = 1 -}) - -asset.export("Kernels", Kernels .. '/mar097.bsp') diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index 38ea1c813f..b0d8c1c486 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -2,7 +2,13 @@ local transforms = asset.require('./transforms') local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.require('./trail') -local labelsPath = asset.require('./mars_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Mars Labels", + Type = "HttpSynchronization", + Identifier = "mars_labels", + Version = 1 +}) -- local marsRadii = { 3396190.0, 3396190.0, 3376200.0 } local marsRadii = { 3396190.0, 3396190.0, 3396190.0 } diff --git a/data/assets/scene/solarsystem/planets/mars/mars_globelabels.asset b/data/assets/scene/solarsystem/planets/mars/mars_globelabels.asset deleted file mode 100644 index ca47fef12e..0000000000 --- a/data/assets/scene/solarsystem/planets/mars/mars_globelabels.asset +++ /dev/null @@ -1,7 +0,0 @@ -local LabelsPath = asset.syncedResource({ - Name = "Mars Labels", - Type = "HttpSynchronization", - Identifier = "mars_labels", - Version = 1 -}) -asset.export("LabelsPath", LabelsPath) diff --git a/data/assets/scene/solarsystem/planets/mars/mars_textures.asset b/data/assets/scene/solarsystem/planets/mars/mars_textures.asset deleted file mode 100644 index 757bad1d08..0000000000 --- a/data/assets/scene/solarsystem/planets/mars/mars_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Mars Textures", - Type = "HttpSynchronization", - Identifier = "mars_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset index a7b3d5e7aa..e5fb205cf4 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset @@ -1,6 +1,12 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') -local kernels = asset.require('../mar097').Kernels + +local kernels = asset.syncedResource({ + Name = "Mars Spice Kernels", + Type = "HttpSynchronization", + Identifier = "mars_kernels", + Version = 1 +}) local Deimos = { @@ -11,13 +17,13 @@ local Deimos = { Type = "SpiceRotation", SourceFrame = "IAU_DEIMOS", DestinationFrame = "GALACTIC", - Kernels = kernels + Kernels = kernels .. '/mar097.bsp' }, Translation = { Type = "SpiceTranslation", Target = "DEIMOS", Observer = "MARS BARYCENTER", - Kernels = kernels + Kernels = kernels .. '/mar097.bsp' } }, Renderable = { diff --git a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset index 353c73e320..4daa558e81 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset @@ -1,6 +1,12 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') -local kernels = asset.require('../mar097').Kernels + +local kernels = asset.syncedResource({ + Name = "Mars Spice Kernels", + Type = "HttpSynchronization", + Identifier = "mars_kernels", + Version = 1 +}) local Phobos = { @@ -11,13 +17,13 @@ local Phobos = { Type = "SpiceRotation", SourceFrame = "IAU_PHOBOS", DestinationFrame = "GALACTIC", - Kernels = kernels + Kernels = kernels .. '/mar097.bsp' }, Translation = { Type = "SpiceTranslation", Target = "PHOBOS", Observer = "MARS BARYCENTER", - Kernels = kernels + Kernels = kernels .. '/mar097.bsp' } }, Renderable = { diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset index 7ded2c0167..48e77aa092 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../mercury_textures").TexturesPath local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local texturesPath = asset.syncedResource({ + Name = "Mercury Textures", + Type = "HttpSynchronization", + Identifier = "mercury_abundance_textures", + Version = 1 +}) + local layer = { Name = "Aluminium Abundance", Identifier = "alsimap_02122015", diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset index 32f3535fd6..4349b52fa6 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../mercury_textures").TexturesPath local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local texturesPath = asset.syncedResource({ + Name = "Mercury Textures", + Type = "HttpSynchronization", + Identifier = "mercury_abundance_textures", + Version = 1 +}) + local layer = { Name = "Calcium Abundance", Identifier = "casimap_02122015", diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset index dd3c272b19..44de613d98 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../mercury_textures").TexturesPath local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local texturesPath = asset.syncedResource({ + Name = "Mercury Textures", + Type = "HttpSynchronization", + Identifier = "mercury_abundance_textures", + Version = 1 +}) + local layer = { Name = "Iron Abundance", Identifier = "fesimap_02122015", diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset index 8dbb6ce060..9eaa922e2e 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../mercury_textures").TexturesPath local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local texturesPath = asset.syncedResource({ + Name = "Mercury Textures", + Type = "HttpSynchronization", + Identifier = "mercury_abundance_textures", + Version = 1 +}) + local layer = { Name = "Magnesium Abundance", Identifier = "mgsimap_02122015", diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset index 8922f0cdfb..e07396ecb8 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../mercury_textures").TexturesPath local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local texturesPath = asset.syncedResource({ + Name = "Mercury Textures", + Type = "HttpSynchronization", + Identifier = "mercury_abundance_textures", + Version = 1 +}) + local layer = { Name = "Silicon Abundance", Identifier = "ssimap_02122015", diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index f6e8465910..037c85a891 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -1,10 +1,16 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./transforms') -local labelsPath = asset.require('./mercury_globelabels').LabelsPath asset.require("spice/base") asset.require('./trail') +local labelsPath = asset.syncedResource({ + Name = "Mercury Labels", + Type = "HttpSynchronization", + Identifier = "mercury_labels", + Version = 1 +}) + local Mercury = { Identifier = "Mercury", Parent = transforms.MercuryBarycenter.Identifier, diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury_globelabels.asset b/data/assets/scene/solarsystem/planets/mercury/mercury_globelabels.asset deleted file mode 100644 index 14cbb35a14..0000000000 --- a/data/assets/scene/solarsystem/planets/mercury/mercury_globelabels.asset +++ /dev/null @@ -1,7 +0,0 @@ -local LabelsPath = asset.syncedResource({ - Name = "Mercury Labels", - Type = "HttpSynchronization", - Identifier = "mercury_labels", - Version = 1 -}) -asset.export("LabelsPath", LabelsPath) \ No newline at end of file diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury_textures.asset b/data/assets/scene/solarsystem/planets/mercury/mercury_textures.asset deleted file mode 100644 index 3ff8488a6d..0000000000 --- a/data/assets/scene/solarsystem/planets/mercury/mercury_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Mercury Textures", - Type = "HttpSynchronization", - Identifier = "mercury_abundance_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset b/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset index 5ee223dfa1..6d3f350826 100644 --- a/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset +++ b/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../neptune_textures").TexturesPath local globeIdentifier = asset.require("./../../neptune").Neptune.Identifier +local texturesPath = asset.syncedResource({ + Name = "Neptune textures", + Type = "HttpSynchronization", + Identifier = "neptune_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/neptune.jpg", diff --git a/data/assets/scene/solarsystem/planets/neptune/neptune_textures.asset b/data/assets/scene/solarsystem/planets/neptune/neptune_textures.asset deleted file mode 100644 index 13adefb9a0..0000000000 --- a/data/assets/scene/solarsystem/planets/neptune/neptune_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Neptune textures", - Type = "HttpSynchronization", - Identifier = "neptune_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset index f91edea8ed..a694b53569 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset @@ -2,7 +2,13 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.require('./trail') -local labelsPath = asset.require('../saturn_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Saturn Labels", + Type = "HttpSynchronization", + Identifier = "saturn_labels", + Version = 1 +}) local Dione = { Identifier = "Dione", diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione_textures.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione_textures.asset deleted file mode 100644 index d104446236..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/dione/dione_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Dione textures", - Type = "HttpSynchronization", - Identifier = "dione_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset b/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset index 8f58e9f7d2..a6adcf8c7e 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../dione_textures").TexturesPath local globeIdentifier = asset.require("./../../dione").Dione.Identifier +local texturesPath = asset.syncedResource({ + Name = "Dione textures", + Type = "HttpSynchronization", + Identifier = "dione_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/dione.jpg", diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset index 87d416faea..bba6f22c07 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset @@ -2,7 +2,13 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.require('./trail') -local labelsPath = asset.require('../saturn_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Saturn Labels", + Type = "HttpSynchronization", + Identifier = "saturn_labels", + Version = 1 +}) local Enceladus = { Identifier = "Enceladus", diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus_textures.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus_textures.asset deleted file mode 100644 index 39beb256b2..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Enceladus textures", - Type = "HttpSynchronization", - Identifier = "enceladus_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset index cb60a5f6f4..62cb627e83 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../enceladus_textures").TexturesPath local globeIdentifier = asset.require("./../../enceladus").Enceladus.Identifier +local texturesPath = asset.syncedResource({ + Name = "Enceladus textures", + Type = "HttpSynchronization", + Identifier = "enceladus_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/enceladus.jpg", diff --git a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset index 763123733a..25b4c940b2 100644 --- a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset +++ b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset @@ -2,7 +2,13 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.require('./trail') -local labelsPath = asset.require('../saturn_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Saturn Labels", + Type = "HttpSynchronization", + Identifier = "saturn_labels", + Version = 1 +}) local Hyperion = { Identifier = "Hyperion", diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset index 17c3c89c4b..5be09e3359 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset @@ -2,7 +2,13 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.require('./trail') -local labelsPath = asset.require('../saturn_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Saturn Labels", + Type = "HttpSynchronization", + Identifier = "saturn_labels", + Version = 1 +}) local Iapetus = { Identifier = "Iapetus", diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus_textures.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus_textures.asset deleted file mode 100644 index f1446cdb56..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Iapetus textures", - Type = "HttpSynchronization", - Identifier = "iapetus_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset index d90c500f5f..454909fcff 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../iapetus_textures").TexturesPath local globeIdentifier = asset.require("./../../iapetus").Iapetus.Identifier +local texturesPath = asset.syncedResource({ + Name = "Iapetus textures", + Type = "HttpSynchronization", + Identifier = "iapetus_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/iapetus.jpg", diff --git a/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset b/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset index 8f69e96224..7262a13bac 100644 --- a/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../saturn_textures").TexturesPath local globeIdentifier = asset.require("./../../saturn").Saturn.Identifier +local texturesPath = asset.syncedResource({ + Type = "HttpSynchronization", + Name = "Saturn textures", + Identifier = "saturn_textures", + Version = 4 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/saturn.jpg", diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset index d16f67c799..7873d18ded 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../mimas_textures").TexturesPath local globeIdentifier = asset.require("./../../mimas").Mimas.Identifier +local texturesPath = asset.syncedResource({ + Name = "Mimas textures", + Type = "HttpSynchronization", + Identifier = "mimas_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/mimas.jpg", diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset index a54c8bc981..4726d070bc 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset @@ -2,7 +2,13 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.require('./trail') -local labelsPath = asset.require('../saturn_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Saturn Labels", + Type = "HttpSynchronization", + Identifier = "saturn_labels", + Version = 1 +}) local Mimas = { Identifier = "Mimas", diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas_textures.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas_textures.asset deleted file mode 100644 index 9f38f20984..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Mimas textures", - Type = "HttpSynchronization", - Identifier = "mimas_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset index dd36ba9160..c7899722cf 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../rhea_textures").TexturesPath local globeIdentifier = asset.require("./../../rhea").Rhea.Identifier +local texturesPath = asset.syncedResource({ + Name = "Rhea textures", + Type = "HttpSynchronization", + Identifier = "rhea_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/rhea.jpg", diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset index 48926b0140..cdfb4a9038 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset @@ -2,7 +2,13 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.require('./trail') -local labelsPath = asset.require('../saturn_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Saturn Labels", + Type = "HttpSynchronization", + Identifier = "saturn_labels", + Version = 1 +}) local Rhea = { Identifier = "Rhea", diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea_textures.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea_textures.asset deleted file mode 100644 index 659a127fdc..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Rhea textures", - Type = "HttpSynchronization", - Identifier = "rhea_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index 77d44acf2a..de19cb60eb 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -3,7 +3,12 @@ local assetHelper = asset.require('util/asset_helper') asset.require("spice/base") asset.require('./trail') -local texturesPath = asset.require("./saturn_textures").TexturesPath +local texturesPath = asset.syncedResource({ + Type = "HttpSynchronization", + Name = "Saturn textures", + Identifier = "saturn_textures", + Version = 4 +}) local Saturn = { Identifier = "Saturn", diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn_globelabels.asset b/data/assets/scene/solarsystem/planets/saturn/saturn_globelabels.asset deleted file mode 100644 index be23aa78c1..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/saturn_globelabels.asset +++ /dev/null @@ -1,7 +0,0 @@ -local LabelsPath = asset.syncedResource({ - Name = "Saturn Labels", - Type = "HttpSynchronization", - Identifier = "saturn_labels", - Version = 1 -}) -asset.export("LabelsPath", LabelsPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn_textures.asset b/data/assets/scene/solarsystem/planets/saturn/saturn_textures.asset deleted file mode 100644 index 3f29c75b07..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/saturn_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Type = "HttpSynchronization", - Name = "Saturn textures", - Identifier = "saturn_textures", - Version = 4 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset index c8a546bc6c..da20584fcf 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../tethys_textures").TexturesPath local globeIdentifier = asset.require("./../../tethys").Tethys.Identifier +local texturesPath = asset.syncedResource({ + Name = "Tethys textures", + Type = "HttpSynchronization", + Identifier = "tethys_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/tethys.jpg", diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset index a87015d37d..3bc7f43987 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset @@ -2,7 +2,13 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.require('./trail') -local labelsPath = asset.require('../saturn_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Saturn Labels", + Type = "HttpSynchronization", + Identifier = "saturn_labels", + Version = 1 +}) local Tethys = { Identifier = "Tethys", diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys_textures.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys_textures.asset deleted file mode 100644 index 804f577921..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Tethys textures", - Type = "HttpSynchronization", - Identifier = "tethys_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset index 0356317b58..fe470aff6c 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../titan_textures").TexturesPath local globeIdentifier = asset.require("./../../titan").Titan.Identifier +local texturesPath = asset.syncedResource({ + Type = "HttpSynchronization", + Name = "Titan textures", + Identifier = "titan_textures", + Version = 2 +}) + local layer = { Identifier = "Cassini_ISS_Global_Mosaic_4km_Local", Name = "Cassini ISS Global Mosaic 4km", diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset index 25e701052e..a68538c64b 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset @@ -2,7 +2,13 @@ local transforms = asset.require('../transforms') local assetHelper = asset.require('util/asset_helper') local kernel = asset.require('../kernels').sat375 asset.require('./trail') -local labelsPath = asset.require('../saturn_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Saturn Labels", + Type = "HttpSynchronization", + Identifier = "saturn_labels", + Version = 1 +}) local Titan = { Identifier = "Titan", diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan_textures.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan_textures.asset deleted file mode 100644 index d64bdd04f3..0000000000 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Type = "HttpSynchronization", - Name = "Titan textures", - Identifier = "titan_textures", - Version = 2 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset b/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset index bafffffe9c..b1c7636a47 100644 --- a/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset +++ b/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../uranus_textures").TexturesPath local globeIdentifier = asset.require("./../../uranus").Uranus.Identifier +local texturesPath = asset.syncedResource({ + Name = "Uranus Textures", + Type = "HttpSynchronization", + Identifier = "uranus_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/uranus.jpg", diff --git a/data/assets/scene/solarsystem/planets/uranus/uranus_textures.asset b/data/assets/scene/solarsystem/planets/uranus/uranus_textures.asset deleted file mode 100644 index d7200697b6..0000000000 --- a/data/assets/scene/solarsystem/planets/uranus/uranus_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Uranus Textures", - Type = "HttpSynchronization", - Identifier = "uranus_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset index d9f40745c6..77fc18f747 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset @@ -1,6 +1,12 @@ -local texturesPath = asset.require("./../../venus_textures").TexturesPath local globeIdentifier = asset.require("./../../venus").Venus.Identifier +local texturesPath = asset.syncedResource({ + Name = "Venus Textures", + Type = "HttpSynchronization", + Identifier = "venus_textures", + Version = 1 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/venus.jpg", diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 062f58fade..b3cd407a63 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -2,7 +2,13 @@ local assetHelper = asset.require('util/asset_helper') local transforms = asset.require('./transforms') asset.require("spice/base") asset.require('./trail') -local labelsPath = asset.require('./venus_globelabels').LabelsPath + +local labelsPath = asset.syncedResource({ + Name = "Venus Labels", + Type = "HttpSynchronization", + Identifier = "venus_labels", + Version = 1 +}) local Venus = { Identifier = "Venus", diff --git a/data/assets/scene/solarsystem/planets/venus/venus_globelabels.asset b/data/assets/scene/solarsystem/planets/venus/venus_globelabels.asset deleted file mode 100644 index e38e2ea3f8..0000000000 --- a/data/assets/scene/solarsystem/planets/venus/venus_globelabels.asset +++ /dev/null @@ -1,7 +0,0 @@ -local LabelsPath = asset.syncedResource({ - Name = "Venus Labels", - Type = "HttpSynchronization", - Identifier = "venus_labels", - Version = 1 -}) -asset.export("LabelsPath", LabelsPath) diff --git a/data/assets/scene/solarsystem/planets/venus/venus_textures.asset b/data/assets/scene/solarsystem/planets/venus/venus_textures.asset deleted file mode 100644 index 38442cb484..0000000000 --- a/data/assets/scene/solarsystem/planets/venus/venus_textures.asset +++ /dev/null @@ -1,7 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Name = "Venus Textures", - Type = "HttpSynchronization", - Identifier = "venus_textures", - Version = 1 -}) -asset.export("TexturesPath", TexturesPath) diff --git a/data/assets/scene/solarsystem/sun/glare.asset b/data/assets/scene/solarsystem/sun/glare.asset index a45d80dd82..6566d245a3 100644 --- a/data/assets/scene/solarsystem/sun/glare.asset +++ b/data/assets/scene/solarsystem/sun/glare.asset @@ -1,9 +1,14 @@ local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("./transforms") -local textures = asset.require('./sun_textures').TexturesPath asset.require("spice/base") +local textures = asset.syncedResource({ + Type = "HttpSynchronization", + Name = "Sun textures", + Identifier = "sun_textures", + Version = 4 +}) local SunGlare = { Identifier = "SunGlare", diff --git a/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset b/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset index 3a37a2a610..557d57ff06 100644 --- a/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset +++ b/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset @@ -1,6 +1,13 @@ -local texturesPath = asset.require("./../../sun_textures").TexturesPath local globeIdentifier = asset.require("./../../sun").Sun.Identifier + +local texturesPath = asset.syncedResource({ + Type = "HttpSynchronization", + Name = "Sun textures", + Identifier = "sun_textures", + Version = 4 +}) + local layer = { Identifier = "Texture", FilePath = texturesPath .. "/sun.jpg", diff --git a/data/assets/scene/solarsystem/sun/marker.asset b/data/assets/scene/solarsystem/sun/marker.asset index 1c6648c2eb..43d2b9b42b 100644 --- a/data/assets/scene/solarsystem/sun/marker.asset +++ b/data/assets/scene/solarsystem/sun/marker.asset @@ -1,9 +1,14 @@ local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("./transforms") -local textures = asset.require('./sun_textures').TexturesPath asset.require("spice/base") +local textures = asset.syncedResource({ + Type = "HttpSynchronization", + Name = "Sun textures", + Identifier = "sun_textures", + Version = 4 +}) local SunMarker = { Identifier = "SunMarker", diff --git a/data/assets/scene/solarsystem/sun/sun_textures.asset b/data/assets/scene/solarsystem/sun/sun_textures.asset deleted file mode 100644 index fd698e1aea..0000000000 --- a/data/assets/scene/solarsystem/sun/sun_textures.asset +++ /dev/null @@ -1,18 +0,0 @@ -local TexturesPath = asset.syncedResource({ - Type = "HttpSynchronization", - Name = "Sun textures", - Identifier = "sun_textures", - Version = 4 -}) - -asset.export("TexturesPath", TexturesPath) - - -asset.meta = { - Name = "Sun Textures", - Version = "4.0", - Description = [[ Default Sun textures]], - Author = "OpenSpace Team", - URL = "http://openspaceproject.com", - License = "MIT license" -} diff --git a/data/assets/sync/everything.asset b/data/assets/sync/everything.asset index 976e7d3027..3f7806f4b9 100644 --- a/data/assets/sync/everything.asset +++ b/data/assets/sync/everything.asset @@ -1,6 +1,6 @@ --- Please note that this scene/asset is not meant to be included anywhere directly. --- Rather it is used in the Sync application to synchronize the entire asset folder --- without needing manual adaption +-- Please note that this scene/asset is not meant to be included anywhere directly and +-- OpenSpace will probably fail as soon as it gets to the initialization step, but at +-- least the synchronization will all work local assetHelper = asset.require('../util/asset_helper') diff --git a/data/assets/util/circle.asset b/data/assets/util/circle.asset deleted file mode 100644 index 4717b87883..0000000000 --- a/data/assets/util/circle.asset +++ /dev/null @@ -1,8 +0,0 @@ -local circle = asset.syncedResource({ - Name = "Circle", - Type = "HttpSynchronization", - Identifier = "circle_image", - Version = 1 -}) - -asset.export('circle', circle) diff --git a/data/profiles/bastille-day.profile b/data/profiles/bastille-day.profile index cae5794f7b..9cdf5449a6 100644 --- a/data/profiles/bastille-day.profile +++ b/data/profiles/bastille-day.profile @@ -55,8 +55,7 @@ "scene/solarsystem/planets/earth/magnetosphere/magnetosphere", "scene/solarsystem/planets/earth/magnetosphere/transforms_magnetosphere", "scene/solarsystem/planets/earth/satellites/satellites", - "scene/solarsystem/sun/euv_layer", - "scene/solarsystem/sun/sun_textures" + "scene/solarsystem/sun/euv_layer" ], "camera": { "altitude": 3400000000.0, diff --git a/data/tasks/full_sync.task b/data/tasks/full_sync.task deleted file mode 100644 index 4b1b5ad6e7..0000000000 --- a/data/tasks/full_sync.task +++ /dev/null @@ -1,34 +0,0 @@ -return { - { - Type = "SyncAssetTask", - Asset = "default" - }, - { - Type = "SyncAssetTask", - Asset = "newhorizons" - }, - { - Type = "SyncAssetTask", - Asset = "rosetta" - }, - { - Type = "SyncAssetTask", - Asset = "dawn" - }, - { - Type = "SyncAssetTask", - Asset = "juno" - }, - { - Type = "SyncAssetTask", - Asset = "osirisrex" - }, - { - Type = "SyncAssetTask", - Asset = "voyager" - }, - { - Type = "SyncAssetTask", - Asset = "sync/everything" - } -} diff --git a/data/tasks/gaia/gaia_download.task b/data/tasks/gaia/gaia_download.task deleted file mode 100644 index aa09142bde..0000000000 --- a/data/tasks/gaia/gaia_download.task +++ /dev/null @@ -1,6 +0,0 @@ -return { - { - Type = "SyncAssetTask", - Asset = "scene/milkyway/gaia/gaia_dr2_download_stars" - } -} diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt index 797f419d56..9b28568d2c 100644 --- a/ext/CMakeLists.txt +++ b/ext/CMakeLists.txt @@ -65,13 +65,11 @@ add_library(external-curl INTERFACE) if (WIN32) target_include_directories(external-curl INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/curl/include") target_link_libraries(external-curl INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/curl/lib/libcurl.lib") - target_compile_definitions(external-curl INTERFACE "OPENSPACE_CURL_ENABLED" "CURL_STATICLIB") else () find_package(CURL) if (CURL_FOUND) target_include_directories(external-curl INTERFACE ${CURL_INCLUDE_DIRS}) target_link_libraries(external-curl INTERFACE ${CURL_LIBRARIES}) - target_compile_definitions(external-curl INTERFACE "OPENSPACE_CURL_ENABLED") endif () endif () end_dependency() diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 5b48f40b2e..cf6ed4ac19 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -92,7 +92,6 @@ public: std::vector encode(); void decode(std::vector data); - void scheduleLoadSingleAsset(std::string assetPath); void toggleShutdownMode(); // Guaranteed to return a valid pointer @@ -110,7 +109,7 @@ public: static scripting::LuaLibrary luaLibrary(); private: - void loadAsset(const std::string& assetName); + void loadAssets(); void loadFonts(); void runGlobalCustomizationScripts(); @@ -126,9 +125,6 @@ private: std::unique_ptr _loadingScreen; std::unique_ptr _versionChecker; - bool _hasScheduledAssetLoading = false; - std::string _scheduledAssetPathToLoad; - glm::vec2 _mousePosition = glm::vec2(0.f); //grabs json from each module to pass to the documentation engine. diff --git a/include/openspace/scene/asset.h b/include/openspace/scene/asset.h index d20f42ccd2..eeb2dd72de 100644 --- a/include/openspace/scene/asset.h +++ b/include/openspace/scene/asset.h @@ -26,156 +26,276 @@ #define __OPENSPACE_CORE___ASSET___H__ #include -#include -#include +#include #include -#include -#include namespace openspace { -class AssetLoader; +class AssetManager; -class Asset : public std::enable_shared_from_this { +/** + * This class represents a successfully loaded Asset. Each Lua asset file results in + * exactly one instance of this class unless it contains a syntax error or some other + * error occurred while loading. Each Asset can have 0-* number of resource + * synchronizations that were requested through the `syncedResource` function in Lua and + * 0-* number of other Assets that this Asset requires (through the `require` function in + * Lua. There also is a list of requiring assets that contain all assets which require + * this asset. + * An asset goes through three external states. Starting out as unloaded when the instance + * is newly created but the file has not been processed. In this case the #isLoaded, + * #isSynchronized and the #isInitialized functions all return \c false. After the asset + * has been loaded it is in the \c Loaded state (#isLoaded = true, + * #isSynchronized = false, #isInitialized = false). After all registered synchronizations + * finish successfully, the Asset transitions into the Synchronized state + * (#isLoaded = true, #isSynchronized = true, #isInitialized = false) and after the final + * initialization step, the asset is initialized (#isLoaded = true, + * #isSynchronized = true and #isInitialized = true) + */ +class Asset { public: - enum class State { - Unloaded, - LoadingFailed, - Loaded, - Synchronizing, - SyncResolved, - SyncRejected, - Initialized, - InitializationFailed - }; - + /// This struct contains all the meta information about this asset struct MetaInformation { + /// The name of the asset std::string name; + /// The version number of the asset. This is only a string representation and does + /// not have to follow SemVer (even though it is advised) std::string version; + /// A user-facing description of the asset contents std::string description; + /// The author of the asset std::string author; + /// A URL where a consumer of the asset might find additional information about, + /// for example, the author or the used dataset(s) std::string url; + /// The license under which this asset has been provided std::string license; + /// A list of all scene graph nodes that have been created in this asset std::vector identifiers; }; /** - * Root asset constructor + * Creates a new Asset that is backed by the provided \p assetPath. The \p manager is + * the AssetManager instance that is responsible for loading this and all the other + * required Assets. + * + * \param manager The AssetManager that is responsible for loading this Asset and all + * of its dependencies + * \param assetPath The file path that will be used to load this Asset + * + * \pre The \p assetPath must not be empty and must be an existing file */ - Asset(AssetLoader* loader, SynchronizationWatcher* watcher); + Asset(AssetManager& manager, std::filesystem::path assetPath); /** - * Regular asset constructor + * Returns the path to the file that was used to initialize this Asset. + * + * \return The path to the file that was used to initialize this Asset */ - Asset(AssetLoader* loader, SynchronizationWatcher* watcher, std::string assetPath); - - std::string id() const; - const std::string& assetFilePath() const; - bool hasAssetFile() const; - std::string assetDirectory() const; - const std::string& assetName() const; - AssetLoader* loader() const; - State state() const; - - void addSynchronization(std::unique_ptr synchronization); - void clearSynchronizations(); - std::vector ownSynchronizations() const; - - void syncStateChanged(ResourceSynchronization* sync, - ResourceSynchronization::State state); + std::filesystem::path path() const; /** - * Load this asset and return true if successful, - * i.e. if this and all required assets loaded without errors. + * Adds a new dependent ResourceSynchronization object to this Asset. + * + * \param synchronization The resource synchronization object that is bound to this + * Asset + * \pre \p synchronization must not be nullptr + * \pre \p synchronization must not have been added to this Asset before + */ + void addSynchronization(ResourceSynchronization* synchronization); + + /** + * Updates the state of this Asset based on the latest synchronization being + * successfully resolved. Depending on the sum state of all registered + * synchronizations this Asset's state changes to successfully Synchronized, or Failed + */ + void setSynchronizationStateResolved(); + + /** + * Updates the state of this Asset based on the latest synchronization being rejected. + * Depending on the sum state of all registered synchronizations this Asset's state + * changes to successfully Synchronized, or Failed + */ + void setSynchronizationStateRejected(); + + /** + * If the asset has not yet been loaded, this function loads the asset and returns the + * success state. If the loading succeeded, the Asset transitions into the \c Loaded + * state. The \p parent that is provided is the Asset that caused this load operation + * to be triggered and might be \c nullptr if this asset does not have any parents. If + * this Asset has been previously loaded (even with a different \p parent), this + * function does nothing. + * + * \param parent The parent asset (or \c nullptr) that triggered this loading + */ + void load(Asset* parent); + + /** + * Returns \c true if this Asset has at least one parent that is in the Loaded state. + * + * \return \c true if this Asset has at least one parent that is in the Loaded state */ - bool load(); bool hasLoadedParent(); + + /** + * Returns \c true if this Asset has been successfully #load ed. + * + * /return \c true if this Asset has been successfully loaded + */ bool isLoaded() const; + + /** + * Unloads this Asset and unrequires all of its required assets, potentially causing + * a cascading effect of further #unload calls if this asset was those required assets + * only parent. After this call, this Asset will be in the Unloaded state. If this + * Asset has already been unloaded (or has not yet been loaded), this function does + * nothing. + */ void unload(); - void unloadIfUnwanted(); /** - * Start synchronizations of this asset and return true if all - * its own synchronizations and required assets' synchronizations could start. + * Starts the registered synchronizations of this asset and returns \c true if all its + * synchronizations and required assets' synchronizations could start. When all + * synchronizations have completed successfully, this Asset transitions into the + * Synchronized state. + * + * \pre This Asset must have been Loaded before */ - bool startSynchronizations(); - float requiredSynchronizationProgress() const; - float requestedSynchronizationProgress(); + void startSynchronizations(); /** - * Initialize this asset and return true if successful, - * i.e. if this and all required assets initialized without errors. + * Returns \c true if this Asset's synchronizations (if any) have completed + * successfully. + * + * \return \c true if this Asset is in the Synchronized or Initialized state + */ + bool isSynchronized() const; + + /** + * Initializes this asset and returns \c true if the initialized succeeded, i.e. if + * this and all required assets initialized without errors. After this call, if it has + * been successful, this Asset is in the Initialized state. If the Asset has already + * been initialized, calling this function does nothing. + */ + void initialize(); + + /** + * Returns \c true if this Asset has been #initialize d successfully. + * + * \return \c true if this Asset has been #initialize d successfully. It returns + * \c false both if this initialization failed as well as if thie #initialize + * function has not been called on this Asset */ - bool initialize(); - bool hasInitializedParent() const; bool isInitialized() const; + + /** + * Returns whether any of the parents of this Asset is currently in an initialized + * state, meaning that any parent is still interested in this Asset at all. + * + * \return \c true if there is at least one initialized parent, \c false otherwise + */ + bool hasInitializedParent() const; + + /** + * Deinitializes this Asset and recursively deinitializes the required assets if this + * Asset was their ownly initialized parent. If the Asset was already deinitialized, + * calling this function does nothing. + */ void deinitialize(); - void deinitializeIfUnwanted(); - // Dependency graph - bool requires(const Asset* asset) const; - void require(std::shared_ptr child); - void unrequire(Asset* child); + /** + * Marks the passed \p child as being required by \p this Asset. If the \p child is + * already required by this asset, this function does nothing. + * + * \param child The asset that is required by this asset + * \pre \p child must not be nullptr + */ + void require(Asset* child); - bool requests(Asset* asset) const; - void request(std::shared_ptr child); - void unrequest(Asset* child); - - std::vector requestedAssets() const; - std::vector requestingAssets() const; - std::vector requiredAssets() const; - std::vector requiringAssets() const; - - std::vector subTreeAssets() const; - std::vector childAssets() const; + /** + * Returns \c true if the loading of the Asset has failed in any way so that + * recovering from the error is impossible. + * + * \return \c true if the Asset handling failed in any way, \c false otherwise + */ + bool isFailed() const; + /** + * Sets the provided \p metaInformation as the meta information struct for this asset. + * If previous information existed, it will be silently overwritten. + * + * \param metaInformation The meta information about this asset + */ void setMetaInformation(MetaInformation metaInformation); + + /** + * Returns the meta information of this asset back to the caller. If no such + * information exists, a \c std::nullopt will be returned. + * + * \return The MetaInformation about this asset or \c std::nullopt + */ std::optional metaInformation() const; private: + /// All of the (internal) states that the Asset can move through. The externally + /// visible states (Loaded, Synchronized, Initialized) are a subset of these states + enum class State { + /// The asset is created, but the Lua file has not been executed yet + Unloaded, + /// The execution of the asset file as Lua failed with some error + LoadingFailed, + /// The loading of the asset file succeeded + Loaded, + /// The Asset is currently synchronizing its ResourceSynchronizations and waiting + /// for them to finish + Synchronizing, + /// All registered synchronizations have completed successfully + Synchronized, + /// At least one of the registered synchronizations failed to synchronize + SyncRejected, + /// The onInitialize method (if the asset has one) was executed successfully + Initialized, + /// The execution of the onInitialize method (if existing) resulted in a Lua error + InitializationFailed + }; + + /** + * Sets the \p state of this Asset to the new state. Depending on the current state of + * this Asset, if \p state is a state related to the synchronization, it will + * potentially propagate to this Asset's parents and cause them to be set to be + * successfully synchronized or faild. + * + * \param state The new State that this Asset is set to + */ void setState(State state); - void requiredAssetChangedState(Asset::State childState); - void requestedAssetChangedState(Asset* child, Asset::State childState); - - bool isSynchronized() const; + /// Returns whether the Asset is synchronizing or has successfully synchronized bool isSyncingOrResolved() const; - bool isSyncResolveReady(); - bool hasSyncingOrResolvedParent() const; - bool cancelAllSynchronizations(); - bool cancelUnwantedSynchronizations(); - std::vector requiredSubTreeAssets() const; + /// Returns whether the Asset has been successfully synchronized, meaning that both + /// its own resource synchronizations are finished as well as all requiered assets are + /// finished synchronizing + bool isSyncResolveReady() const; - std::atomic _state; - AssetLoader* _loader; - SynchronizationWatcher* _synchronizationWatcher; + /// The state that this Asset is currently in + std::atomic _state = State::Unloaded; - std::vector> _synchronizations; + /// Reference to the manager that is responsible for loading and unloading this asset + AssetManager& _manager; - bool _hasAssetPath; - // The name of the asset - std::string _assetName; - - // Absolute path to asset file - std::string _assetPath; + /// Absolute path to asset file + std::filesystem::path _assetPath; + /// Additional information about this asset, such as its name, author, license, etc std::optional _metaInformation; - // Required assets - std::vector> _requiredAssets; + /// Assets that are required by this asset + std::vector _requiredAssets; - // Assets that refers to this asset as a required asset - std::vector> _requiringAssets; + /// Assets that refers to this asset as a required asset + std::vector _parentAssets; - // Requested assets - std::vector> _requestedAssets; - - // Assets that refers to this asset as a requested asset - std::vector> _requestingAssets; - - // Synchronization watches - std::vector _syncWatches; + /// Synchronizations that were requested by this asset + std::vector _synchronizations; }; } // namespace openspace diff --git a/include/openspace/scene/assetlistener.h b/include/openspace/scene/assetlistener.h deleted file mode 100644 index 60546b521e..0000000000 --- a/include/openspace/scene/assetlistener.h +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#ifndef __OPENSPACE_CORE___ASSETLISTENER___H__ -#define __OPENSPACE_CORE___ASSETLISTENER___H__ - -#include - -namespace openspace { - -class AssetListener { -public: - virtual ~AssetListener() = default; - virtual void assetStateChanged(Asset* asset, Asset::State state) = 0; - virtual void assetRequested(Asset* parent, std::shared_ptr child) = 0; - virtual void assetUnrequested(Asset* parent, std::shared_ptr child) = 0; -}; - -} // namespace openspace - -#endif // __OPENSPACE_CORE___ASSETLISTENER___H__ diff --git a/include/openspace/scene/assetloader.h b/include/openspace/scene/assetloader.h deleted file mode 100644 index 141dc5aa2c..0000000000 --- a/include/openspace/scene/assetloader.h +++ /dev/null @@ -1,225 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#ifndef __OPENSPACE_CORE___ASSETLOADER___H__ -#define __OPENSPACE_CORE___ASSETLOADER___H__ - -#include -#include -#include -#include -#include -#include - -struct lua_State; - -namespace ghoul::filesystem { class Directory; } -namespace ghoul::lua { class LuaState; } - -namespace openspace { - -namespace assetloader { - -int onInitialize(lua_State* state); -int onDeinitialize(lua_State* state); -int onInitializeDependency(lua_State* state); -int onDeinitializeDependency(lua_State* state); -int require(lua_State* state); -int exists(lua_State* state); -int localResource(lua_State* state); -int syncedResource(lua_State* state); -int exportAsset(lua_State* state); - -} // namespace assetloader - -class AssetListener; -class ResourceSynchronization; -class SynchronizationWatcher; - -class AssetLoader { -public: - AssetLoader(ghoul::lua::LuaState* luaState, SynchronizationWatcher* syncWatcher, - std::string assetRootDirectory); - - ~AssetLoader(); - - /** - * Add the asset as a request of the root asset - */ - std::shared_ptr add(const std::string& identifier); - - /** - * Remove the asset as a request of the root asset - */ - void remove(const std::string& identifier); - - /** - * Enable the asset to be reused when the same path is required/requested again - */ - void trackAsset(std::shared_ptr asset); - - /** - * Disable the asset from being reused when the same path is required/requested again - */ - void untrackAsset(Asset* asset); - - /** - * Return the asset identified by the identifier, - * if the asset is tracked. Otherwise return nullptr. - */ - std::shared_ptr has(const std::string& identifier) const; - - /// Return the root asset - const Asset& rootAsset() const; - - /// Return the root asset - Asset& rootAsset(); - - /** - * Return the asset root directory - */ - const std::string& assetRootDirectory() const; - - /** - * Load an asset - */ - bool loadAsset(Asset* asset); - - /** - * Unload an asset - */ - void unloadAsset(Asset* asset); - - /** - * Call the onInitialize function specified in the asset file - */ - void callOnInitialize(Asset* asset); - - /** - * Call the onDeinitialize function specified in the asset file - */ - void callOnDeinitialize(Asset* asset); - - /** - * Call the dependency.onInitialize function specified in the asset file - */ - void callOnDependencyInitialize(Asset* asset, Asset* dependant); - - /** - * Call the dependency.onDeinitialize function specified in the asset file - */ - void callOnDependencyDeinitialize(Asset* asset, Asset* dependant); - - /** - * Generate the absolute path for an asset specified as `path` - * relative to `baseDirectory` - */ - std::string generateAssetPath(const std::string& baseDirectory, - const std::string& assetPath) const; - - /** - * Add listener to asset state changes - */ - void addAssetListener(AssetListener* listener); - - /** - * Remove listener to asset state changes - */ - void removeAssetListener(AssetListener* listener); - - /** - * Notify listeners about asset state change - */ - void assetStateChanged(Asset* asset, Asset::State state); - - /** - * Notify listeners about new requests - */ - void assetRequested(Asset* parent, std::shared_ptr child); - - /** - * Notify listeners about removed requests - */ - void assetUnrequested(Asset* parent, std::shared_ptr child); - -private: - void unrequest(const std::string& identifier); - - void setUpAssetLuaTable(Asset* asset); - void tearDownAssetLuaTable(Asset* asset); - - std::shared_ptr getAsset(const std::string& name); - std::filesystem::path currentDirectory() const; - - void setCurrentAsset(Asset* asset); - void addLuaDependencyTable(Asset* dependant, Asset* dependency); - - // Lua functions - int onInitializeLua(Asset* asset); - int onDeinitializeLua(Asset* asset); - int onInitializeDependencyLua(Asset* dependant, Asset* dependency); - int onDeinitializeDependencyLua(Asset* dependant, Asset* dependency); - int requireLua(Asset* dependant); - int requestLua(Asset* parent); - int existsLua(Asset* asset); - int localResourceLua(Asset* asset); - int syncedResourceLua(Asset* asset); - int exportAssetLua(Asset* asset); - - // Friend C closures (callable from Lua, and maps to Lua functions above) - friend int assetloader::onInitialize(lua_State* state); - friend int assetloader::onDeinitialize(lua_State* state); - friend int assetloader::onInitializeDependency(lua_State* state); - friend int assetloader::onDeinitializeDependency(lua_State* state); - friend int assetloader::require(lua_State* state); - friend int assetloader::exists(lua_State* state); - friend int assetloader::localResource(lua_State* state); - friend int assetloader::syncedResource(lua_State* state); - friend int assetloader::exportAsset(lua_State* state); - - // Member variables - std::shared_ptr _rootAsset; - Asset* _currentAsset = nullptr; - std::unordered_map> _trackedAssets; - SynchronizationWatcher* _synchronizationWatcher; - std::string _assetRootDirectory; - ghoul::lua::LuaState* _luaState; - - // State change listeners - std::vector _assetListeners; - - // References to Lua values - std::unordered_map> _onInitializationFunctionRefs; - std::unordered_map> _onDeinitializationFunctionRefs; - std::unordered_map>> - _onDependencyInitializationFunctionRefs; - std::unordered_map>> - _onDependencyDeinitializationFunctionRefs; - - int _assetsTableRef = 0; -}; - -} // namespace openspace - -#endif // __OPENSPACE_CORE___ASSETLOADER___H__ diff --git a/include/openspace/scene/assetmanager.h b/include/openspace/scene/assetmanager.h index cec0176a17..93318c8f58 100644 --- a/include/openspace/scene/assetmanager.h +++ b/include/openspace/scene/assetmanager.h @@ -25,58 +25,184 @@ #ifndef __OPENSPACE_CORE___ASSETMANAGER___H__ #define __OPENSPACE_CORE___ASSETMANAGER___H__ -#include - -#include -#include #include -#include +#include #include -#include +#include namespace openspace { namespace scripting { struct LuaLibrary; } class Asset; -class AssetLoader; -class SynchronizationWatcher; +class ResourceSynchronization; /** - * Interface for managing assets. - * The asset manager interface is only concerned with "top level" assets, and not their - * dependencies. However, an asset is not considered synchronized before all its deps are - * synchronized. Also, setting a target state of an asset to Unloaded will only unload an - * asset from the system if it is not a dependency of a loaded asset. + * The AssetManager class manages the loading, initialization, and unloading of all assets + * loaded in OpenSpace. Most actions of this class are operating in a two-step process + * where first the intent of an action is registered, which is then executed in the next + * call to the #update function. + * All assets are loading through the same Lua state. */ -class AssetManager : AssetListener { +class AssetManager { public: - AssetManager(ghoul::lua::LuaState* state, std::string assetRootDirectory); + AssetManager(ghoul::lua::LuaState* state, std::filesystem::path assetRootDirectory); + ~AssetManager(); - virtual ~AssetManager() = default; - - void initialize(); void deinitialize(); + + /** + * Loads the asset at the provided \p path as a new root asset of the AssetManager. + * If the asset at that path was already loaded, nothing happens. + * + * \param path The path from which the Asset is loaded. This path can be either + * relative to the base directory (the path starting with . or ..), an absolute + * path (that path starting with *:/ or /) or relative to the global asset root + * (if the path starts any other way) + * \pre \p path must not be the empty string + */ void add(const std::string& path); + + /** + * Removes the asset at the provided \p path if it has been loaded by this + * AssetManager. If the asset at that path was not found, nothing happens. + * + * \param path The path from which the Asset is loaded. This path can be either + * relative to the base directory (the path starting with . or ..), an absolute + * path (that path starting with *:/ or /) or relative to the global asset root + * (if the path starts any other way) + * \pre \p path must not be the empty string + */ void remove(const std::string& path); - void removeAll(); - const Asset& rootAsset() const; - Asset& rootAsset(); - void assetStateChanged(Asset* asset, Asset::State state) override; - void assetRequested(Asset* parent, std::shared_ptr child) override; - void assetUnrequested(Asset* parent, std::shared_ptr child) override; + /** + * Update function that should be called at least once per frame that will load all + * queued asset loads and asset removal. + */ + void update(); - bool update(); scripting::LuaLibrary luaLibrary(); -private: - std::unordered_map _pendingStateChangeCommands; - std::mutex _pendingInitializationsMutex; - std::vector> _pendingInitializations; + /** + * Returns all assets that have been loaded by the AssetManager. The order of the + * assets is undefined. + * + * \return A list of all assets that have been previously loaded by the AssetManager + */ + std::vector allAssets() const; - SynchronizationWatcher _synchronizationWatcher; - AssetLoader _assetLoader; + std::vector allSynchronizations() const; + + /** + * Loads the provided \p asset as a child of the provided \p parent. Loading an asset + * means that asset file gets executed and the meta information is extracted from it. + * The \p parent is the asset file that caused this loading to happen and can be a + * \c nullptr if the asset is to be loaded as a root asset. + * + * \param asset The asset that should be loaded + * \param parent The parent of the loaded asset file or \c nullptr if the asset is a + * root asset + * \pre \p asset must not be a nullptr + */ + bool loadAsset(Asset* asset, Asset* parent); + + /** + * Unload the provided \p asset by removing all information about it from the Lua + * state and placing the asset onto the deletion queue. Please note that the asset + * will not actually get destroyed until the next #update call to the AssetManager. + * + * \param asset The asset that should get unloaded + * \pre \p asset must not be a nullptr + */ + void unloadAsset(Asset* asset); + + /** + * This function calls the `onInitialize` function that was specified in the file of + * the provided \p asset. + * + * \param asset The asset file whose `onInitialize` function should be called + */ + void callOnInitialize(Asset* asset) const; + + /** + * This function calls the `onDeinitialize` function that was specified in the file of + * the provided \p asset. + * + * \param asset The asset file whose `onDeinitialize` function should be called + */ + void callOnDeinitialize(Asset* asset) const; + +private: + /// Creates and registers all of the callback functions that the asset is expected to + /// call in the file, for example the `localResource`, `require`, etc. + void setUpAssetLuaTable(Asset* asset); + + /// Returns the loaded Asset by either trying to load the asset at the provided path + /// or returning a previously loaded copy + Asset* retrieveAsset(const std::filesystem::path& path); + + /// Setup the asset table of the provided asset in the shared Lua state + void setCurrentAsset(Asset* asset); + + /// Takes the asset path, determines the type of path (relative to base, relative to + /// root or absolute and returns fully formed path + std::filesystem::path generateAssetPath(const std::filesystem::path& baseDirectory, + const std::string& assetPath) const; + + // + // Assets + // + + /// The authoritative list of all assets loaded through the AssetManager + std::vector> _assets; + + /// A list of all root assets that have been loaded directly by the `add` function + std::vector _rootAssets; + + /// This list contains all of the assets that are queued to be loading in the next + /// update call + std::unordered_set _assetAddQueue; + + /// The list contains all of the assets that should be removed in the next update call + std::unordered_set _assetRemoveQueue; + + /// This list contains all assets that need to be initialized in the next update call + std::vector _toBeInitialized; + + /// This list contains all of the assets that will be deleted in the next update call + std::vector> _toBeDeleted; + + // + // ResourceSynchronizations + // + + /// Collection that stores the assets that have requested each ResourceSynchronization + struct SyncItem { + std::unique_ptr synchronization; + std::vector assets; + }; + /// Authoritative list over all ResourceSynchronizations that have been requested by + /// any asset + std::unordered_map> _synchronizations; + /// The list of ResourceSynchronizations that were not finished in the last update + /// call + std::vector _unfinishedSynchronizations; + + // + // Other values + // + + /// The location of the asset root directory + std::filesystem::path _assetRootDirectory; + + /// The Lua state that is used for all asset initialization + ghoul::lua::LuaState* _luaState = nullptr; + + // References to the onInitialize and the onDeinitialize functions for each Asset + std::unordered_map> _onInitializeFunctionRefs; + std::unordered_map> _onDeinitializeFunctionRefs; + + int _assetsTableRef = 0; }; } // namespace openspace diff --git a/include/openspace/util/httprequest.h b/include/openspace/util/httprequest.h index 7bfd0ac35c..d13b1d3143 100644 --- a/include/openspace/util/httprequest.h +++ b/include/openspace/util/httprequest.h @@ -28,267 +28,442 @@ #include #include #include +#include #include #include +#include #include #include #include - -// @TODO: This class is a diamond-of-death; maybe some redesign to make the things into -// components, rather than inheritance? - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4250) -#endif +#include namespace openspace { -namespace curlfunctions { - size_t writeCallback(char* ptr, size_t size, size_t nmemb, void* userData); - - int progressCallback(void* userData, int64_t nTotalDownloadBytes, - int64_t nDownloadedBytes, int64_t nTotalUploadBytes, int64_t nUploadBytes); - - size_t headerCallback(char* ptr, size_t size, size_t nmemb, void* userData); -} - -// Synchronous http request +/** + * This class performs a synchronous HTTP request to the provided URL. Any result that is + * returned based on this request is returned through three callback functions that can be + * registered using the #onHeader, #onProgress, and #onData functions. Calling these + * functions will overwrite any previously registered handler. + * The ProgressCallback can be used to stop the download if the handler returns \c false. + * + * The workflow for this class: + * 1. Create a new object with the URL that points to the location from which the data + * should be loaded + * 2. Register the callbacks that are needed (at least the #onData callback) + * 3. Start the download with the #perform function + */ class HttpRequest { public: - enum class ReadyState : unsigned int { - Unsent, - Loading, - ReceivedHeader, - Fail, - Success - }; + /** + * This callback is called every time there is progress to report for the download. It + * transmits currently downloaded number of bytes (which can be 0 if the download + * hasn't started yet) and the total number of bytes if that value is known. The + * return value determines if the download should continue (if the function returns + * \c true) or if it should abort (if \c false is returned). + * + * \param downloadedBytes The number of bytes that have been downloaded thus far or 0 + * if the download hasn't started yet + * \param totalBytes The total number of bytes for the download if it is known, or a + * std::nullopt of the total size is unknown + * \return \c true if the download should continue or \c false if it should be aborted + */ + using ProgressCallback = std::function< + bool(size_t downloadedBytes, std::optional totalBytes) + >; - struct Progress { - bool totalBytesKnown = false; - size_t totalBytes = 0; - size_t downloadedBytes = 0; - }; + /** + * This callback is executed every time a chunk of data arrived for the download. The + * parameters point to the buffer of this new incoming data and the number of bytes + * that have arrived. The buffer pointed to will most likely only be valid during the + * time of the callback and it is the callbacks responsibility to store the contents + * of the buffer before the callback returns. If the return value is \c true, the + * download continues, if it is \c false, this signals to the library that an error + * has occurred from which recovery is not possible. + * + * \param buffer The pointer to the beginning of the buffer where the new incoming + * data is located. This buffer is only valid during the execution of this + * callback and the contents of the buffer should be copied to a different + * location + * \param size The number of bytes that are contained in the \p buffer + * \return \c true if the download should continue or \c false if it should be aborted + */ + using DataCallback = std::function; - struct Data { - char* buffer; - size_t size; - }; + /** + * This callback is executed when the header of an HTTP request is received + * successfully. The provided buffer and size contain the contents of the header field + * for the response. The buffer pointed to will most likely only be valid during the + * time of the callback and it is the callbacks responsibility to store the contents + * of the buffer before the callback returns. If the return value is \c true, the + * download continues, if it is \c false, this signals to the library that an error + * has occurred from which recovery is not possible. If this function returns + * \c false, it will cause the main download to not start at all. + * + * \param buffer The pointer to the beginning of the buffer where the header + * information is located. This buffer is only valid during the execution of + * this callback and the contents of the buffer should be copied to a different + * location + * \param size The number of bytes that are contained in the \p buffer + * \return \c true if the download should continue or \c false if it should be aborted + */ + using HeaderCallback = std::function; - struct Header { - char* buffer; - size_t size; - }; + /** + * Creates a new HttpRequest object that will try to download the contents at the + * provided \p url. + * + * \param url The URL that should be requested by this HttpRequest + * + * \pre \p url must not be empty + */ + explicit HttpRequest(std::string url); - using ReadyStateChangeCallback = std::function; - - // ProgressCallback: Return non-zero value to cancel download. - using ProgressCallback = std::function; - - // DataCallback: Return number of bytes successfully stored. - // If this does not match the data buffer sice reported in Data, - // the request will fail. - using DataCallback = std::function; - - // HeaderCallback: Return number of bytes successfully stored. - // If this does not match the data buffer sice reported in Header, - // the request will fail. - using HeaderCallback = std::function; - - struct RequestOptions { - int requestTimeoutSeconds; // 0 for no timeout - }; - - HttpRequest(std::string url); - - void onReadyStateChange(ReadyStateChangeCallback cb); + /** + * Registers a callback that will be called when the header for the request has been + * transmitted successfully. The contents of the header will be passed into the + * callback and the callback returns whether the request should proceed or be aborted. + * + * \param cb The callback that should be registered. This will silently replace any + * previously registered callback + */ void onHeader(HeaderCallback cb); + + /** + * Registers a callback that will be called whenever there is progress to be reported + * on the transfer of the request's body. The callback will receive information about + * the number of bytes that have been downloaded and the total number of bytes that + * should be downloaded to complete the request. This information might not always be + * available. The callback's return value determines whether the request should + * continue or be aborted. + * + * \param cb The callback that should be registered. This will silently replace any + * previously registered callback + */ void onProgress(ProgressCallback cb); + + /** + * Registers a callback that will be called whenever there is new data that has been + * received from the request. It is this callback's responsibility to store that data + * in a place that is persistent across multiple calls to the callback, usually by + * storing it in an external buffer and appending to it. The callback can return + * whether the download should proceed (by returning \c true) or be aborted (by + * returning \c false). + * + * \param cb The callback that should be registered. This will silently replace any + * previously registered callback + */ void onData(DataCallback cb); - void perform(RequestOptions opt); + /** + * Performs the request to the URL provided in the constructor. As this request is + * handled synchronously, this function will only return once the request has been + * completed successfully or failed. During this call, the registered callbacks will + * be called repeatedly until the request finishes. This function returns whether the + * request was completed successfully or failed. + * + * \param timeout The amount of time the request will wait before aborting due to the + * server not responding. If this value is 0, there is no timeout on the + * request. + * + * \return \c true if the request completed successfully, \c false otherwise + */ + bool perform(std::chrono::milliseconds timeout = std::chrono::milliseconds(0)); + /** + * Returns the URL that was passed into the constructor of this HttpRequest. + * + * \return The URL that was passed into the constructor of this HttpRequest + */ const std::string& url() const; private: - void setReadyState(ReadyState state); - - std::string _url; - - ReadyStateChangeCallback _onReadyStateChange; - ProgressCallback _onProgress; - DataCallback _onData; + /// The callback that will be called when the header was received successfully HeaderCallback _onHeader; - ReadyState _readyState; - Progress _progress; + /// The callback that will be called when there is progress to be reported + ProgressCallback _onProgress; - friend size_t curlfunctions::writeCallback(char* ptr, size_t size, size_t nmemb, - void* userData); + /// The callback that will be called when there is data to be stored away + DataCallback _onData; - friend int curlfunctions::progressCallback(void* userData, - int64_t nTotalDownloadBytes, - int64_t nDownloadedBytes, int64_t nTotalUploadBytes, int64_t nUploadBytes); - - friend size_t curlfunctions::headerCallback(char* ptr, size_t size, size_t nmemb, - void* userData); + /// The URL that this HttpRequest is going to request + std::string _url; }; +/** + * This abstract base class uses the HttpRequest class to perform an asynchronous + * download. Every subclass needs to implement at least the #handleData function that will + * be called every time a chunk of data has been received from the request. The download + * is started through the #start function and it is possible to turn this into a + * synchronous download by executing the #wait function directly afterwards. If a + * HttpRequest::ProgressCallback has been registered through the #onProgress function, + * that callback is called every time the download some progress to report. + */ class HttpDownload { public: - using ProgressCallback = std::function; - using HeaderCallback = std::function; + /** + * Creates a new HttpDownload that will start to download the file pointed to by the + * \param url parameter as soon as the download is #start ed. + * + * \param url The URL that should be downloaded by this HttpDownload + * + * \pre \p url must not be empty + */ + explicit HttpDownload(std::string url); - HttpDownload(); - HttpDownload(HttpDownload&& d) = default; - HttpDownload& operator=(HttpDownload&&) = default; - virtual ~HttpDownload() = default; - void onProgress(ProgressCallback progressCallback); - void onHeader(HeaderCallback headerCallback); - bool hasStarted() const; + /** + * Virtual destructor that will cancel the ongoing download and block until the + * download is successfully canceled. + */ + virtual ~HttpDownload(); + + /** + * Registers a callback that will be called whenever there is progress to be reported + * on the file's download. The callback will receive information about the number of + * bytes that have been downloaded and the total number of bytes that should be + * downloaded. This information might not always be available. The callback's return + * value determines whether the request should continue or be aborted. + * + * \param progressCallback The callback that should be registered. This will silently + * replace any previously registered callback + */ + void onProgress(HttpRequest::ProgressCallback progressCallback); + + /** + * Starts the asynchronous download of the file by starting a new thread that will + * take care of the download, meaning that this function will return almost + * instantaneously. If the HttpDownload is already downloading a file this function + * does nothing. + * + * \param timeout The number of milliseconds that the download will be kept alive + * while waiting for a reply from the server. If this value is 0, the + * connection will never time out + */ + void start(std::chrono::milliseconds timeout = std::chrono::milliseconds(0)); + + /** + * Cancels the ongoing download. Because of the underlying library that is used, the + * transfer will only be aborted the next time any piece of data is received or the + * library reports any progress. + */ + void cancel(); + + /** + * This function will wait until the download has completed and will return the + * success of the download back to the caller. + * + * \return \c true if the downloaded succeeded or \c false if the download failed + */ + bool wait(); + + /** + * Returns \c true if the download has completed and it failed, or \c false if either + * the download is till ongoing or is finished and has succeeded. + * + * \return Whether the download has completed and it failed + */ bool hasFailed() const; + + /** + * Returns \c true if the download has completed successfully , or \c false if either + * the download is till ongoing or is finished and has failed. + * + * \return Whether the download has completed successfully + */ bool hasSucceeded() const; -protected: - virtual size_t handleData(HttpRequest::Data d) = 0; - virtual bool initDownload() = 0; - virtual bool deinitDownload() = 0; - - bool callOnProgress(HttpRequest::Progress p); - void markAsStarted(); - void markAsSuccessful(); - void markAsFailed(); - -private: - ProgressCallback _onProgress; - bool _started = false; - bool _failed = false; - bool _successful = false; -}; - -class SyncHttpDownload : public virtual HttpDownload { -public: - SyncHttpDownload(std::string url); - SyncHttpDownload(SyncHttpDownload&& d) = default; - SyncHttpDownload& operator=(SyncHttpDownload&&) = default; - virtual ~SyncHttpDownload() = default; - void download(HttpRequest::RequestOptions opt); - + /** + * Returns the URL that was passed into the constructor of this HttpDownload. + * + * \return The URL that was passed into the constructor of this HttpDownload + */ const std::string& url() const; protected: - HttpRequest _httpRequest; -}; + /** + * This abstract function has to be implemented by any concrete subclass to handle an + * incoming chunk of data from the download. The parameters point to the \p buffer of + * this new incoming data and the number of bytes that have arrived. The buffer + * pointed to will most likely only be valid during the time of the callback and it is + * the callbacks responsibility to store the contents of the buffer before the + * callback returns. If the return value is \c true, the download continues, if it is + * \c false, this signals to the library that an error has occurred from which + * recovery is not possible. This function will be called on a different thread from + * the one that called the #start method. + * + * \param buffer The beginning of the buffer of this chunk of data + * \param size The number of bytes that the \p buffer contains + * + * \return The implementation should return \c true if the downloading should continue + * and \c false if the handling of the data caused some error that the + * subclass is incapable of recovering from + */ + virtual bool handleData(char* buffer, size_t size) = 0; -class AsyncHttpDownload : public virtual HttpDownload { -public: - AsyncHttpDownload(std::string url); - AsyncHttpDownload(AsyncHttpDownload&& d); - virtual ~AsyncHttpDownload() = default; - void start(HttpRequest::RequestOptions opt); - void cancel(); - void wait(); + /** + * This function is called before the downloading starts and can be used by subclasses + * to perform one-time setup functions, such as opening a file, reserving a block of + * storage, etc. This function guaranteed to be only called once per HttpDownload. + * The return value determines if the setup operation completed successfully or if an + * error occurred that will cause the download to be terminated. This function will be + * called on a different thread from the one that called the #start method. + * + * \return \c true if the setup completed successfully and \c false if the setup + * failed unrecoverably + */ + virtual bool setup(); - const std::string& url() const; - -protected: - void download(HttpRequest::RequestOptions opt); + /** + * This function is called after the downloading has finished and before a potential + * call to #wait is performed. This function can be used by a subclass to perform + * one-time operations that are required when the downloading fininshes, such as + * closing file handles, committing some memory etc. The return value of this function + * signals whether the teardown completed successfully. This function will be called + * on a different thread from the one that called the #start method. + * + * \return \c true if the teardown completed successfully and \c false if it failed + */ + virtual bool teardown(); private: - HttpRequest _httpRequest; - std::thread _downloadThread; - std::mutex _conditionMutex; - std::condition_variable _downloadFinishCondition; + /// The callback that will be called whenever there is some progress to be reported + HttpRequest::ProgressCallback _onProgress; + + /// Value indicating whether the HttpDownload is currently downloading a file + bool _isDownloading = false; + + /// Value indicating whether the download is finished + bool _isFinished = false; + + /// Value indicated whether the download was successful + bool _isSuccessful = false; + + /// Marker telling the downloading thread that the download should be cancelled bool _shouldCancel = false; - std::mutex _stateChangeMutex; + + /// The HttpRequest class that will be used for the download + HttpRequest _httpRequest; + + /// The thread that contains the HttpRequest to download the file + std::thread _downloadThread; + + /// This condition variable is used by the #wait function to be able to wait for + /// completion of the downloading thread + std::condition_variable _downloadFinishCondition; }; -class HttpFileDownload : public virtual HttpDownload { +/** + * This specific subclass of the HttpDownload downloads the contents of the provided URL + * into a file on disk. By default, an existing file will not be overwritten and will + * cause the download to fail. This behavior can be overwritten through a parameter in the + * constructor of this class. + */ +class HttpFileDownload : public HttpDownload { public: BooleanType(Overwrite); - HttpFileDownload() = default; - HttpFileDownload(std::string destination, Overwrite = Overwrite::No); + /** + * Constructor that will create a HttpFileDownload which will download the contents of + * the provided \p url to the \p destinationPath. If the \p destinationPath already + * contains a file and \p overwrite is Overwrite::No, the download will fail; if it is + * Overwrite::Yes, the existing content at the \p destinationPath will be overwritten. + */ + HttpFileDownload(std::string url, std::filesystem::path destinationPath, + Overwrite overwrite = Overwrite::No); + + /** + * This destructor will cancel any ongoing download and wait for its completion, so it + * might not block for a short amount of time. + */ virtual ~HttpFileDownload() = default; - const std::string& destination() const; + /** + * Returns the path where the contents of the URL provided in the constructor will be + * saved to. + * + * \return The path where URL will be downloaded to + */ + std::filesystem::path destination() const; -protected: - bool initDownload() override; - bool deinitDownload() override; - size_t handleData(HttpRequest::Data d) override; +private: + /// Will create all directories that are necessary to reach _destination and then + /// fight with other HttpFileDownloads to get one of a limited number of file handles + /// to open _file + bool setup() override; - static std::mutex _directoryCreationMutex; + /// Closes the _file and returns the handle back to the pool of available handles + bool teardown() override; + + /// Stores the chunk of data into the _file handle + bool handleData(char* buffer, size_t size) override; + + /// A flag whether this HttpFileDownload got a handle from the limited supply of + /// handles. This limit is used to prevent all HttpFileDownloads from getting file + /// handles from the operating system as that resource is limited and downloads would + /// fail unrecoverably if no handles are available. So we limit the maximum number and + /// if that number is exceeded, the HttpFileDownload will wait until a handle is + /// available. std::atomic_bool _hasHandle = false; -private: - std::string _destination; - bool _overwrite; + /// The destination path where the contents of the URL provided in the constructor + /// will be saved to + std::filesystem::path _destination; + + /// The file handle to the _destination used to save incoming chunks std::ofstream _file; - static const int MaxFilehandles = 35; - static std::atomic_int nCurrentFilehandles; + /// Mutex that will be prevent multiple HttpFileDownloads to simultaneously try to + /// create the necessary intermediate directories, which would cause issues + static std::mutex _directoryCreationMutex; + + /// The maximum number of file handles that all HttpFileDownloads combined can use up + static constexpr const int MaxFileHandles = 32; + + /// Stores the number of currently open file handles across all HttpFileDownloads + static std::atomic_int nCurrentFileHandles; }; -class HttpMemoryDownload : public virtual HttpDownload { +/** + * This concerete HttpDownload subclass downloads the contents of the URL passed into the + * constructor into a buffer of memory that can be retrieve. Please note that that buffer + * should only be used accessed once the HttpDownload::hasFinished function returns + * \c true. + */ +class HttpMemoryDownload : public HttpDownload { public: - HttpMemoryDownload() = default; - HttpMemoryDownload(HttpMemoryDownload&& d) = default; - HttpMemoryDownload& operator=(HttpMemoryDownload&&) = default; + /** + * Creates an instance of a HttpMemoryDownload that will download the contents of the + * \p url into memory + * + * \param url The URL whose contents should be downloaded + */ + explicit HttpMemoryDownload(std::string url); + /** + * This destructor will cancel any ongoing download and wait for its completion, so it + * might not block for a short amount of time. + */ virtual ~HttpMemoryDownload() = default; + + /** + * Returns a reference to the buffer that is used to store the contents of the URL + * passed in the constructor. Please observe that while the HttpDownload::hasFinished + * method returns \c false, this buffer will be changed by a different thread and + * access is not thread-safe. After that function returns \c true, it is safe to + * access the buffer. + * + * \return A reference to the buffer used to hold the contents of the URL + */ const std::vector& downloadedData() const; -protected: - bool initDownload() override; - bool deinitDownload() override; - size_t handleData(HttpRequest::Data d) override; - private: - std::vector _downloadedData; -}; + /// Stores each downloaded chunk into the stored buffer + bool handleData(char* buffer, size_t size) override; -// Synchronous download to memory -class SyncHttpMemoryDownload : public SyncHttpDownload, public HttpMemoryDownload { -public: - SyncHttpMemoryDownload(std::string url); - virtual ~SyncHttpMemoryDownload() = default; -}; - -// Synchronous download to file -class SyncHttpFileDownload : public SyncHttpDownload, public HttpFileDownload { -public: - SyncHttpFileDownload( - std::string url, - std::string destinationPath, - HttpFileDownload::Overwrite = Overwrite::No - ); - virtual ~SyncHttpFileDownload() = default; -}; - -// Asynchronous download to memory -class AsyncHttpMemoryDownload : public AsyncHttpDownload, public HttpMemoryDownload { -public: - AsyncHttpMemoryDownload(std::string url); - virtual ~AsyncHttpMemoryDownload() = default; -}; - -// Asynchronous download to file -class AsyncHttpFileDownload : public AsyncHttpDownload, public HttpFileDownload { -public: - AsyncHttpFileDownload( - std::string url, - std::string destinationPath, - HttpFileDownload::Overwrite = Overwrite::No - ); - virtual ~AsyncHttpFileDownload() = default; + /// The buffer where the downloaded chunks are accumulated + std::vector _buffer; }; } // namespace openspace -#ifdef _MSC_VER -#pragma warning(pop) -#endif - - #endif // __OPENSPACE_CORE___HTTPREQUEST___H__ diff --git a/include/openspace/util/resourcesynchronization.h b/include/openspace/util/resourcesynchronization.h index 790439a76f..ff8a073d1e 100644 --- a/include/openspace/util/resourcesynchronization.h +++ b/include/openspace/util/resourcesynchronization.h @@ -26,11 +26,8 @@ #define __OPENSPACE_CORE___RESOURCESYNCHRONIZATION___H__ #include -#include -#include -#include +#include #include -#include namespace ghoul { class Dictionary; } @@ -38,8 +35,152 @@ namespace openspace { namespace documentation { struct Documentation; } +/** + * The ResourceSynchronization class handles the download of persistent datasets, meaning + * that the contents of the data is only downloaded once at the beginning of the + * application. A ResourceSynchronization is created through the #createFromDictionary + * function, whose dictionary must contain at least a \c Type value that specifies which + * type of ResourceSynchronization should be create. Any type that is registered to the + * global factory is a valid type here. + * A ResourceSynchronization state can be in one of four states that can be queried + * through the #isSyncing, #isResolved, and #isRejected functions. The available states + * are: + * \c Unsynchronized (#isSyncing = false, #isResolved = false, #isRejected = false), + * \c Syncing (#isSyncing = true, #isResolved = false, #isRejected = false), + * \c Resolved (#isSyncing = false, #isResolved = true, #isRejected = false), + * \c Rejected (#isSyncing = false, #isResolved = false, #isRejected = true) + */ class ResourceSynchronization { public: + /** + * Creates a new ResourceSynchronization based on the \p dictionary information that + * is passed into this function. The dictionary must contain at least a \c Type, an + * \c Identifier, and a \c Name, with other optional parameters depending on the + * specific subtype of ResourceSynchronization class is is specified through the + * provided \c Type. + * + * \param dictionary The dictionary containing the parameters with which to choose the + * specific type of ResourceSynchronization and all the necessary parameters to + * initialize said ResourceSynchronization + * + * \throw SpecificationError If the \p dictionary does not contain a \c Type, an + * \c Identifier, and a \c Name + */ + static std::unique_ptr createFromDictionary( + const ghoul::Dictionary& dictionary); + + /** + * Generates a unique identifying string for the dictionary that is based on the + * \c Type and the \c Identifier values of the passed \p dictionary. All other + * parameters are ignored, but as long as the \c Type and/or the \c Identifier values + * differ, the resulting string will be different. + * + * \param dictionary The dictionary containing the \c Type and the \c Identifier used + * to create a unique identifier + * + * \throw SpecificationError If the \p dictionary does not contain a \c Type, an + * \c Identifier, and a \c Name + */ + static std::string generateUid(const ghoul::Dictionary& dictionary); + + /// Defaulted virtual constructor + virtual ~ResourceSynchronization() = default; + + /** + * Returns the location to which files downloaded through this ResourceSynchronization + * are saved. + * + * \return The location for files created by this class + */ + virtual std::filesystem::path directory() const = 0; + + /// Starts the synchronization for this ResourceSynchronization + virtual void start() = 0; + + /// Cancels any ongoing synchronization of this ResourceSynchronization + virtual void cancel() = 0; + + /** + * Returns the number of bytes that have already been synchronized or 0 if the + * synchronization hasn't started yet. This number always will only contain the number + * of bytes of actual payload data, not any additional data transfers that some + * subtypes might require. + * + * \return The number of synchronized bytes + */ + size_t nSynchronizedBytes() const; + + /** + * Returns the number of total bytes that ought to be synchronized for this + * ResourceSynchronization to be considered complete. If that number is not known + * (yet), the returned value is 0. This number always will only contain the number of + * bytes of actual payload data, not any additional data transfers that some subtypes + * might require. + * + * \return The total number of required bytes + */ + size_t nTotalBytes() const; + + /** + * Returns \c true if the total number of bytes for this ResourceSynchronization is + * known. Will return \c false otherwise. This number always will only contain the + * number of bytes of actual payload data, not any additional data transfers that some + * subtypes might require. + * + * \return The state whether the number of total bytes is known or not + */ + bool nTotalBytesIsKnown() const; + + /** + * Returns the unique identifier of this ResourceSynchronization. + * + * \return The unique identifier of this ResourceSynchronization + */ + const std::string& identifier() const; + + /** + * Returns the name of this ResourceSynchronization. + * + * \return The name of this ResourceSynchronization + */ + const std::string& name() const; + + /** + * Returns whether this ResourceSynchronization is currently syncing its files and has + * not finished doing so. + * + * \return \c true if this object is currently synchronizing + */ + bool isSyncing() const; + + /** + * Returns whether this ResourceSynchronization has successfully finished + * synchronizing all of its files. Once this has returned \c true, it will stay so + * until the object is destroyed and it is guaranteed that no more files will be added + * to the #directory. + * + * \return \c true if this object is finished synchronizing + */ + bool isResolved() const; + + /** + * Returns whether this ResourceSynchronization has failed to synchronizing all or any + * of its files. Once this has returned \c true, it will stay so until the object is + * destroyed. Some subclasses might try to download as many files as possible, but no + * general guarantee is provided regarding the completeness of the download. + * + * \return \c true if this object has failed synchronizing one or more of the required + * files + */ + bool isRejected() const; + + static documentation::Documentation Documentation(); + +protected: + /// Empty constructor that just sets the synchronization root + ResourceSynchronization(std::filesystem::path synchronizationRoot); + + /// Representation of the state that this object can be in enum class State { Unsynced, Syncing, @@ -47,49 +188,34 @@ public: Rejected }; - using CallbackHandle = size_t; - using StateChangeCallback = std::function; + /// Creates a file next to the directory that indicates that this + /// ResourceSynchronization has successfully synchronized its contents + void createSyncFile() const; - static std::unique_ptr createFromDictionary( - const ghoul::Dictionary& dictionary); + /// Returns whether the synchronization file create in #createSyncFile exists + bool hasSyncFile() const; - ResourceSynchronization(const ghoul::Dictionary& dictionary); - virtual ~ResourceSynchronization() = default; - - virtual std::string directory() = 0; - virtual void start() = 0; - virtual void cancel() = 0; - virtual void clear() = 0; - - virtual size_t nSynchronizedBytes() = 0; - virtual size_t nTotalBytes() = 0; - virtual bool nTotalBytesIsKnown() = 0; - virtual float progress(); - - State state() const; - const std::string& name() const; - bool isResolved() const; - bool isRejected() const; - bool isSyncing() const; - CallbackHandle addStateChangeCallback(StateChangeCallback cb); - void removeStateChangeCallback(CallbackHandle id); - - static documentation::Documentation Documentation(); - -protected: - void resolve(); - void reject(); - void reset(); - void begin(); - -private: - void setState(State state); + /// The internal identifier for this ResourceSynchronization. It is not enforced but + /// advised that this identifier be different for all instances of the same subtype + std::string _identifier; + /// The user-facing name of this ResourceSynchronization std::string _name; + + /// The path to the root folder relative to which synchronization files are placed + const std::filesystem::path _synchronizationRoot; + + /// The current #State of this ResouceSynchronization std::atomic _state = State::Unsynced; - std::mutex _callbackMutex; - CallbackHandle _nextCallbackId = 0; - std::unordered_map _stateChangeCallbacks; + + /// Contains the fact whether the total number of payload bytes is known + std::atomic_bool _nTotalBytesKnown = false; + + /// Contains the total number of payload bytes or 0 if that number is not known + std::atomic_size_t _nTotalBytes = 0; + + /// Contains the number of already synchronized payload bytes + std::atomic_size_t _nSynchronizedBytes = 0; }; } // namespace openspace diff --git a/include/openspace/util/synchronizationwatcher.h b/include/openspace/util/synchronizationwatcher.h deleted file mode 100644 index 1afb1c5dab..0000000000 --- a/include/openspace/util/synchronizationwatcher.h +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#ifndef __OPENSPACE_CORE___SYNCHRONIZATIONWATCHER___H__ -#define __OPENSPACE_CORE___SYNCHRONIZATIONWATCHER___H__ - -#include -#include -#include -#include -#include - -namespace openspace { - -/** - * Delays callbacks of synchronization state changes to - * when notify is called. - */ -class SynchronizationWatcher { -public: - using WatchHandle = size_t; - - struct WatchData { - std::weak_ptr synchronization; - ResourceSynchronization::CallbackHandle callbackHandle; - }; - - struct NotificationData { - std::weak_ptr synchronization; - ResourceSynchronization::State state; - WatchHandle handle; - ResourceSynchronization::StateChangeCallback callback; - }; - - WatchHandle watchSynchronization( - std::shared_ptr synchronization, - ResourceSynchronization::StateChangeCallback callback - ); - - void unwatchSynchronization(WatchHandle watchHandle); - - void notify(); - -private: - std::mutex _mutex; - std::unordered_map _watchedSyncs; - std::vector _pendingNotifications; - - WatchHandle nextWatchHandle = 0; -}; - -} // namespace openspace - -#endif // __OPENSPACE_CORE___SYNCHRONIZATIONWATCHER___H__ diff --git a/include/openspace/util/versionchecker.h b/include/openspace/util/versionchecker.h index f7ce2e4865..d5c70dc08e 100644 --- a/include/openspace/util/versionchecker.h +++ b/include/openspace/util/versionchecker.h @@ -49,7 +49,7 @@ public: SemanticVersion latestVersion(); private: - std::unique_ptr _request; + std::unique_ptr _request; std::optional _latestVersion; }; diff --git a/modules/imgui/CMakeLists.txt b/modules/imgui/CMakeLists.txt index c3d0d391f9..a6de3e6c07 100644 --- a/modules/imgui/CMakeLists.txt +++ b/modules/imgui/CMakeLists.txt @@ -27,7 +27,6 @@ include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) set(HEADER_FILES include/gui.h include/guiactioncomponent.h - include/guiassetcomponent.h include/guicomponent.h include/guifilepathcomponent.h include/guigibscomponent.h @@ -48,7 +47,6 @@ source_group("Header Files" FILES ${HEADER_FILES}) set(SOURCE_FILES src/gui.cpp src/guiactioncomponent.cpp - src/guiassetcomponent.cpp src/guicomponent.cpp src/guifilepathcomponent.cpp src/guigibscomponent.cpp diff --git a/modules/imgui/include/gui.h b/modules/imgui/include/gui.h index e1ada274f6..8e8a930333 100644 --- a/modules/imgui/include/gui.h +++ b/modules/imgui/include/gui.h @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -64,7 +63,7 @@ namespace openspace::gui { namespace detail { constexpr int nComponents() { - const int nRegularComponents = 17; + const int nRegularComponents = 16; int totalComponents = nRegularComponents; #ifdef OPENSPACE_MODULE_ISWA_ENABLED @@ -105,7 +104,6 @@ public: //protected: GuiHelpComponent _help; GuiFilePathComponent _filePath; - GuiAssetComponent _asset; GuiGIBSComponent _gibs; GuiGlobeBrowsingComponent _globeBrowsing; @@ -152,7 +150,6 @@ private: &_iswa, #endif - &_asset, &_actions, &_joystick, &_filePath, diff --git a/modules/imgui/include/guiassetcomponent.h b/modules/imgui/include/guiassetcomponent.h deleted file mode 100644 index cd8b2bf6cc..0000000000 --- a/modules/imgui/include/guiassetcomponent.h +++ /dev/null @@ -1,46 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#ifndef __OPENSPACE_MODULE_IMGUI___GUIASSETCOMPONENT___H__ -#define __OPENSPACE_MODULE_IMGUI___GUIASSETCOMPONENT___H__ - -#include - -namespace openspace { class Asset; } - -namespace openspace::gui { - -class GuiAssetComponent : public GuiComponent { -public: - GuiAssetComponent(); - - void render() override; - -private: - void renderTree(const Asset& asset, const std::string& relativeToPath); -}; - -} // namespace openspace::gui - -#endif // __OPENSPACE_MODULE_IMGUI___GUIASSETCOMPONENT___H__ diff --git a/modules/imgui/src/guiassetcomponent.cpp b/modules/imgui/src/guiassetcomponent.cpp deleted file mode 100644 index d0eedb873f..0000000000 --- a/modules/imgui/src/guiassetcomponent.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace { - std::string assetStateToString(openspace::Asset::State state) { - using State = openspace::Asset::State; - - switch (state) { - case State::Loaded: return "Loaded"; - case State::LoadingFailed: return "LoadingFailed"; - case State::Synchronizing: return "Synchronizing"; - case State::SyncRejected: return "SyncRejected"; - case State::SyncResolved: return "SyncResolved"; - case State::Initialized: return "Initialized"; - case State::InitializationFailed: return "InitializationFailed"; - default: return "Unknown"; - } - } - - std::string syncStateToString(openspace::ResourceSynchronization::State state) { - using State = openspace::ResourceSynchronization::State; - - switch (state) { - case State::Unsynced: return "Unsynced"; - case State::Syncing: return "Syncing"; - case State::Resolved: return "Resolved"; - case State::Rejected: return "Rejected"; - default: return "Unknown"; - } - } -} // namespace - -namespace openspace::gui { - -GuiAssetComponent::GuiAssetComponent() - : GuiComponent("Assets") -{} - -void GuiAssetComponent::render() { - bool e = _isEnabled; - ImGui::Begin("Assets", &e); - _isEnabled = e; - - AssetManager& assetManager = global::openSpaceEngine->assetManager(); - - std::string rootPath; - - for (Asset* a : assetManager.rootAsset().childAssets()) { - renderTree(*a, rootPath); - } - - ImGui::End(); -} - -void GuiAssetComponent::renderTree(const Asset& asset, const std::string& relativeToPath) -{ - using namespace ghoul::filesystem; - - std::string assetPath = asset.assetFilePath(); - std::string assetDirectory = std::filesystem::path(assetPath).parent_path().string(); - - if (!relativeToPath.empty()) { - assetPath = std::filesystem::relative(assetPath, relativeToPath).string(); - } - - std::string assetText = assetPath + " " + assetStateToString(asset.state()); - - if (asset.state() == Asset::State::Synchronizing) { - int prog = static_cast(asset.requiredSynchronizationProgress() * 100); - assetText += " (" + std::to_string(prog) + "%)"; - } - - std::vector requested = asset.requestedAssets(); - std::vector required = asset.requiredAssets(); - - const std::vector& resourceSyncs = - asset.ownSynchronizations(); - - if (requested.empty() && required.empty() && resourceSyncs.empty()) { - ImGui::Text("%s", assetText.c_str()); - } - else if (ImGui::TreeNode(assetPath.c_str(), "%s", assetText.c_str())) { - for (const Asset* child : required) { - renderTree(*child, assetDirectory); - } - - if (!requested.empty() && ImGui::TreeNode("Requested assets")) { - for (const Asset* child : requested) { - renderTree(*child, assetDirectory); - } - ImGui::TreePop(); - } - - if (!resourceSyncs.empty() && ImGui::TreeNode("Resource Synchronizations")) { - for (ResourceSynchronization* sync : resourceSyncs) { - std::string resourceText = sync->directory() + - " " + syncStateToString(sync->state()); - if (sync->state() == ResourceSynchronization::State::Syncing) { - resourceText += " (" + std::to_string( - static_cast(sync->progress() * 100) - ) + "%)"; - } - ImGui::Text("%s", resourceText.c_str()); - } - ImGui::TreePop(); - } - - ImGui::TreePop(); - } -} - -} // namespace openspace::gui diff --git a/modules/sync/CMakeLists.txt b/modules/sync/CMakeLists.txt index 8efa3552de..a3ec91cfd6 100644 --- a/modules/sync/CMakeLists.txt +++ b/modules/sync/CMakeLists.txt @@ -28,7 +28,6 @@ set(HEADER_FILES syncmodule.h syncs/httpsynchronization.h syncs/urlsynchronization.h - tasks/syncassettask.h ) source_group("Header Files" FILES ${HEADER_FILES}) @@ -37,7 +36,6 @@ set(SOURCE_FILES syncmodule_lua.inl syncs/httpsynchronization.cpp syncs/urlsynchronization.cpp - tasks/syncassettask.cpp ) source_group("Source Files" FILES ${SOURCE_FILES}) diff --git a/modules/sync/syncmodule.cpp b/modules/sync/syncmodule.cpp index df23f84188..3f4980ba2f 100644 --- a/modules/sync/syncmodule.cpp +++ b/modules/sync/syncmodule.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -40,6 +39,7 @@ #include #include #include +#include #include "syncmodule_lua.inl" @@ -47,6 +47,16 @@ namespace { constexpr const char* KeyHttpSynchronizationRepositories = "HttpSynchronizationRepositories"; constexpr const char* KeySynchronizationRoot = "SynchronizationRoot"; + + struct [[codegen::Dictionary(SyncModule)]] Parameters { + // The list of all repository URLs that are used to fetch data from for + // HTTPSynchronizations + std::optional> httpSynchronizationRepositories; + + // The folder where all of the synchronizations are stored + std::string synchronizationRoot; + }; +#include "syncmodule_codegen.cpp" } // namespace namespace openspace { @@ -54,28 +64,13 @@ namespace openspace { SyncModule::SyncModule() : OpenSpaceModule(Name) {} void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) { - if (configuration.hasKey(KeyHttpSynchronizationRepositories)) { - ghoul::Dictionary dictionary = configuration.value( - KeyHttpSynchronizationRepositories - ); + const Parameters p = codegen::bake(configuration); - for (std::string_view key : dictionary.keys()) { - _synchronizationRepositories.push_back(dictionary.value(key)); - } + if (p.httpSynchronizationRepositories.has_value()) { + _synchronizationRepositories = *p.httpSynchronizationRepositories; } - if (configuration.hasKey(KeySynchronizationRoot)) { - _synchronizationRoot = configuration.value(KeySynchronizationRoot); - } - else { - LWARNINGC( - "SyncModule", - "No synchronization root specified. Disabling resource synchronization" - ); - //_synchronizationEnabled = false; - // TODO: Make it possible to disable synchronization manually. - // Group root and enabled into a sync config object that can be passed to syncs. - } + _synchronizationRoot = absPath(p.synchronizationRoot); auto fSynchronization = FactoryManager::ref().factory(); ghoul_assert(fSynchronization, "ResourceSynchronization factory was not created"); @@ -106,40 +101,23 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) { [this](bool, const ghoul::Dictionary& dictionary, ghoul::MemoryPoolBase* pool) { if (pool) { void* ptr = pool->allocate(sizeof(UrlSynchronization)); - return new (ptr) UrlSynchronization( - dictionary, - _synchronizationRoot - ); + return new (ptr) UrlSynchronization(dictionary, _synchronizationRoot); } else { - return new UrlSynchronization( - dictionary, - _synchronizationRoot - ); + return new UrlSynchronization(dictionary, _synchronizationRoot); } } ); - - auto fTask = FactoryManager::ref().factory(); - ghoul_assert(fTask, "No task factory existed"); - fTask->registerClass("SyncAssetTask"); } -std::string SyncModule::synchronizationRoot() const { +std::filesystem::path SyncModule::synchronizationRoot() const { return _synchronizationRoot; } -void SyncModule::addHttpSynchronizationRepository(std::string repository) { - _synchronizationRepositories.push_back(std::move(repository)); -} - -std::vector SyncModule::httpSynchronizationRepositories() const { - return _synchronizationRepositories; -} - std::vector SyncModule::documentations() const { return { - HttpSynchronization::Documentation() + HttpSynchronization::Documentation(), + UrlSynchronization::Documentation() }; } diff --git a/modules/sync/syncmodule.h b/modules/sync/syncmodule.h index 08f7b48532..9ef76fa7a4 100644 --- a/modules/sync/syncmodule.h +++ b/modules/sync/syncmodule.h @@ -27,6 +27,8 @@ #include +#include + namespace openspace { class SyncModule : public OpenSpaceModule { @@ -35,10 +37,7 @@ public: SyncModule(); - std::string synchronizationRoot() const; - - void addHttpSynchronizationRepository(std::string repository); - std::vector httpSynchronizationRepositories() const; + std::filesystem::path synchronizationRoot() const; std::vector documentations() const override; @@ -49,7 +48,7 @@ protected: private: std::vector _synchronizationRepositories; - std::string _synchronizationRoot; + std::filesystem::path _synchronizationRoot; }; } // namespace openspace diff --git a/modules/sync/syncmodule_lua.inl b/modules/sync/syncmodule_lua.inl index b9d2c648e5..413ac48628 100644 --- a/modules/sync/syncmodule_lua.inl +++ b/modules/sync/syncmodule_lua.inl @@ -32,23 +32,20 @@ int syncResource(lua_State* L) { auto [identifier, version] = ghoul::lua::values(L); ghoul::Dictionary dict; + dict.setValue("Type", std::string("HttpSynchronization")); dict.setValue("Identifier", identifier); dict.setValue("Version", version); - const SyncModule* module = global::moduleEngine->module(); - HttpSynchronization sync( - dict, - module->synchronizationRoot(), - module->httpSynchronizationRepositories() - ); + std::unique_ptr sync = + ResourceSynchronization::createFromDictionary(dict); - sync.start(); + sync->start(); - while (sync.isSyncing()) { + while (sync->isSyncing()) { std::this_thread::sleep_for(std::chrono::milliseconds(20)); } - ghoul::lua::push(L, sync.isResolved()); + ghoul::lua::push(L, sync->isResolved()); return 1; } diff --git a/modules/sync/syncs/httpsynchronization.cpp b/modules/sync/syncs/httpsynchronization.cpp index 08bbb66953..5214d63ee1 100644 --- a/modules/sync/syncs/httpsynchronization.cpp +++ b/modules/sync/syncs/httpsynchronization.cpp @@ -24,17 +24,10 @@ #include -#include #include #include #include -#include -#include -#include #include -#include -#include -#include namespace { constexpr const char* _loggerCat = "HttpSynchronization"; @@ -47,10 +40,11 @@ namespace { constexpr const int ApplicationVersion = 1; struct [[codegen::Dictionary(HttpSynchronization)]] Parameters { - // A unique identifier for this resource + // The unique identifier for this resource that is used to request a set of files + // from the synchronization servers std::string identifier; - // The version of this resource + // The version of this resource that should be requested int version; }; #include "httpsynchronization_codegen.cpp" @@ -63,12 +57,11 @@ documentation::Documentation HttpSynchronization::Documentation() { } HttpSynchronization::HttpSynchronization(const ghoul::Dictionary& dict, - std::string synchronizationRoot, + std::filesystem::path synchronizationRoot, std::vector synchronizationRepositories ) - : openspace::ResourceSynchronization(dict) - , _synchronizationRoot(std::move(synchronizationRoot)) - , _synchronizationRepositories(std::move(synchronizationRepositories)) + : ResourceSynchronization(std::move(synchronizationRoot)) + , _syncRepositories(std::move(synchronizationRepositories)) { const Parameters p = codegen::bake(dict); @@ -83,40 +76,38 @@ HttpSynchronization::~HttpSynchronization() { } } -std::string HttpSynchronization::directory() { - std::string d = fmt::format( - "{}/http/{}/{}", _synchronizationRoot, _identifier, _version - ); - return absPath(d).string(); +std::filesystem::path HttpSynchronization::directory() const { + return _synchronizationRoot / "http" / _identifier / std::to_string(_version); } void HttpSynchronization::start() { if (isSyncing()) { return; } - begin(); + _state = State::Syncing; if (hasSyncFile()) { - resolve(); + _state = State::Resolved; return; } - const std::string& query = - std::string("?") + QueryKeyIdentifier + "=" + _identifier + "&" + - QueryKeyFileVersion + "=" + std::to_string(_version) + "&" + - QueryKeyApplicationVersion + "=" + std::to_string(ApplicationVersion); + std::string query = fmt::format( + "?identifier={}&file_version={}&application_version={}", + _identifier, _version, ApplicationVersion + ); _syncThread = std::thread( [this](const std::string& q) { - for (const std::string& url : _synchronizationRepositories) { - if (trySyncFromUrl(url + q)) { + for (const std::string& url : _syncRepositories) { + const bool success = trySyncFromUrl(url + q); + if (success) { createSyncFile(); - resolve(); + _state = State::Resolved; return; } } if (!_shouldCancel) { - reject(); + _state = State::Rejected; } }, query @@ -125,174 +116,131 @@ void HttpSynchronization::start() { void HttpSynchronization::cancel() { _shouldCancel = true; - reset(); -} - -void HttpSynchronization::clear() { - cancel(); - // TODO: Remove all files from directory. -} - -size_t HttpSynchronization::nSynchronizedBytes() { - return _nSynchronizedBytes; -} - -size_t HttpSynchronization::nTotalBytes() { - return _nTotalBytes; -} - -bool HttpSynchronization::nTotalBytesIsKnown() { - return _nTotalBytesKnown; -} - -void HttpSynchronization::createSyncFile() { - const std::string& directoryName = directory(); - const std::string& filepath = directoryName + ".ossync"; - - std::filesystem::create_directories(directoryName); - - std::ofstream syncFile(filepath, std::ofstream::out); - syncFile << "Synchronized"; - syncFile.close(); -} - -bool HttpSynchronization::hasSyncFile() { - const std::string& path = directory() + ".ossync"; - return std::filesystem::is_regular_file(path); + _state = State::Unsynced; } bool HttpSynchronization::trySyncFromUrl(std::string listUrl) { - HttpRequest::RequestOptions opt = {}; - opt.requestTimeoutSeconds = 0; - - SyncHttpMemoryDownload fileListDownload(std::move(listUrl)); - fileListDownload.onProgress([&c = _shouldCancel](HttpRequest::Progress) { + HttpMemoryDownload fileListDownload(std::move(listUrl)); + fileListDownload.onProgress([&c = _shouldCancel](int64_t, std::optional) { return !c; }); - fileListDownload.download(opt); + fileListDownload.start(); + const bool success = fileListDownload.wait(); - if (!fileListDownload.hasSucceeded()) { + const std::vector& buffer = fileListDownload.downloadedData(); + if (!success) { + LERRORC("HttpSynchronization", std::string(buffer.begin(), buffer.end())); return false; } - const std::vector& buffer = fileListDownload.downloadedData(); _nSynchronizedBytes = 0; _nTotalBytes = 0; _nTotalBytesKnown = false; std::istringstream fileList(std::string(buffer.begin(), buffer.end())); - std::string line; - struct SizeData { - bool totalKnown; - size_t totalBytes; - size_t downloadedBytes; + int64_t downloadedBytes = 0; + std::optional totalBytes; }; std::unordered_map sizeData; - std::mutex sizeDataMutex; + std::mutex mutex; - std::atomic_bool startedAllDownloads(false); + std::atomic_bool startedAllDownloads = false; - std::vector> downloads; + // Yes, it should be possible to store this in a std::vector but + // C++ really doesn't like that even though all of the move constructors, move + // assignments and everything is automatically constructed + std::vector> downloads; + std::string line; while (fileList >> line) { - size_t lastSlash = line.find_last_of('/'); - std::string filename = line.substr(lastSlash + 1); - - std::string fileDestination = fmt::format( - "{}/{}{}", directory(), filename, TempSuffix - ); - - if (sizeData.find(line) != sizeData.end()) { - LWARNING(fmt::format("{}: Duplicate entries: {}", _identifier, line)); + if (line.empty() || line[0] == '#') { + // Skip all empty lines and commented out lines continue; } - downloads.push_back(std::make_unique( - line, - fileDestination, - HttpFileDownload::Overwrite::Yes - )); + std::string filename = std::filesystem::path(line).filename().string(); + std::filesystem::path destination = directory() / (filename + TempSuffix); - std::unique_ptr& fileDownload = downloads.back(); + if (sizeData.find(line) != sizeData.end()) { + LWARNING(fmt::format("{}: Duplicate entry for {}", _identifier, line)); + continue; + } - sizeData[line] = { false, 0, 0 }; + std::unique_ptr download = + std::make_unique( + line, + destination, + HttpFileDownload::Overwrite::Yes + ); + HttpFileDownload* dl = download.get(); + downloads.push_back(std::move(download)); - fileDownload->onProgress( - [this, line, &sizeData, &sizeDataMutex, - &startedAllDownloads](HttpRequest::Progress p) + sizeData[line] = SizeData(); + + dl->onProgress( + [this, line, &sizeData, &mutex, &startedAllDownloads](int64_t downloadedBytes, + std::optional totalBytes) { - if (!p.totalBytesKnown || !startedAllDownloads) { + if (!totalBytes.has_value() || !startedAllDownloads) { return !_shouldCancel; } - std::lock_guard guard(sizeDataMutex); + std::lock_guard guard(mutex); - sizeData[line] = { p.totalBytesKnown, p.totalBytes, p.downloadedBytes }; + sizeData[line] = { downloadedBytes, totalBytes }; - SizeData size = std::accumulate( - sizeData.begin(), - sizeData.end(), - SizeData{ true, 0, 0 }, - [](const SizeData& a, const std::pair& b) { - return SizeData { - a.totalKnown && b.second.totalKnown, - a.totalBytes + b.second.totalBytes, - a.downloadedBytes + b.second.downloadedBytes - }; - } - ); - - _nTotalBytesKnown = size.totalKnown; - _nTotalBytes = size.totalBytes; - _nSynchronizedBytes = size.downloadedBytes; + _nTotalBytesKnown = true; + _nTotalBytes = 0; + _nSynchronizedBytes = 0; + for (const std::pair& sd : sizeData) { + _nTotalBytesKnown = _nTotalBytesKnown && sd.second.totalBytes.has_value(); + _nTotalBytes += sd.second.totalBytes.value_or(0); + _nSynchronizedBytes += sd.second.downloadedBytes; + } return !_shouldCancel; }); - fileDownload->start(opt); + dl->start(); } startedAllDownloads = true; bool failed = false; - for (std::unique_ptr& d : downloads) { + for (const std::unique_ptr& d : downloads) { d->wait(); - if (d->hasSucceeded()) { - // If we are forcing the override, we download to a temporary file - // first, so when we are done here, we need to rename the file to the - // original name - - const std::string& tempName = d->destination(); - std::string originalName = tempName.substr( - 0, - tempName.size() - strlen(TempSuffix) - ); - - if (std::filesystem::is_regular_file(originalName)) { - std::filesystem::remove(originalName); - } - int success = rename(tempName.c_str(), originalName.c_str()); - if (success != 0) { - LERROR(fmt::format( - "Error renaming file {} to {}", tempName, originalName - )); - failed = true; - } - } - else { + if (!d->hasSucceeded()) { LERROR(fmt::format("Error downloading file from URL {}", d->url())); failed = true; + continue; + } + + // If we are forcing the override, we download to a temporary file first, so when + // we are done here, we need to rename the file to the original name + + std::filesystem::path tempName = d->destination(); + std::filesystem::path originalName = tempName; + // Remove the .tmp extension + originalName.replace_extension(""); + + if (std::filesystem::is_regular_file(originalName)) { + std::filesystem::remove(originalName); + } + std::error_code ec; + std::filesystem::rename(tempName, originalName, ec); + if (ec) { + LERROR(fmt::format("Error renaming {} to {}", tempName, originalName)); + failed = true; } } - if (!failed) { - return true; + if (failed) { + for (const std::unique_ptr& d : downloads) { + d->cancel(); + } } - for (std::unique_ptr& d : downloads) { - d->cancel(); - } - return false; + return !failed; } } // namespace openspace diff --git a/modules/sync/syncs/httpsynchronization.h b/modules/sync/syncs/httpsynchronization.h index 7f686818e1..b87b48c2fa 100644 --- a/modules/sync/syncs/httpsynchronization.h +++ b/modules/sync/syncs/httpsynchronization.h @@ -32,40 +32,77 @@ namespace openspace { +/** + * A concreate ResourceSynchronization that will request a list of files from a central + * server (the server list is provided in the constructor) by asking for a specific + * identifier and a file version and application version addition. The server is expected + * to return a flat list of files that can be then directly downloaded into the #directory + * of this synchronization. That list of files can have empty lines and commented out + * lines (starting with a #) that will be ignored. Every other line is URL that will be + * downloaded into the #directory. + * Each requested set of files is identified by a triplet of (identifier, file version, + * application version). The identifier is denoting the group of files that is requested, + * the file version is the specific version of this set of files, and the application + * version is reserved for changes in the data transfer format. + */ class HttpSynchronization : public ResourceSynchronization { public: - HttpSynchronization(const ghoul::Dictionary& dict, std::string synchronizationRoot, + /** + * The constructor for this synchronization object. The \p dict contains information + * about the \c identifier and the \version (which is the file version), the + * \p synchronizationRoot is the path to the root folder where the downloaded files + * will be placed, and the \p synchronizationRepositories is a list of the URLs which + * will be asked to resolve the (identifier, version) pair. The first URL in the list + * that can successfully resolve the requested (identifier, version) pair is the one + * that will be used. + * + * \param dict The parameter dictionary (namely the identifier and version) + * \param synchronizationRoot The path to the root from which the complete #directory + * path is constructed + * \param synchronizationRepositories The list of repositories that will be asked to + * resolve the identifier request + */ + HttpSynchronization(const ghoul::Dictionary& dict, + std::filesystem::path synchronizationRoot, std::vector synchronizationRepositories); + /// Destructor that will close the asynchronous file transfer, if it is still ongoing virtual ~HttpSynchronization(); + /** + * Returns the location to which files downloaded through this ResourceSynchronization + * are saved. + * + * \return The location for files created by this class + */ + std::filesystem::path directory() const override; - std::string directory() override; + /** + * Starts the synchronization for this ResourceSynchronization by first trying to find + * a synchronization respository that replies to the request, parsing the result and + * then downloading each of the files that are provided in that result. + */ void start() override; - void cancel() override; - void clear() override; - size_t nSynchronizedBytes() override; - size_t nTotalBytes() override; - bool nTotalBytesIsKnown() override; + /// Cancels any ongoing synchronization of this ResourceSynchronization + void cancel() override; static documentation::Documentation Documentation(); private: - void createSyncFile(); - bool hasSyncFile(); + /// Tries to get a reply from the provided URL and returns that success to the caller bool trySyncFromUrl(std::string url); - std::atomic_bool _nTotalBytesKnown = false; - std::atomic_size_t _nTotalBytes = 0; - std::atomic_size_t _nSynchronizedBytes = 0; + /// Contains a flag whether the current transfer should be cancelled std::atomic_bool _shouldCancel = false; - std::string _identifier; + /// The file version for the requested files int _version = -1; - std::string _synchronizationRoot; - std::vector _synchronizationRepositories; + // The list of all repositories that we'll try to sync from + const std::vector _syncRepositories; + + // The thread that will be doing the synchronization std::thread _syncThread; }; diff --git a/modules/sync/syncs/urlsynchronization.cpp b/modules/sync/syncs/urlsynchronization.cpp index 81a65bd25e..5d437dca4b 100644 --- a/modules/sync/syncs/urlsynchronization.cpp +++ b/modules/sync/syncs/urlsynchronization.cpp @@ -24,20 +24,12 @@ #include -#include #include #include -#include #include -#include #include -#include -#include -#include -#include -#include #include -#include +#include #include #include @@ -46,14 +38,13 @@ namespace { struct [[codegen::Dictionary(UrlSynchronization)]] Parameters { // The URL or urls from where the files are downloaded. If multiple URLs are - // provided, all files will be downloaded to the same directory + // provided, all files will be downloaded to the same directory and the filename + // parameter must not be specified simultaneously std::variant> url; - // This optional identifier will be part of the used folder structure and, if - // provided, can be used to manually find the downloaded folder in the - // synchronization folder. If this value is not specified, 'UseHash' has to be set - // to 'true' - std::optional identifier; + // This identifier will be part of the used folder structure and, can be used to + // manually find the downloaded folder in the synchronization folder + std::string identifier; // If this value is set to 'true' and it is not overwritten by the global // settings, the file(s) pointed to by this URLSynchronization will always be @@ -69,7 +60,8 @@ namespace { std::optional useHash; // Optional to provide filename to override the one which is otherwise - // automatically created from the url + // automatically created from the url. If this value is specified, the url + // parameter only only contain exactly one URL std::optional filename; }; #include "urlsynchronization_codegen.cpp" @@ -81,12 +73,11 @@ documentation::Documentation UrlSynchronization::Documentation() { return codegen::doc("sync_synchronization_url"); } -UrlSynchronization::UrlSynchronization(const ghoul::Dictionary& dict, - std::string synchronizationRoot) - : ResourceSynchronization(dict) - , _synchronizationRoot(std::move(synchronizationRoot)) +UrlSynchronization::UrlSynchronization(const ghoul::Dictionary& dictionary, + std::filesystem::path synchronizationRoot) + : ResourceSynchronization(std::move(synchronizationRoot)) { - const Parameters p = codegen::bake(dict); + const Parameters p = codegen::bake(dictionary); if (std::holds_alternative(p.url)) { _urls.push_back(std::get(p.url)); @@ -99,38 +90,30 @@ UrlSynchronization::UrlSynchronization(const ghoul::Dictionary& dict, throw ghoul::MissingCaseException(); } + if (p.filename.has_value() && _urls.size() > 1) { + throw ghoul::RuntimeError(fmt::format( + "UrlSynchronization ({}) requested overwrite filename but specified {} URLs " + "to download, which is not legal", + p.identifier, _urls.size() + )); + } _filename = p.filename.value_or(_filename); - - bool useHash = p.useHash.value_or(true); - - // We just merge all of the URLs together to generate a hash, it's not as stable to - // reordering URLs, but every other solution would be more error prone - std::string urlConcat = std::accumulate(_urls.begin(), _urls.end(), std::string()); - size_t hash = std::hash{}(urlConcat); - if (p.identifier.has_value()) { - if (useHash) { - _identifier = *p.identifier + "(" + std::to_string(hash) + ")"; - } - else { - _identifier = *p.identifier; - } - } - else { - if (useHash) { - _identifier = std::to_string(hash); - } - else { - documentation::TestResult res; - res.success = false; - documentation::TestResult::Offense o; - o.offender = "Identifier|UseHash"; - o.reason = documentation::TestResult::Offense::Reason::MissingKey; - res.offenses.push_back(o); - throw documentation::SpecificationError(std::move(res), "UrlSynchronization"); - } - } - _forceOverride = p.forceOverride.value_or(_forceOverride); + + const bool useHash = p.useHash.value_or(true); + + _identifier = p.identifier; + + if (useHash) { + // We just merge all of the URLs together to generate a hash that works for this + std::vector urls = _urls; + std::sort(urls.begin(), urls.end()); + + size_t hash = std::hash{}( + std::accumulate(urls.begin(), urls.end(), std::string()) + ); + _identifier += fmt::format("({})", hash); + } } UrlSynchronization::~UrlSynchronization() { @@ -140,115 +123,107 @@ UrlSynchronization::~UrlSynchronization() { } } +std::filesystem::path UrlSynchronization::directory() const { + return _synchronizationRoot / "url" / _identifier / "files"; +} + void UrlSynchronization::start() { if (isSyncing()) { return; } - begin(); + _state = State::Syncing; if (hasSyncFile() && !_forceOverride) { - resolve(); + _state = State::Resolved; return; } - _syncThread = std::thread([this] { + _syncThread = std::thread([this]() { std::unordered_map fileSizes; std::mutex fileSizeMutex; - std::atomic_size_t nDownloads(0); - std::atomic_bool startedAllDownloads(false); - std::vector> downloads; + size_t nDownloads = 0; + std::atomic_bool startedAllDownloads = false; + std::vector> downloads; for (const std::string& url : _urls) { if (_filename.empty()) { - const size_t lastSlash = url.find_last_of('/'); - std::string lastPartOfUrl = url.substr(lastSlash + 1); + std::string name = std::filesystem::path(url).filename().string(); - // We can not create filenames with questionmarks - lastPartOfUrl.erase( - std::remove(lastPartOfUrl.begin(), lastPartOfUrl.end(), '?'), - lastPartOfUrl.end() - ); - _filename = lastPartOfUrl; + // We can not create filenames with question marks + name.erase(std::remove(name.begin(), name.end(), '?'), name.end()); + _filename = name; } - std::string fileDestination = fmt::format( - "{}/{}{}", directory(), _filename, TempSuffix - ); + std::filesystem::path destination = directory() / (_filename + TempSuffix); - std::unique_ptr download = - std::make_unique( + std::unique_ptr download = + std::make_unique( url, - fileDestination, + destination, HttpFileDownload::Overwrite::Yes ); + HttpFileDownload* dl = download.get(); downloads.push_back(std::move(download)); - std::unique_ptr& fileDownload = downloads.back(); - ++nDownloads; - fileDownload->onProgress( + dl->onProgress( [this, url, &fileSizes, &fileSizeMutex, - &startedAllDownloads, &nDownloads](HttpRequest::Progress p) + &startedAllDownloads, &nDownloads](int64_t, + std::optional totalBytes) { - if (p.totalBytesKnown) { - std::lock_guard guard(fileSizeMutex); - fileSizes[url] = p.totalBytes; + if (!totalBytes.has_value()) { + return !_shouldCancel; + } - if (!_nTotalBytesKnown && startedAllDownloads && - fileSizes.size() == nDownloads) - { - _nTotalBytesKnown = true; - _nTotalBytes = std::accumulate( - fileSizes.begin(), - fileSizes.end(), - size_t(0), - [](size_t a, const std::pair b) { - return a + b.second; - } - ); + std::lock_guard guard(fileSizeMutex); + fileSizes[url] = *totalBytes; + + if (!_nTotalBytesKnown && startedAllDownloads && + fileSizes.size() == nDownloads) + { + _nTotalBytesKnown = true; + _nTotalBytes = 0; + for (const std::pair& fs : fileSizes) { + _nTotalBytes += fs.second; } } return !_shouldCancel; }); - HttpRequest::RequestOptions opt = {}; - opt.requestTimeoutSeconds = 0; - fileDownload->start(opt); + dl->start(); } startedAllDownloads = true; bool failed = false; - for (std::unique_ptr& d : downloads) { + for (const std::unique_ptr& d : downloads) { d->wait(); - if (d->hasSucceeded()) { - // If we are forcing the override, we download to a temporary file first, - // so when we are done here, we need to rename the file to the original - // name + if (!d->hasSucceeded()) { + failed = true; + continue; + } - const std::string& tempName = d->destination(); - std::string originalName = tempName.substr( - 0, - tempName.size() - strlen(TempSuffix) + // If we are forcing the override, we download to a temporary file first, so + // when we are done here, we need to rename the file to the original name + + std::filesystem::path tempName = d->destination(); + std::filesystem::path originalName = tempName; + // Remove the .tmp extension + originalName.replace_extension(""); + + if (std::filesystem::is_regular_file(originalName)) { + std::filesystem::remove(originalName); + } + + std::error_code ec; + std::filesystem::rename(tempName, originalName, ec); + if (ec) { + LERRORC( + "URLSynchronization", + fmt::format("Error renaming file {} to {}", tempName, originalName) ); - if (std::filesystem::is_regular_file(originalName)) { - std::filesystem::remove(originalName); - } - int success = rename(tempName.c_str(), originalName.c_str()); - if (success != 0) { - LERRORC( - "URLSynchronization", - fmt::format( - "Error renaming file {} to {}", tempName, originalName - ) - ); - - failed = true; - } - } - else { failed = true; } } @@ -257,53 +232,17 @@ void UrlSynchronization::start() { createSyncFile(); } else { - for (std::unique_ptr& d : downloads) { + for (const std::unique_ptr& d : downloads) { d->cancel(); } } - resolve(); + _state = State::Resolved; }); } void UrlSynchronization::cancel() { _shouldCancel = true; - reset(); -} - -void UrlSynchronization::clear() { - cancel(); - // TODO: Remove all files from directory. -} - -size_t UrlSynchronization::nSynchronizedBytes() { - return _nSynchronizedBytes; -} - -size_t UrlSynchronization::nTotalBytes() { - return _nTotalBytes; -} - -bool UrlSynchronization::nTotalBytesIsKnown() { - return _nTotalBytesKnown; -} - -void UrlSynchronization::createSyncFile() { - std::string dir = directory(); - std::string filepath = dir + ".ossync"; - std::filesystem::create_directories(dir); - std::ofstream syncFile(filepath, std::ofstream::out); - syncFile << "Synchronized"; - syncFile.close(); -} - -bool UrlSynchronization::hasSyncFile() { - const std::string& path = directory() + ".ossync"; - return std::filesystem::is_regular_file(path); -} - -std::string UrlSynchronization::directory() { - std::string d = fmt::format("{}/url/{}/files", _synchronizationRoot, _identifier); - return absPath(d).string(); + _state = State::Unsynced; } } // namespace openspace diff --git a/modules/sync/syncs/urlsynchronization.h b/modules/sync/syncs/urlsynchronization.h index 1f658b3362..e0e2fe04e5 100644 --- a/modules/sync/syncs/urlsynchronization.h +++ b/modules/sync/syncs/urlsynchronization.h @@ -28,43 +28,68 @@ #include #include +#include +#include #include #include namespace openspace { +/** + * The UrlSynchronization will download one or more files by directly being provided with + * the list of URLs to the files that should be downloaded. The \c Override option in the + * Dictionary determines what should happen in a file with the same name and the same + * identifier has been previously downloaded. + */ class UrlSynchronization : public ResourceSynchronization { public: - UrlSynchronization(const ghoul::Dictionary& dict, std::string synchronizationRoot); + /** + * The constructor that takes the parameter \p dictionary and the + * \p synchronizationRoot to the location that is used as the base to compute the + * final storage location. The provided list of URLs must not contain any duplicates. + * + * \param dictionary The parameter dictionary that contains all information that this + * UrlSynchronization needs to download the provided files + * \param synchronizationRoot The base location based off which the final placement + * is calculated + */ + UrlSynchronization(const ghoul::Dictionary& dictionary, + std::filesystem::path synchronizationRoot); + /// Contructor that will terminate the synchronization thread if it is still running virtual ~UrlSynchronization(); - void start() override; - void cancel() override; - void clear() override; + /** + * Returns the location to which files downloaded through this ResourceSynchronization + * are saved. + * + * \return The location for files created by this class + */ + std::filesystem::path directory() const override; - size_t nSynchronizedBytes() override; - size_t nTotalBytes() override; - bool nTotalBytesIsKnown() override; + /// Starts the synchronization for this ResourceSynchronization + void start() override; + + /// Cancels any ongoing synchronization of this ResourceSynchronization + void cancel() override; static documentation::Documentation Documentation(); private: - void createSyncFile(); - bool hasSyncFile(); - std::string directory() override; - + /// The list of URLs that will be downloaded std::vector _urls; + + /// Setting whether existing files should be ignored (false) or overwritten (true) bool _forceOverride = false; - std::string _synchronizationRoot; - std::string _identifier; + + /// An optional filename that might overwrite the storage destination. This is only + /// valid if a single URL is specified std::string _filename; - std::atomic_bool _nTotalBytesKnown = false; - std::atomic_size_t _nTotalBytes = 0; - std::atomic_size_t _nSynchronizedBytes = 0; + /// Contains a flag whether the current transfer should be cancelled std::atomic_bool _shouldCancel = false; + // The thread that will be doing the synchronization std::thread _syncThread; }; diff --git a/modules/sync/tasks/syncassettask.cpp b/modules/sync/tasks/syncassettask.cpp deleted file mode 100644 index 04ba0573d2..0000000000 --- a/modules/sync/tasks/syncassettask.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace { - constexpr std::chrono::milliseconds ProgressPollInterval(200); - - struct [[codegen::Dictionary(SyncAssetTask)]] Parameters { - // The asset file to sync - std::filesystem::path asset; - }; -#include "syncassettask_codegen.cpp" -} // namespace - -namespace openspace { - -documentation::Documentation SyncAssetTask::documentation() { - return codegen::doc("sync_asset_task"); -} - -SyncAssetTask::SyncAssetTask(const ghoul::Dictionary& dictionary) { - const Parameters p = codegen::bake(dictionary); - _asset = p.asset.string(); -} - -std::string SyncAssetTask::description() { - return "Synchronize asset " + _asset; -} - -void SyncAssetTask::perform(const Task::ProgressCallback& progressCallback) { - SynchronizationWatcher watcher; - - scripting::ScriptEngine scriptEngine; - - registerCoreClasses(scriptEngine); - - for (OpenSpaceModule* m : global::moduleEngine->modules()) { - scriptEngine.addLibrary(m->luaLibrary()); - - for (scripting::LuaLibrary& l : m->luaLibraries()) { - scriptEngine.addLibrary(l); - } - } - - scriptEngine.initialize(); - - ghoul::lua::LuaState luaState; - scriptEngine.initializeLuaState(luaState); - - AssetLoader loader(&luaState, &watcher, "${ASSETS}"); - - loader.add(_asset); - loader.rootAsset().startSynchronizations(); - - std::vector allAssets = loader.rootAsset().subTreeAssets(); - - while (true) { - bool inProgress = false; - for (const Asset* asset : allAssets) { - Asset::State state = asset->state(); - if (state == Asset::State::Unloaded || - state == Asset::State::Loaded || - state == Asset::State::Synchronizing) - { - inProgress = true; - } - } - progressCallback(loader.rootAsset().requestedSynchronizationProgress()); - std::this_thread::sleep_for(ProgressPollInterval); - watcher.notify(); - if (!inProgress) { - return; - } - } - progressCallback(1.f); -} - -} // namespace openspace diff --git a/modules/sync/tasks/syncassettask.h b/modules/sync/tasks/syncassettask.h deleted file mode 100644 index 5f0cf8f830..0000000000 --- a/modules/sync/tasks/syncassettask.h +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#ifndef __OPENSPACE_MODULE_SYNC___SYNCASSETTASK___H__ -#define __OPENSPACE_MODULE_SYNC___SYNCASSETTASK___H__ - -#include - -#include - -namespace openspace { - -class SyncAssetTask : public Task { -public: - SyncAssetTask(const ghoul::Dictionary& dictionary); - - std::string description() override; - void perform(const Task::ProgressCallback& progressCallback) override; - - static documentation::Documentation documentation(); - -private: - std::string _asset; -}; - -} // namespace openspace - -#endif // __OPENSPACE_MODULE_SYNC___SYNCASSETTASK___H__ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9fe2d9fbdd..1f71bba61a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -138,8 +138,6 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/rendering/transferfunction.cpp ${OPENSPACE_BASE_DIR}/src/rendering/volumeraycaster.cpp ${OPENSPACE_BASE_DIR}/src/scene/asset.cpp - ${OPENSPACE_BASE_DIR}/src/scene/assetloader.cpp - ${OPENSPACE_BASE_DIR}/src/scene/assetloader_lua.inl ${OPENSPACE_BASE_DIR}/src/scene/assetmanager.cpp ${OPENSPACE_BASE_DIR}/src/scene/assetmanager_lua.inl ${OPENSPACE_BASE_DIR}/src/scene/lightsource.cpp @@ -178,7 +176,6 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/util/spicemanager.cpp ${OPENSPACE_BASE_DIR}/src/util/spicemanager_lua.inl ${OPENSPACE_BASE_DIR}/src/util/syncbuffer.cpp - ${OPENSPACE_BASE_DIR}/src/util/synchronizationwatcher.cpp ${OPENSPACE_BASE_DIR}/src/util/tstring.cpp ${OPENSPACE_BASE_DIR}/src/util/histogram.cpp ${OPENSPACE_BASE_DIR}/src/util/task.cpp @@ -330,8 +327,6 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/rendering/volume.h ${OPENSPACE_BASE_DIR}/include/openspace/rendering/volumeraycaster.h ${OPENSPACE_BASE_DIR}/include/openspace/scene/asset.h - ${OPENSPACE_BASE_DIR}/include/openspace/scene/assetlistener.h - ${OPENSPACE_BASE_DIR}/include/openspace/scene/assetloader.h ${OPENSPACE_BASE_DIR}/include/openspace/scene/assetmanager.h ${OPENSPACE_BASE_DIR}/include/openspace/scene/lightsource.h ${OPENSPACE_BASE_DIR}/include/openspace/scene/profile.h @@ -378,7 +373,6 @@ set(OPENSPACE_HEADER ${OPENSPACE_BASE_DIR}/include/openspace/util/syncbuffer.inl ${OPENSPACE_BASE_DIR}/include/openspace/util/syncdata.h ${OPENSPACE_BASE_DIR}/include/openspace/util/syncdata.inl - ${OPENSPACE_BASE_DIR}/include/openspace/util/synchronizationwatcher.h ${OPENSPACE_BASE_DIR}/include/openspace/util/task.h ${OPENSPACE_BASE_DIR}/include/openspace/util/taskloader.h ${OPENSPACE_BASE_DIR}/include/openspace/util/time.h diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index d523ae24fd..146dff010b 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -30,23 +30,11 @@ #include #include #include +#include #include #include #include -#ifdef OPENSPACE_CURL_ENABLED -#ifdef WIN32 -#pragma warning (push) -#pragma warning (disable: 4574) // 'INCL_WINSOCK_API_TYPEDEFS' is defined to be '0' -#endif // WIN32 - -#include - -#ifdef WIN32 -#pragma warning (pop) -#endif // WIN32 -#endif - namespace { constexpr const char* _loggerCat = "DownloadManager"; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 45f93ab97a..353a15df6c 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -51,8 +51,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -388,8 +388,6 @@ void OpenSpaceEngine::initialize() { func(); } - global::openSpaceEngine->_assetManager->initialize(); - LTRACE("OpenSpaceEngine::initialize(end)"); } @@ -693,12 +691,7 @@ void OpenSpaceEngine::initializeGL() { LTRACE("OpenSpaceEngine::initializeGL(end)"); } -void OpenSpaceEngine::scheduleLoadSingleAsset(std::string assetPath) { - _hasScheduledAssetLoading = true; - _scheduledAssetPathToLoad = std::move(assetPath); -} - -void OpenSpaceEngine::loadAsset(const std::string& assetName) { +void OpenSpaceEngine::loadAssets() { ZoneScoped LTRACE("OpenSpaceEngine::loadAsset(begin)"); @@ -757,10 +750,6 @@ void OpenSpaceEngine::loadAsset(const std::string& assetName) { ); } - _assetManager->removeAll(); - if (!assetName.empty()) { - _assetManager->add(assetName); - } for (const std::string& a : global::profile->assets) { _assetManager->add(a); } @@ -768,51 +757,84 @@ void OpenSpaceEngine::loadAsset(const std::string& assetName) { _loadingScreen->setPhase(LoadingScreen::Phase::Construction); _loadingScreen->postMessage("Loading assets"); - _assetManager->update(); + bool loading = true; + while (true) { + _loadingScreen->render(); + _assetManager->update(); - _loadingScreen->setPhase(LoadingScreen::Phase::Synchronization); - _loadingScreen->postMessage("Synchronizing assets"); + std::vector allAssets = _assetManager->allAssets(); - std::vector allAssets = _assetManager->rootAsset().subTreeAssets(); + std::vector allSyncs = + _assetManager->allSynchronizations(); - std::unordered_set resourceSyncs; - for (const Asset* a : allAssets) { - std::vector syncs = a->ownSynchronizations(); - - for (ResourceSynchronization* s : syncs) { + for (const ResourceSynchronization* sync : allSyncs) { ZoneScopedN("Update resource synchronization") - if (s->state() == ResourceSynchronization::State::Syncing) { + if (sync->isSyncing()) { LoadingScreen::ProgressInfo progressInfo; - progressInfo.progress = s->progress(); - resourceSyncs.insert(s); + progressInfo.progress = [](const ResourceSynchronization* sync) { + if (!sync->nTotalBytesIsKnown()) { + return 0.f; + } + if (sync->nTotalBytes() == 0) { + return 1.f; + } + return + static_cast(sync->nSynchronizedBytes()) / + static_cast(sync->nTotalBytes()); + }(sync); + _loadingScreen->updateItem( - s->name(), - s->name(), + sync->identifier(), + sync->name(), LoadingScreen::ItemStatus::Started, progressInfo ); } - } - } - _loadingScreen->setItemNumber(static_cast(resourceSyncs.size())); - bool loading = true; - while (loading) { + if (sync->isRejected()) { + _loadingScreen->updateItem( + sync->identifier(), sync->name(), LoadingScreen::ItemStatus::Failed, + LoadingScreen::ProgressInfo() + ); + } + } + + _loadingScreen->setItemNumber(static_cast(allSyncs.size())); + if (_shouldAbortLoading) { global::windowDelegate->terminate(); break; } - _loadingScreen->render(); - _assetManager->update(); + + bool finishedLoading = std::all_of( + allAssets.begin(), + allAssets.end(), + [](const Asset* asset) { return asset->isInitialized() || asset->isFailed(); } + ); + + if (finishedLoading) { + break; + } loading = false; - auto it = resourceSyncs.begin(); - while (it != resourceSyncs.end()) { - if ((*it)->state() == ResourceSynchronization::State::Syncing) { + auto it = allSyncs.begin(); + while (it != allSyncs.end()) { + if ((*it)->isSyncing()) { LoadingScreen::ProgressInfo progressInfo; - progressInfo.progress = (*it)->progress(); + + progressInfo.progress = [](const ResourceSynchronization* sync) { + if (!sync->nTotalBytesIsKnown()) { + return 0.f; + } + if (sync->nTotalBytes() == 0) { + return 1.f; + } + return + static_cast(sync->nSynchronizedBytes()) / + static_cast(sync->nTotalBytes()); + }(*it); if ((*it)->nTotalBytesIsKnown()) { progressInfo.currentSize = (*it)->nSynchronizedBytes(); @@ -821,25 +843,32 @@ void OpenSpaceEngine::loadAsset(const std::string& assetName) { loading = true; _loadingScreen->updateItem( - (*it)->name(), + (*it)->identifier(), (*it)->name(), LoadingScreen::ItemStatus::Started, progressInfo ); ++it; } + else if ((*it)->isRejected()) { + _loadingScreen->updateItem( + (*it)->identifier(), (*it)->name(), LoadingScreen::ItemStatus::Failed, + LoadingScreen::ProgressInfo() + ); + ++it; + } else { LoadingScreen::ProgressInfo progressInfo; progressInfo.progress = 1.f; _loadingScreen->tickItem(); _loadingScreen->updateItem( - (*it)->name(), + (*it)->identifier(), (*it)->name(), LoadingScreen::ItemStatus::Finished, progressInfo ); - it = resourceSyncs.erase(it); + it = allSyncs.erase(it); } } } @@ -1110,19 +1139,9 @@ void OpenSpaceEngine::preSynchronization() { // Reset the temporary, frame-based storage global::memoryManager->TemporaryMemory.reset(); - if (_hasScheduledAssetLoading) { - LINFO(fmt::format("Loading asset: {}", absPath(_scheduledAssetPathToLoad))); + if (_isRenderingFirstFrame) { global::profile->ignoreUpdates = true; - loadAsset(_scheduledAssetPathToLoad); - global::profile->ignoreUpdates = false; - resetPropertyChangeFlagsOfSubowners(global::rootPropertyOwner); - _hasScheduledAssetLoading = false; - _scheduledAssetPathToLoad.clear(); - global::eventEngine->publishEvent(); - } - else if (_isRenderingFirstFrame) { - global::profile->ignoreUpdates = true; - loadAsset(""); + loadAssets(); global::renderEngine->scene()->setPropertiesFromProfile(*global::profile); global::timeManager->setTimeFromProfile(*global::profile); global::timeManager->setDeltaTimeSteps(global::profile->deltaTimes); @@ -1212,17 +1231,7 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { _shutdown.timer -= static_cast(global::windowDelegate->averageDeltaTime()); } - const bool updated = _assetManager->update(); - if (updated) { - if (_writeDocumentationTask.valid()) { - // If there still is a documentation creation task the previous frame, we need - // to wait for it to finish first, or else we might write to the same file - _writeDocumentationTask.wait(); - } - _writeDocumentationTask = std::async( - &OpenSpaceEngine::writeSceneDocumentation, this - ); - } + _assetManager->update(); global::renderEngine->updateScene(); global::renderEngine->updateRenderer(); diff --git a/src/rendering/loadingscreen.cpp b/src/rendering/loadingscreen.cpp index 451751a54b..0b34385054 100644 --- a/src/rendering/loadingscreen.cpp +++ b/src/rendering/loadingscreen.cpp @@ -552,16 +552,9 @@ void LoadingScreen::updateItem(const std::string& itemIdentifier, } } else { - ghoul_assert( - newStatus == ItemStatus::Started, - fmt::format( - "Item '{}' did not exist and first message was not 'Started'", - itemIdentifier - ) - ); // We are not computing the location in here since doing it this way might stall // the main thread while trying to find a position for the new item - _items.push_back({ + Item item = { itemIdentifier, itemName, ItemStatus::Started, @@ -573,7 +566,15 @@ void LoadingScreen::updateItem(const std::string& itemIdentifier, {}, {}, std::chrono::system_clock::from_time_t(0) - }); + }; + + if (newStatus == ItemStatus::Finished) { + // This is only going to be triggered if an item finishes so quickly that + // there was not even time to create the item between starting and finishing + item.finishedTime = std::chrono::system_clock::now(); + } + + _items.push_back(std::move(item)); } } diff --git a/src/scene/asset.cpp b/src/scene/asset.cpp index 6e1737bd7e..0b18abd5b8 100644 --- a/src/scene/asset.cpp +++ b/src/scene/asset.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include #include #include @@ -39,49 +39,288 @@ namespace openspace { namespace { constexpr const char* _loggerCat = "Asset"; - - float syncProgress(const std::vector& assets) { - size_t nTotalBytes = 0; - size_t nSyncedBytes = 0; - - for (const Asset* a : assets) { - std::vector s = a->ownSynchronizations(); - - for (ResourceSynchronization* sync : s) { - if (sync->nTotalBytesIsKnown()) { - nTotalBytes += sync->nTotalBytes(); - nSyncedBytes += sync->nSynchronizedBytes(); - } - else if (sync->isSyncing()) { - // A resource is still synchronizing but its size is unknown. - // Impossible to know the global progress. - return 0; - } - } - } - if (nTotalBytes == 0) { - return 0.f; - } - return static_cast(nSyncedBytes) / static_cast(nTotalBytes); - } } // namespace - -Asset::Asset(AssetLoader* loader, SynchronizationWatcher* watcher) - : _state(State::SyncResolved) - , _loader(loader) - , _synchronizationWatcher(watcher) - , _hasAssetPath(false) - , _assetName("Root Asset") -{} - -Asset::Asset(AssetLoader* loader, SynchronizationWatcher* watcher, std::string assetPath) - : _state(State::Unloaded) - , _loader(loader) - , _synchronizationWatcher(watcher) - , _hasAssetPath(true) +Asset::Asset(AssetManager& manager, std::filesystem::path assetPath) + : _manager(manager) , _assetPath(std::move(assetPath)) -{} +{ + ghoul_precondition(!_assetPath.empty(), "Asset path must not be empty"); + ghoul_precondition( + std::filesystem::is_regular_file(_assetPath), + "Asset path file must exist" + ); +} + +std::filesystem::path Asset::path() const { + return _assetPath; +} + +void Asset::setState(State state) { + ZoneScoped + + if (_state == state) { + return; + } + + _state = state; + + // If we change our state, there might have been a parent of ours that was waiting for + // us to finish, so we give each asset that required us the chance to update its own + // state. This might cause a cascade up towards the roo asset in the best/worst case + for (Asset* parent : _parentAssets) { + if (// Prohibit state change to SyncResolved if additional requirements may still + // be added + !parent->isLoaded() || + // Do not do anything if this asset was already initialized. This may happen + // if there are multiple requirement paths from this asset to the same child, + // which causes this method to be called more than once + parent->isInitialized() || + // Do not do anything if the parent asset failed to initialize + parent->_state == State::InitializationFailed) + { + continue; + } + + if (state == State::Synchronized) { + if (parent->isSyncResolveReady()) { + parent->setState(State::Synchronized); + } + } + else if (state == State::SyncRejected) { + parent->setState(State::SyncRejected); + } + } +} + +void Asset::addSynchronization(ResourceSynchronization* synchronization) { + ghoul_precondition(synchronization != nullptr, "Synchronization must not be nullptr"); + ghoul_precondition( + std::find( + _synchronizations.begin(), + _synchronizations.end(), + synchronization + ) == _synchronizations.end(), + "Synchronization must not have been added before" + ); + _synchronizations.push_back(synchronization); +} + +void Asset::setSynchronizationStateResolved() { + ZoneScoped + + if (!isSynchronized() && isSyncResolveReady()) { + setState(State::Synchronized); + } +} + +void Asset::setSynchronizationStateRejected() { + ZoneScoped + + setState(State::SyncRejected); +} + +bool Asset::isSyncResolveReady() const { + const bool allParentsSynced = std::all_of( + _requiredAssets.cbegin(), + _requiredAssets.cend(), + std::mem_fn(&Asset::isSynchronized) + ); + + const bool allSynced = std::all_of( + _synchronizations.cbegin(), + _synchronizations.cend(), + std::mem_fn(&ResourceSynchronization::isResolved) + ); + + // To be considered resolved, all own synchronizations need to be resolved and all + // parents have to be synchronized + return allParentsSynced && allSynced; +} + +bool Asset::isLoaded() const { + return _state != State::Unloaded && _state != State::LoadingFailed; +} + +bool Asset::isSynchronized() const { + return _state == State::Synchronized || _state == State::Initialized || + _state == State::InitializationFailed; +} + +bool Asset::isSyncingOrResolved() const { + return _state == State::Synchronizing || _state == State::Synchronized || + _state == State::Initialized || _state == State::InitializationFailed; +} + +bool Asset::isFailed() const { + return _state == State::LoadingFailed || _state == State::SyncRejected || + _state == State::InitializationFailed; +} + +bool Asset::hasLoadedParent() { + return std::any_of( + _parentAssets.begin(), + _parentAssets.end(), + std::mem_fn(&Asset::isLoaded) + ); +} + +bool Asset::hasInitializedParent() const { + return std::any_of( + _parentAssets.begin(), + _parentAssets.end(), + std::mem_fn(&Asset::isInitialized) + ); +} + +bool Asset::isInitialized() const { + return _state == State::Initialized; +} + +void Asset::startSynchronizations() { + ghoul_precondition(isLoaded(), "This Asset must have been Loaded before"); + + // Do not attempt to resync if this is already done + if (isSyncingOrResolved()) { + return; + } + + setState(State::Synchronizing); + + // Start synchronization of all children first + for (Asset* child : _requiredAssets) { + child->startSynchronizations(); + } + + // Now synchronize its own synchronizations + for (ResourceSynchronization* s : _synchronizations) { + if (!s->isResolved()) { + s->start(); + } + } + // If all syncs are resolved (or no syncs exist), mark as resolved. If they are not, + // this asset will be told by the ResourceSynchronization when it finished instead + if (!isInitialized() && isSyncResolveReady()) { + setState(State::Synchronized); + } +} + +void Asset::load(Asset* parent) { + if (!isLoaded()) { + const bool loaded = _manager.loadAsset(this, parent); + setState(loaded ? State::Loaded : State::LoadingFailed); + } +} + +void Asset::unload() { + if (!isLoaded()) { + return; + } + + setState(State::Unloaded); + _manager.unloadAsset(this); + + while (!_requiredAssets.empty()) { + Asset* child = *_requiredAssets.begin(); + + ghoul_assert( + _state == Asset::State::Unloaded, + "Cannot unrequire child asset in a loaded state" + ); + + _requiredAssets.erase(_requiredAssets.begin()); + + auto parentIt = std::find( + child->_parentAssets.cbegin(), + child->_parentAssets.cend(), + this + ); + ghoul_assert( + parentIt != child->_parentAssets.cend(), + "Parent asset was not correctly registered" + ); + + child->_parentAssets.erase(parentIt); + + if (!child->hasInitializedParent()) { + child->deinitialize(); + } + if (!child->hasLoadedParent()) { + child->unload(); + } + } +} + +void Asset::initialize() { + ZoneScoped + + if (isInitialized()) { + return; + } + if (!isSynchronized()) { + LERROR(fmt::format("Cannot initialize unsynchronized asset {}", _assetPath)); + return; + } + LDEBUG(fmt::format("Initializing asset {}", _assetPath)); + + // 1. Initialize requirements + for (Asset* child : _requiredAssets) { + child->initialize(); + } + + // 2. Call Lua onInitialize + try { + _manager.callOnInitialize(this); + } + catch (const ghoul::lua::LuaRuntimeException& e) { + LERROR(fmt::format("Failed to initialize asset {}", path())); + LERROR(fmt::format("{}: {}", e.component, e.message)); + setState(State::InitializationFailed); + return; + } + + // 3. Update state + setState(State::Initialized); +} + +void Asset::deinitialize() { + if (!isInitialized()) { + return; + } + LDEBUG(fmt::format("Deinitializing asset {}", _assetPath)); + + // Perform inverse actions as in initialize, in reverse order (3 - 1) + + // 3. Update state + setState(Asset::State::Synchronized); + + // 2. Call Lua onInitialize + try { + _manager.callOnDeinitialize(this); + } + catch (const ghoul::lua::LuaRuntimeException& e) { + LERROR(fmt::format("Failed to deinitialize asset {}", _assetPath)); + LERROR(fmt::format("{}: {}", e.component, e.message)); + return; + } + + // 1. Deinitialize unwanted requirements + for (Asset* dependency : _requiredAssets) { + if (!dependency->hasInitializedParent()) { + dependency->deinitialize(); + } + } +} + +void Asset::require(Asset* dependency) { + ghoul_precondition(dependency, "Dependency must not be nullptr"); + + auto it = std::find(_requiredAssets.cbegin(), _requiredAssets.cend(), dependency); + if (it == _requiredAssets.cend()) { + _requiredAssets.push_back(dependency); + dependency->_parentAssets.push_back(this); + } +} void Asset::setMetaInformation(MetaInformation metaInformation) { _metaInformation = std::move(metaInformation); @@ -91,792 +330,4 @@ std::optional Asset::metaInformation() const { return _metaInformation; } -Asset::State Asset::state() const { - return _state; -} - -void Asset::setState(Asset::State state) { - ZoneScoped - - if (_state == state) { - return; - } - for (const std::weak_ptr& requiringAsset : _requiringAssets) { - if (std::shared_ptr a = requiringAsset.lock()) { - ghoul_assert( - !a->isInitialized(), - "Required asset changing state while parent asset is initialized" - ); - } - } - _state = state; - - _loader->assetStateChanged(this, state); - - for (const std::weak_ptr& requiringAsset : _requiringAssets) { - if (std::shared_ptr a = requiringAsset.lock()) { - a->requiredAssetChangedState(state); - } - } - - for (const std::weak_ptr& requestingAsset : _requestingAssets) { - if (std::shared_ptr a = requestingAsset.lock()) { - a->requestedAssetChangedState(this, state); - } - } -} - -void Asset::requiredAssetChangedState(Asset::State childState) { - if (!isLoaded()) { - // Prohibit state change to SyncResolved if additional requirements - // may still be added - return; - } - if (isInitialized()) { - // Do not do anything if this asset was already initialized. This may happen if - // there are multiple requirement paths from this asset to the same child, which - // causes this method to be called more than once - return; - } - if (_state == State::InitializationFailed) { - // Do not do anything if the asset failed to initialize - return; - } - if (childState == State::SyncResolved) { - if (isSyncResolveReady()) { - setState(State::SyncResolved); - } - } - else if (childState == State::SyncRejected) { - setState(State::SyncRejected); - } -} - -void Asset::requestedAssetChangedState(Asset* child, Asset::State childState) { - if (child->hasInitializedParent()) { - if (childState == State::Loaded && child->state() == State::Loaded) { - child->startSynchronizations(); - } - if (childState == State::SyncResolved && child->state() == State::SyncResolved) { - child->initialize(); - } - } -} - -void Asset::addSynchronization(std::unique_ptr synchronization) { - std::shared_ptr sync = std::move(synchronization); - - _synchronizations.push_back(sync); - - // Set up callback for synchronization state change - // The synchronization watcher will make sure that callbacks - // are invoked in the main thread. - - SynchronizationWatcher::WatchHandle watch = - _synchronizationWatcher->watchSynchronization( - sync, - [this, sync](ResourceSynchronization::State state) { - syncStateChanged(sync.get(), state); - } - ); - _syncWatches.push_back(watch); -} - -void Asset::clearSynchronizations() { - for (const SynchronizationWatcher::WatchHandle& h : _syncWatches) { - _synchronizationWatcher->unwatchSynchronization(h); - } - _syncWatches.clear(); -} - -void Asset::syncStateChanged(ResourceSynchronization* sync, - ResourceSynchronization::State state) -{ - ZoneScoped - - if (state == ResourceSynchronization::State::Resolved) { - if (!isSynchronized() && isSyncResolveReady()) { - setState(State::SyncResolved); - } - } - else if (state == ResourceSynchronization::State::Rejected) { - LERROR(fmt::format( - "Failed to synchronize resource '{}' in asset '{}'", sync->name(), id() - )); - - setState(State::SyncRejected); - } -} - -bool Asset::isSyncResolveReady() { - std::vector requiredAssets = this->requiredAssets(); - - const auto unsynchronizedAsset = std::find_if( - requiredAssets.cbegin(), - requiredAssets.cend(), - [](Asset* a) { return !a->isSynchronized(); } - ); - - if (unsynchronizedAsset != requiredAssets.cend()) { - // Not considered resolved if there is one or more unresolved children - return false; - } - - const auto unresolvedOwnSynchronization = std::find_if( - _synchronizations.cbegin(), - _synchronizations.cend(), - [](const std::shared_ptr& s) { return !s->isResolved(); } - ); - - // To be considered resolved, all own synchronizations need to be resolved - return unresolvedOwnSynchronization == _synchronizations.cend(); -} - -std::vector Asset::ownSynchronizations() const { - std::vector res; - res.reserve(_synchronizations.size()); - std::transform( - _synchronizations.begin(), _synchronizations.end(), - std::back_inserter(res), - std::mem_fn(&std::shared_ptr::get) - ); - - return res; -} - -std::vector Asset::subTreeAssets() const { - std::unordered_set assets({ this }); - for (Asset* c : childAssets()) { - if (c == this) { - throw ghoul::RuntimeError(fmt::format( - "Detected cycle in asset inclusion for {} at {}", _assetName, _assetPath - )); - } - - std::vector subTree = c->subTreeAssets(); - std::copy(subTree.begin(), subTree.end(), std::inserter(assets, assets.end())); - } - std::vector assetVector(assets.begin(), assets.end()); - return assetVector; -} - -std::vector Asset::requiredSubTreeAssets() const { - std::unordered_set assets({ this }); - for (const std::shared_ptr& dep : _requiredAssets) { - std::vector subTree = dep->requiredSubTreeAssets(); - std::copy(subTree.begin(), subTree.end(), std::inserter(assets, assets.end())); - } - std::vector assetVector(assets.begin(), assets.end()); - return assetVector; -} - -bool Asset::isLoaded() const { - return _state != State::Unloaded && _state != State::LoadingFailed; -} - -bool Asset::isSynchronized() const { - return _state == State::SyncResolved || _state == State::Initialized || - _state == State::InitializationFailed; -} - -bool Asset::isSyncingOrResolved() const { - return _state == State::Synchronizing || _state == State::SyncResolved || - _state == State::Initialized || _state == State::InitializationFailed; -} - -bool Asset::hasLoadedParent() { - { - auto it = _requiringAssets.begin(); - while (it != _requiringAssets.end()) { - std::shared_ptr parent = it->lock(); - if (!parent) { - it = _requiringAssets.erase(it); - continue; - } - if (parent->isLoaded()) { - return true; - } - ++it; - } - } - { - auto it = _requestingAssets.begin(); - while (it != _requestingAssets.end()) { - std::shared_ptr parent = it->lock(); - if (!parent) { - it = _requestingAssets.erase(it); - continue; - } - if (parent->isLoaded() || parent->hasLoadedParent()) { - return true; - } - ++it; - } - } - - return false; -} - -bool Asset::hasSyncingOrResolvedParent() const { - for (const std::weak_ptr& p : _requiringAssets) { - std::shared_ptr parent = p.lock(); - if (!parent) { - continue; - } - if (parent->isSyncingOrResolved()) { - return true; - } - } - for (const std::weak_ptr& p : _requestingAssets) { - std::shared_ptr parent = p.lock(); - if (!parent) { - continue; - } - if (parent->isSyncingOrResolved() || parent->hasSyncingOrResolvedParent()) { - return true; - } - } - return false; -} - -bool Asset::hasInitializedParent() const { - for (const std::weak_ptr& p : _requiringAssets) { - std::shared_ptr parent = p.lock(); - if (!parent) { - continue; - } - if (parent->isInitialized()) { - return true; - } - } - for (const std::weak_ptr& p : _requestingAssets) { - std::shared_ptr parent = p.lock(); - if (!parent) { - continue; - } - if (parent->isInitialized() || parent->hasInitializedParent()) { - return true; - } - } - return false; -} - -bool Asset::isInitialized() const { - return _state == State::Initialized; -} - -bool Asset::startSynchronizations() { - if (!isLoaded()) { - LWARNING(fmt::format("Cannot start synchronizations of unloaded asset {}", id())); - return false; - } - for (Asset* child : requestedAssets()) { - child->startSynchronizations(); - } - - // Do not attempt to resync if this is already done - if (isSyncingOrResolved()) { - return _state != State::SyncResolved; - } - - setState(State::Synchronizing); - - bool childFailed = false; - - // Start synchronization of all children first - for (Asset* child : requiredAssets()) { - if (!child->startSynchronizations()) { - childFailed = true; - } - } - - // Now synchronize its own synchronizations - for (const std::shared_ptr& s : _synchronizations) { - if (!s->isResolved()) { - s->start(); - } - } - // If all syncs are resolved (or no syncs exist), mark as resolved - if (!isInitialized() && isSyncResolveReady()) { - setState(State::SyncResolved); - } - return !childFailed; -} - -bool Asset::cancelAllSynchronizations() { - std::vector children = childAssets(); - bool cancelledAnySync = std::any_of( - children.cbegin(), - children.cend(), - std::mem_fn(&Asset::cancelAllSynchronizations) - ); - - for (const std::shared_ptr& s : _synchronizations) { - if (s->isSyncing()) { - cancelledAnySync = true; - s->cancel(); - setState(State::Loaded); - } - } - if (cancelledAnySync) { - setState(State::Loaded); - } - return cancelledAnySync; -} - -bool Asset::cancelUnwantedSynchronizations() { - if (hasSyncingOrResolvedParent()) { - return false; - } - - const std::vector& children = childAssets(); - bool cancelledAnySync = std::any_of( - children.begin(), - children.end(), - std::mem_fn(&Asset::cancelUnwantedSynchronizations) - ); - - for (const std::shared_ptr& s : _synchronizations) { - if (s->isSyncing()) { - cancelledAnySync = true; - s->cancel(); - setState(State::Loaded); - } - } - if (cancelledAnySync) { - setState(State::Loaded); - } - return cancelledAnySync; -} - -float Asset::requiredSynchronizationProgress() const { - std::vector assets = requiredSubTreeAssets(); - return syncProgress(assets); -} - -float Asset::requestedSynchronizationProgress() { - std::vector assets = subTreeAssets(); - return syncProgress(assets); -} - -bool Asset::load() { - if (isLoaded()) { - return true; - } - - const bool loaded = loader()->loadAsset(this); - setState(loaded ? State::Loaded : State::LoadingFailed); - return loaded; -} - -void Asset::unload() { - if (!isLoaded()) { - return; - } - - setState(State::Unloaded); - loader()->unloadAsset(this); - - for (Asset* child : requiredAssets()) { - unrequire(child); - } - for (Asset* child : requestedAssets()) { - unrequest(child); - } -} - -void Asset::unloadIfUnwanted() { - if (hasLoadedParent()) { - return; - } - unload(); -} - -bool Asset::initialize() { - ZoneScoped - - if (isInitialized()) { - return true; - } - if (!isSynchronized()) { - LERROR(fmt::format("Cannot initialize unsynchronized asset {}", id())); - return false; - } - LDEBUG(fmt::format("Initializing asset '{}'", id())); - - // 1. Initialize requirements - for (const std::shared_ptr& child : _requiredAssets) { - child->initialize(); - } - - // 2. Initialize requests - for (const std::shared_ptr& child : _requestedAssets) { - if (child->isSynchronized()) { - child->initialize(); - } - } - - // 3. Call lua onInitialize - try { - loader()->callOnInitialize(this); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format("Failed to initialize asset {}", id())); - LERROR(fmt::format("{}: {}", e.component, e.message)); - // TODO: rollback; - setState(State::InitializationFailed); - return false; - } - - // 4. Update state - setState(State::Initialized); - - // 5. Call dependency lua onInitialize of this and requirements - for (const std::shared_ptr& child : _requiredAssets) { - try { - loader()->callOnDependencyInitialize(child.get(), this); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format( - "Failed to initialize required asset {} of {}; {}: {}", - child->id(), id(), e.component, e.message - )); - // TODO: rollback; - setState(State::InitializationFailed); - return false; - } - } - - // 6. Call dependency lua onInitialize of this and initialized requests - for (const std::shared_ptr& child : _requestedAssets) { - if (child->isInitialized()) { - try { - loader()->callOnDependencyInitialize(child.get(), this); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format( - "Failed to initialize requested asset {} of {}; {}: {}", - child->id(), id(), e.component, e.message - )); - // TODO: rollback; - } - } - } - - // 7. Call dependency lua onInitialize of initialized requesting assets and this - for (const std::weak_ptr& parent : _requestingAssets) { - std::shared_ptr p = parent.lock(); - if (p && p->isInitialized()) { - try { - loader()->callOnDependencyInitialize(this, p.get()); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format( - "Failed to initialize required asset {} of {}; {}: {}", - id(), p->id(), e.component, e.message - )); - // TODO: rollback; - } - } - } - return true; -} - -void Asset::deinitializeIfUnwanted() { - if (hasInitializedParent()) { - return; - } - deinitialize(); -} - -void Asset::deinitialize() { - if (!isInitialized()) { - return; - } - LDEBUG(fmt::format("Deintializing asset '{}'", id())); - - // Perform inverse actions as in initialize, in reverse order (7 - 1) - - // 7. Call dependency lua onDeinitialize of initialized requesting assets and this - for (const std::weak_ptr& parent : _requestingAssets) { - std::shared_ptr p = parent.lock(); - if (p && p->isInitialized()) { - try { - loader()->callOnDependencyDeinitialize(this, p.get()); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format( - "Failed to deinitialize requested asset {} of {}; {}: {}", - id(), p->id(), e.component, e.message - )); - } - } - } - - // 6. Call dependency lua onDeinitialize of this and initialized requests - for (const std::shared_ptr& child : _requestedAssets) { - if (child->isInitialized()) { - try { - loader()->callOnDependencyDeinitialize(child.get(), this); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format( - "Failed to deinitialize requested asset {} of {}; {}: {}", - child->id(), id(), e.component, e.message - )); - } - } - } - - // 5. Call dependency lua onInitialize of this and requirements - for (const std::shared_ptr& child : _requiredAssets) { - try { - loader()->callOnDependencyDeinitialize(child.get(), this); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format( - "Failed to deinitialize required asset {} of {}; {}: {}", - child->id(), id(), e.component, e.message - )); - } - } - - // 4. Update state - setState(Asset::State::SyncResolved); - - // 3. Call lua onInitialize - try { - loader()->callOnDeinitialize(this); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format( - "Failed to deinitialize asset {}; {}: {}", id(), e.component, e.message - )); - return; - } - - // 2 and 1. Deinitialize unwanted requirements and requests - for (Asset* dependency : childAssets()) { - dependency->deinitializeIfUnwanted(); - } -} - -std::string Asset::id() const { - return _hasAssetPath ? _assetPath : "$root"; -} - -const std::string& Asset::assetFilePath() const { - return _assetPath; -} - -bool Asset::hasAssetFile() const { - return _hasAssetPath; -} - -std::string Asset::assetDirectory() const { - return std::filesystem::path(_assetPath).parent_path().string(); -} - -const std::string& Asset::assetName() const { - return _assetName; -} - -AssetLoader* Asset::loader() const { - return _loader; -} - -bool Asset::requires(const Asset* asset) const { - const auto it = std::find_if( - _requiredAssets.cbegin(), - _requiredAssets.cend(), - [asset](const std::shared_ptr dep) { return dep.get() == asset; } - ); - return it != _requiredAssets.cend(); -} - -void Asset::require(std::shared_ptr child) { - if (state() != Asset::State::Unloaded) { - throw ghoul::RuntimeError("Cannot require child asset when already loaded"); - } - - const auto it = std::find(_requiredAssets.cbegin(), _requiredAssets.cend(), child); - if (it != _requiredAssets.cend()) { - // Do nothing if the requirement already exists. - return; - } - - _requiredAssets.push_back(child); - child->_requiringAssets.push_back(shared_from_this()); - - if (!child->isLoaded()) { - child->load(); - } - if (!child->isLoaded()) { - unrequire(child.get()); - } - - if (isSynchronized()) { - if (child->isLoaded() && !child->isSynchronized()) { - child->startSynchronizations(); - } - } - - if (isInitialized()) { - if (child->isSynchronized() && !child->isInitialized()) { - child->initialize(); - } - if (!child->isInitialized()) { - unrequire(child.get()); - } - } -} - -void Asset::unrequire(Asset* child) { - if (state() != Asset::State::Unloaded) { - throw ghoul::RuntimeError("Cannot unrequire child asset is in a loaded state"); - } - - const auto childIt = std::find_if( - _requiredAssets.cbegin(), - _requiredAssets.cend(), - [child](const std::shared_ptr& asset) { return asset.get() == child; } - ); - - if (childIt == _requiredAssets.cend()) { - // Do nothing if the request node not exist. - return; - } - - _requiredAssets.erase(childIt); - - const auto parentIt = std::find_if( - child->_requiringAssets.cbegin(), - child->_requiringAssets.cend(), - [this](const std::weak_ptr a) { return a.lock().get() == this; } - ); - if (parentIt == child->_requiringAssets.cend()) { - return; - } - - child->_requiringAssets.erase(parentIt); - - child->deinitializeIfUnwanted(); - child->cancelUnwantedSynchronizations(); - child->unloadIfUnwanted(); -} - -void Asset::request(std::shared_ptr child) { - const auto it = std::find(_requestedAssets.cbegin(), _requestedAssets.cend(), child); - if (it != _requestedAssets.cend()) { - // Do nothing if the request already exists. - return; - } - - _requestedAssets.push_back(child); - child->_requestingAssets.push_back(shared_from_this()); - - if (!child->isLoaded()) { - child->load(); - } - - if (isSynchronized() && child->isLoaded() && !child->isSynchronized()) { - child->startSynchronizations(); - } - - if (isInitialized() && child->isSynchronized() && !child->isInitialized()) { - child->initialize(); - } -} - -void Asset::unrequest(Asset* child) { - const auto childIt = std::find_if( - _requestedAssets.cbegin(), - _requestedAssets.cend(), - [child](const std::shared_ptr& asset) { return asset.get() == child; } - ); - if (childIt == _requestedAssets.cend()) { - // Do nothing if the request node not exist. - return; - } - - _requestedAssets.erase(childIt); - - const auto parentIt = std::find_if( - child->_requestingAssets.cbegin(), - child->_requestingAssets.cend(), - [this](const std::weak_ptr a) { return a.lock().get() == this; } - ); - if (parentIt == child->_requestingAssets.cend()) { - return; - } - - child->_requestingAssets.erase(parentIt); - - child->deinitializeIfUnwanted(); - child->cancelUnwantedSynchronizations(); - child->unloadIfUnwanted(); -} - -bool Asset::requests(Asset* asset) const { - const auto it = std::find_if( - _requestedAssets.cbegin(), - _requestedAssets.cend(), - [asset](const std::shared_ptr& dep) { return dep.get() == asset; } - ); - return it != _requiredAssets.cend(); -} - -std::vector Asset::requiredAssets() const { - std::vector res; - res.reserve(_requiredAssets.size()); - for (const std::shared_ptr& a : _requiredAssets) { - res.push_back(a.get()); - } - return res; -} - -std::vector Asset::requiringAssets() const { - std::vector res; - res.reserve(_requiringAssets.size()); - for (const std::weak_ptr& a : _requiringAssets) { - if (std::shared_ptr shared = a.lock(); shared) { - res.push_back(shared.get()); - } - } - return res; -} - -std::vector Asset::requestedAssets() const { - std::vector res; - res.reserve(_requestedAssets.size()); - for (const std::shared_ptr& a : _requestedAssets) { - res.push_back(a.get()); - } - return res; -} - -std::vector Asset::requestingAssets() const { - std::vector res; - res.reserve(_requestingAssets.size()); - for (const std::weak_ptr& a : _requestingAssets) { - if (std::shared_ptr shared = a.lock(); shared) { - res.push_back(shared.get()); - } - } - return res; -} - -std::vector Asset::childAssets() const { - std::vector children; - children.reserve(_requiredAssets.size() + _requestedAssets.size()); - - for (const std::shared_ptr& a : _requiredAssets) { - children.push_back(a.get()); - } - for (const std::shared_ptr& a : _requestedAssets) { - children.push_back(a.get()); - } - return children; -} - } // namespace openspace diff --git a/src/scene/assetloader.cpp b/src/scene/assetloader.cpp deleted file mode 100644 index 301070dad5..0000000000 --- a/src/scene/assetloader.cpp +++ /dev/null @@ -1,846 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "assetloader_lua.inl" - -namespace { - constexpr const char* AssetGlobalVariableName = "asset"; - - constexpr const char* RequireFunctionName = "require"; - constexpr const char* ExistsFunctionName = "exists"; - constexpr const char* ExportFunctionName = "export"; - - constexpr const char* SyncedResourceFunctionName = "syncedResource"; - constexpr const char* LocalResourceFunctionName = "localResource"; - - constexpr const char* OnInitializeFunctionName = "onInitialize"; - constexpr const char* OnDeinitializeFunctionName = "onDeinitialize"; - - constexpr const char* DirectoryConstantName = "directory"; - constexpr const char* FilePathConstantName = "filePath"; - - constexpr const char* MetaInformationKey = "meta"; - constexpr const char* MetaInformationName = "Name"; - constexpr const char* MetaInformationVersion = "Version"; - constexpr const char* MetaInformationDescription = "Description"; - constexpr const char* MetaInformationAuthor = "Author"; - constexpr const char* MetaInformationURL = "URL"; - constexpr const char* MetaInformationLicense = "License"; - constexpr const char* MetaInformationIdentifiers = "Identifiers"; - - constexpr const char* ExportsTableName = "_exports"; - constexpr const char* AssetTableName = "_asset"; - constexpr const char* DependantsTableName = "_dependants"; - - constexpr const char* _loggerCat = "AssetLoader"; - - constexpr const char* AssetFileSuffix = "asset"; - constexpr const char* SceneFileSuffix = "scene"; - - enum class PathType { - RelativeToAsset = 0, - RelativeToAssetRoot, - Absolute, - Tokenized - }; - - PathType classifyPath(const std::string& path) { - if (path.size() > 2 && path[0] == '.' && path[1] == '/') { - return PathType::RelativeToAsset; - } - if (path.size() > 3 && path[0] == '.' && path[1] == '.' && path[2] == '/') { - return PathType::RelativeToAsset; - } - if (path.size() > 3 && path[1] == ':' && (path[2] == '\\' || path[2] == '/')) { - return PathType::Absolute; - } - if (path.size() > 3 && path[0] == '$' && path[1] == '{') { - return PathType::Tokenized; - } - if (path.size() > 1 && (path[0] == '\\' || path[0] == '/')) { - return PathType::Absolute; - } - return PathType::RelativeToAssetRoot; - } -} // namespace - -namespace openspace { - -AssetLoader::AssetLoader(ghoul::lua::LuaState* luaState, - SynchronizationWatcher* syncWatcher, - std::string assetRootDirectory) - : _rootAsset(std::make_shared(this, syncWatcher)) - , _synchronizationWatcher(syncWatcher) - , _assetRootDirectory(std::move(assetRootDirectory)) - , _luaState(luaState) -{ - setCurrentAsset(_rootAsset.get()); - - // Create _assets table - lua_newtable(*_luaState); - _assetsTableRef = luaL_ref(*_luaState, LUA_REGISTRYINDEX); -} - -AssetLoader::~AssetLoader() { - _currentAsset = nullptr; - _rootAsset = nullptr; - luaL_unref(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); -} - -void AssetLoader::trackAsset(std::shared_ptr asset) { - _trackedAssets.emplace(asset->id(), asset); - setUpAssetLuaTable(asset.get()); -} - -void AssetLoader::untrackAsset(Asset* asset) { - tearDownAssetLuaTable(asset); - const auto it = _trackedAssets.find(asset->id()); - if (it != _trackedAssets.end()) { - _trackedAssets.erase(it); - } -} - -void AssetLoader::setUpAssetLuaTable(Asset* asset) { - // Set up lua table: - // AssetInfo - // |- Exports (table) - // |- Asset - // | |- localResource - // | |- syncedResource - // | |- require - // | |- request - // | |- exists - // | |- export - // | |- onInitialize - // | |- onDeinitialize - // | |- directory - // |- Dependants (table) - // - // where Dependency is a table: - // Dependency - // |- onInitialize - // |- onDeinitialize - - const int top = lua_gettop(*_luaState); - - // Push the global table of AssetInfos to the lua stack. - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); - const int globalTableIndex = lua_gettop(*_luaState); - - // Create a AssetInfo table for the current asset. - lua_newtable(*_luaState); - const int assetInfoTableIndex = lua_gettop(*_luaState); - - // Register empty Exports table for the current asset. - // (string => exported object) - lua_newtable(*_luaState); - lua_setfield(*_luaState, assetInfoTableIndex, ExportsTableName); - - // Create Asset table - // (string => lua functions) - lua_newtable(*_luaState); - const int assetTableIndex = lua_gettop(*_luaState); - - // Register local resource function - // string localResource(string path) - lua_pushlightuserdata(*_luaState, asset); - lua_pushcclosure(*_luaState, &assetloader::localResource, 1); - lua_setfield(*_luaState, assetTableIndex, LocalResourceFunctionName); - - // Register synced resource function - // string syncedResource(string path) - lua_pushlightuserdata(*_luaState, asset); - lua_pushcclosure(*_luaState, &assetloader::syncedResource, 1); - lua_setfield(*_luaState, assetTableIndex, SyncedResourceFunctionName); - - // Register require function - // Asset, Dependency require(string path) - lua_pushlightuserdata(*_luaState, asset); - lua_pushcclosure(*_luaState, &assetloader::require, 1); - lua_setfield(*_luaState, assetTableIndex, RequireFunctionName); - - // Register exists function - // bool exists(string path) - lua_pushlightuserdata(*_luaState, asset); - lua_pushcclosure(*_luaState, &assetloader::exists, 1); - lua_setfield(*_luaState, assetTableIndex, ExistsFunctionName); - - // Register export-dependency function - // export(string key, any value) - lua_pushlightuserdata(*_luaState, asset); - lua_pushcclosure(*_luaState, &assetloader::exportAsset, 1); - lua_setfield(*_luaState, assetTableIndex, ExportFunctionName); - - // Register onInitialize function - // void onInitialize(function initializationFunction) - lua_pushlightuserdata(*_luaState, asset); - lua_pushcclosure(*_luaState, &assetloader::onInitialize, 1); - lua_setfield(*_luaState, assetTableIndex, OnInitializeFunctionName); - - // Register onDeinitialize function - // void onDeinitialize(function deinitializationFunction) - lua_pushlightuserdata(*_luaState, asset); - lua_pushcclosure(*_luaState, &assetloader::onDeinitialize, 1); - lua_setfield(*_luaState, assetTableIndex, OnDeinitializeFunctionName); - - // Register directory constant - // string directory - lua_pushstring(*_luaState, asset->assetDirectory().c_str()); - lua_setfield(*_luaState, assetTableIndex, DirectoryConstantName); - - // Register filePath constant - // string filePath - lua_pushstring(*_luaState, asset->assetFilePath().c_str()); - lua_setfield(*_luaState, assetTableIndex, FilePathConstantName); - - // Attach Asset table to AssetInfo table - lua_setfield(*_luaState, assetInfoTableIndex, AssetTableName); - - // Register empty dependant table on AssetInfo table. - // (importer => dependant object) - lua_newtable(*_luaState); - lua_setfield(*_luaState, assetInfoTableIndex, DependantsTableName); - - // Extend global asset info table (pushed to the lua stack earlier) - // with this AssetInfo table - lua_setfield(*_luaState, globalTableIndex, asset->id().c_str()); - lua_settop(*_luaState, top); -} - -void AssetLoader::tearDownAssetLuaTable(Asset* asset) { - const int top = lua_gettop(*_luaState); - // Push the global table of AssetInfos to the lua stack. - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); - const int globalTableIndex = lua_gettop(*_luaState); - - lua_pushnil(*_luaState); - - // Clear entry from global asset table (pushed to the lua stack earlier) - lua_setfield(*_luaState, globalTableIndex, asset->id().c_str()); - lua_settop(*_luaState, top); -} - -bool AssetLoader::loadAsset(Asset* asset) { - const int top = lua_gettop(*_luaState); - Asset* parentAsset = _currentAsset; - - setCurrentAsset(asset); - defer { - setCurrentAsset(parentAsset); - }; - - if (!std::filesystem::is_regular_file(asset->assetFilePath())) { - LERROR(fmt::format( - "Could not load asset '{}': File does not exist", asset->assetFilePath()) - ); - lua_settop(*_luaState, top); - return false; - } - - try { - ghoul::lua::runScriptFile(*_luaState, asset->assetFilePath()); - } - catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format( - "Could not load asset '{}': {}", asset->assetFilePath(), e.message) - ); - lua_settop(*_luaState, top); - return false; - } - - // Extract meta information from the asset file if it was provided - // 1. Load the asset table - lua_getglobal(*_luaState, AssetGlobalVariableName); - ghoul_assert(lua_istable(*_luaState, -1), "Expected 'asset' table"); - lua_getfield(*_luaState, -1, MetaInformationKey); - if (!lua_isnil(*_luaState, -1)) { - // The 'meta' object exist; quick sanity check that it is a table - if (!lua_istable(*_luaState, -1)) { - LWARNING(fmt::format( - "When loading asset '{}', encountered a '{}' entry that was not a table", - asset->assetFilePath(), MetaInformationKey - )); - } - else { - // The 'meta' object exists and it is a table - ghoul::Dictionary metaDict; - ghoul::lua::luaDictionaryFromState(*_luaState, metaDict); - - Asset::MetaInformation meta; - if (metaDict.hasValue(MetaInformationName)) { - meta.name = metaDict.value(MetaInformationName); - - } - if (metaDict.hasValue(MetaInformationVersion)) { - meta.version = metaDict.value(MetaInformationVersion); - - } - if (metaDict.hasValue(MetaInformationDescription)) { - meta.description = - metaDict.value(MetaInformationDescription); - - } - if (metaDict.hasValue(MetaInformationAuthor)) { - meta.author = metaDict.value(MetaInformationAuthor); - - } - if (metaDict.hasValue(MetaInformationURL)) { - meta.url = metaDict.value(MetaInformationURL); - } - if (metaDict.hasValue(MetaInformationLicense)) { - meta.license = metaDict.value(MetaInformationLicense); - } - if (metaDict.hasValue(MetaInformationIdentifiers)) { - ghoul::Dictionary iddict = - metaDict.value(MetaInformationIdentifiers); - for (size_t i = 1; i <= iddict.size(); ++i) { - std::string key = std::to_string(i); - std::string identifier = iddict.value(key); - meta.identifiers.push_back(identifier); - } - } - asset->setMetaInformation(std::move(meta)); - } - } - - lua_settop(*_luaState, top); - return true; -} - -void AssetLoader::unloadAsset(Asset* asset) { - for (int ref : _onInitializationFunctionRefs[asset]) { - luaL_unref(*_luaState, LUA_REGISTRYINDEX, ref); - } - _onInitializationFunctionRefs[asset].clear(); - - for (int ref : _onDeinitializationFunctionRefs[asset]) { - luaL_unref(*_luaState, LUA_REGISTRYINDEX, ref); - } - _onDeinitializationFunctionRefs[asset].clear(); - - for (std::pair> it : - _onDependencyInitializationFunctionRefs[asset]) - { - for (int ref : it.second) { - luaL_unref(*_luaState, LUA_REGISTRYINDEX, ref); - } - } - _onDependencyInitializationFunctionRefs.erase(asset); - - for (std::pair> it : - _onDependencyDeinitializationFunctionRefs[asset]) - { - for (int ref : it.second) { - luaL_unref(*_luaState, LUA_REGISTRYINDEX, ref); - } - } - _onDependencyDeinitializationFunctionRefs.erase(asset); - - asset->clearSynchronizations(); - untrackAsset(asset); -} - -std::string AssetLoader::generateAssetPath(const std::string& baseDirectory, - const std::string& assetPath) const -{ - // Support paths that are - // 1) Relative to baseDirectory (./* or ../*) - // 3) Absolute paths (*:/* or /*) - // 2) Relative to the global asset root (*) - - PathType pathType = classifyPath(assetPath); - std::string prefix; - if (pathType == PathType::RelativeToAsset) { - prefix = baseDirectory + '/'; - } - else if (pathType == PathType::RelativeToAssetRoot) { - prefix = _assetRootDirectory + '/'; - } - - // Construct the full path including the .asset extension - std::string assetSuffix = std::string(".") + AssetFileSuffix; - const bool hasAssetSuffix = - (assetPath.size() > assetSuffix.size()) && - (assetPath.substr(assetPath.size() - assetSuffix.size()) == assetSuffix); - std::string fullAssetPath = - (pathType == PathType::Tokenized) ? - absPath(assetPath).string() : - prefix + assetPath; - if (!hasAssetSuffix) { - fullAssetPath += assetSuffix; - } - bool fullAssetPathExists = std::filesystem::is_regular_file(absPath(fullAssetPath)); - - // Construct the full path including the .scene extension - const std::string sceneSuffix = std::string(".") + SceneFileSuffix; - const bool hasSceneSuffix = - (assetPath.size() > sceneSuffix.size()) && - (assetPath.substr(assetPath.size() - sceneSuffix.size()) == sceneSuffix); - const std::string fullScenePath = - hasSceneSuffix ? - prefix + assetPath : - prefix + assetPath + sceneSuffix; - const bool fullScenePathExists = - std::filesystem::is_regular_file(absPath(fullScenePath)); - - if (fullAssetPathExists && fullScenePathExists) { - LWARNING(fmt::format( - "'{}' and '{}' file found with non-specific request '{}'. Loading '{}'. " - "Explicitly add extension to suppress this warning.", - fullAssetPath, fullScenePath, prefix + assetPath, fullAssetPath - )); - - return absPath(fullAssetPath).string(); - } - - if (fullScenePathExists) { - return absPath(fullScenePath).string(); - } - - // We don't check whether the file exists here as the error will be more - // comprehensively logged by Lua either way - return absPath(fullAssetPath).string(); -} - -std::shared_ptr AssetLoader::getAsset(const std::string& name) { - std::filesystem::path directory = currentDirectory(); - const std::string path = generateAssetPath(directory.string(), name); - - // Check if asset is already loaded. - const auto it = _trackedAssets.find(path); - - if (it != _trackedAssets.end()) { - if (std::shared_ptr a = it->second.lock(); a != nullptr) { - return a; - } - } - - std::shared_ptr asset = std::make_shared( - this, - _synchronizationWatcher, - path - ); - - trackAsset(asset); - return asset; -} - -int AssetLoader::onInitializeLua(Asset* asset) { - ghoul::lua::checkArgumentsAndThrow(*_luaState, 1, "lua::onInitialize"); - - const int referenceIndex = luaL_ref(*_luaState, LUA_REGISTRYINDEX); - _onInitializationFunctionRefs[asset].push_back(referenceIndex); - - lua_settop(*_luaState, 0); - return 0; -} - -int AssetLoader::onDeinitializeLua(Asset* asset) { - ghoul::lua::checkArgumentsAndThrow(*_luaState, 1, "lua::onDeinitialize"); - - const int referenceIndex = luaL_ref(*_luaState, LUA_REGISTRYINDEX); - _onDeinitializationFunctionRefs[asset].push_back(referenceIndex); - - lua_settop(*_luaState, 0); - return 0; -} - -int AssetLoader::onInitializeDependencyLua(Asset* dependant, Asset* dependency) { - ghoul::lua::checkArgumentsAndThrow(*_luaState, 1, "lua::onInitializeDependency"); - - const int refIndex = luaL_ref(*_luaState, LUA_REGISTRYINDEX); - _onDependencyInitializationFunctionRefs[dependant][dependency].push_back(refIndex); - - lua_settop(*_luaState, 0); - return 0; -} - -int AssetLoader::onDeinitializeDependencyLua(Asset* dependant, Asset* dependency) { - ghoul::lua::checkArgumentsAndThrow(*_luaState, 1, "lua::onDeinitializeDependency"); - - const int refIndex = luaL_ref(*_luaState, LUA_REGISTRYINDEX); - _onDependencyDeinitializationFunctionRefs[dependant][dependency].push_back(refIndex); - - lua_settop(*_luaState, 0); - return 0; -} - -void AssetLoader::unrequest(const std::string& identifier) { - std::shared_ptr asset = has(identifier); - Asset* parent = _currentAsset; - parent->unrequest(asset.get()); - assetUnrequested(parent, asset); -} - -std::filesystem::path AssetLoader::currentDirectory() const { - if (_currentAsset->hasAssetFile()) { - return _currentAsset->assetDirectory(); - } - else { - return _assetRootDirectory; - } -} - -std::shared_ptr AssetLoader::add(const std::string& identifier) { - ZoneScoped - - setCurrentAsset(_rootAsset.get()); - std::shared_ptr asset = getAsset(identifier); - Asset* parent = _currentAsset; - parent->request(asset); - assetRequested(parent, asset); - return asset; -} - -void AssetLoader::remove(const std::string& identifier) { - ZoneScoped - - setCurrentAsset(_rootAsset.get()); - unrequest(identifier); -} - -std::shared_ptr AssetLoader::has(const std::string& identifier) const { - std::filesystem::path directory = currentDirectory(); - std::string path = generateAssetPath(directory.string(), identifier); - - const auto it = _trackedAssets.find(path); - if (it == _trackedAssets.end()) { - return nullptr; - } - return it->second.lock(); -} - -const Asset& AssetLoader::rootAsset() const { - return *_rootAsset; -} - -Asset& AssetLoader::rootAsset() { - return *_rootAsset; -} - -const std::string& AssetLoader::assetRootDirectory() const { - return _assetRootDirectory; -} - -void AssetLoader::callOnInitialize(Asset* asset) { - ZoneScoped - - for (int init : _onInitializationFunctionRefs[asset]) { - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, init); - if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { - throw ghoul::lua::LuaRuntimeException( - "When initializing " + asset->assetFilePath() + ": " + - ghoul::lua::value(*_luaState, -1, ghoul::lua::PopValue::Yes) - ); - } - // Clean up lua stack, in case the pcall left anything there. - lua_settop(*_luaState, 0); - } -} - -void AssetLoader::callOnDeinitialize(Asset* asset) { - ZoneScoped - - const std::vector& funs = _onDeinitializationFunctionRefs[asset]; - for (auto it = funs.rbegin(); it != funs.rend(); it++) { - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, *it); - if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { - throw ghoul::lua::LuaRuntimeException( - "When deinitializing " + asset->assetFilePath() + ": " + - ghoul::lua::value(*_luaState, -1, ghoul::lua::PopValue::Yes) - ); - } - // Clean up lua stack, in case the pcall left anything there. - lua_settop(*_luaState, 0); - } -} - -void AssetLoader::callOnDependencyInitialize(Asset* asset, Asset* dependant) { - ZoneScoped - - for (int init : _onDependencyInitializationFunctionRefs[dependant][asset]) { - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, init); - if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { - throw ghoul::lua::LuaRuntimeException( - "When initializing dependency " + dependant->assetFilePath() + " -> " + - asset->assetFilePath() + ": " + - ghoul::lua::value(*_luaState, -1, ghoul::lua::PopValue::Yes) - ); - } - // Clean up lua stack, in case the pcall left anything there. - lua_settop(*_luaState, 0); - } - // Potential Todo: - // Call dependency->onInitialize with the asset table - // exported by the child asset as argument -} - -void AssetLoader::callOnDependencyDeinitialize(Asset* asset, Asset* dependant) { - ZoneScoped - - const std::vector& funs = - _onDependencyDeinitializationFunctionRefs[dependant][asset]; - - for (auto it = funs.rbegin(); it != funs.rend(); it++) { - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, *it); - if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { - throw ghoul::lua::LuaRuntimeException( - "When deinitializing dependency " + dependant->assetFilePath() + " -> " + - asset->assetFilePath() + ": " + - ghoul::lua::value(*_luaState, -1, ghoul::lua::PopValue::Yes) - ); - } - // Clean up lua stack, in case the pcall left anything there. - lua_settop(*_luaState, 0); - } -} - -int AssetLoader::localResourceLua(Asset* asset) { - ZoneScoped - - ghoul::lua::checkArgumentsAndThrow(*_luaState, 1, "lua::localResourceLua"); - - std::string name = ghoul::lua::value( - *_luaState, - 1, - ghoul::lua::PopValue::Yes - ); - - const std::string resolvedName = fmt::format("{}/{}", asset->assetDirectory(), name); - - lua_pushstring(*_luaState, resolvedName.c_str()); - - ghoul_assert(lua_gettop(*_luaState) == 1, "Incorrect number of items left on stack"); - return 1; -} - -int AssetLoader::syncedResourceLua(Asset* asset) { - ZoneScoped - - ghoul::lua::checkArgumentsAndThrow(*_luaState, 1, "lua::syncedResourceLua"); - - ghoul::Dictionary d; - ghoul::lua::luaDictionaryFromState(*_luaState, d); - - std::unique_ptr sync = - ResourceSynchronization::createFromDictionary(d); - - const std::string absolutePath = sync->directory(); - - asset->addSynchronization(std::move(sync)); - - lua_settop(*_luaState, 0); - lua_pushstring(*_luaState, absolutePath.c_str()); - - ghoul_assert(lua_gettop(*_luaState) == 1, "Incorrect number of items left on stack"); - return 1; -} - -void AssetLoader::setCurrentAsset(Asset* asset) { - ZoneScoped - - const int top = lua_gettop(*_luaState); - - _currentAsset = asset; - // Set `asset` lua global to point to the current asset table - - if (asset == _rootAsset.get()) { - lua_pushnil(*_luaState); - lua_setglobal(*_luaState, AssetGlobalVariableName); - lua_settop(*_luaState, top); - return; - } - - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); - lua_getfield(*_luaState, -1, asset->id().c_str()); - lua_getfield(*_luaState, -1, AssetTableName); - lua_setglobal(*_luaState, AssetGlobalVariableName); - - lua_settop(*_luaState, top); -} - -int AssetLoader::requireLua(Asset* dependant) { - ghoul::lua::checkArgumentsAndThrow(*_luaState, 1, "lua::require"); - - std::string assetName = luaL_checkstring(*_luaState, 1); - lua_settop(*_luaState, 0); - - std::shared_ptr dependency = getAsset(assetName); - _currentAsset->require(dependency); - - if (!dependency) { - return ghoul::lua::luaError( - *_luaState, - fmt::format("Asset '{}' not found", assetName) - ); - } - - addLuaDependencyTable(dependant, dependency.get()); - - // Get the exports table - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); - lua_getfield(*_luaState, -1, dependency->id().c_str()); - lua_getfield(*_luaState, -1, ExportsTableName); - const int exportsTableIndex = lua_gettop(*_luaState); - - // Get the dependency table - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); - lua_getfield(*_luaState, -1, dependency->id().c_str()); - lua_getfield(*_luaState, -1, DependantsTableName); - lua_getfield(*_luaState, -1, dependant->id().c_str()); - const int dependencyTableIndex = lua_gettop(*_luaState); - - lua_pushvalue(*_luaState, exportsTableIndex); - lua_pushvalue(*_luaState, dependencyTableIndex); - - lua_replace(*_luaState, 2); - lua_replace(*_luaState, 1); - lua_settop(*_luaState, 2); - - ghoul_assert(lua_gettop(*_luaState) == 2, "Incorrect number of items left on stack"); - return 2; -} - -int AssetLoader::existsLua(Asset*) { - ghoul::lua::checkArgumentsAndThrow(*_luaState, 1, "lua::exists"); - - const std::string assetName = luaL_checkstring(*_luaState, 1); - - const std::filesystem::path directory = currentDirectory(); - const std::string path = generateAssetPath(directory.string(), assetName); - - lua_settop(*_luaState, 0); - lua_pushboolean(*_luaState, std::filesystem::is_regular_file(path)); - ghoul_assert(lua_gettop(*_luaState) == 1, "Incorrect number of items left on stack"); - return 1; -} - -int AssetLoader::exportAssetLua(Asset* asset) { - ghoul::lua::checkArgumentsAndThrow(*_luaState, 2, "lua::exportAsset"); - - const std::string exportName = luaL_checkstring(*_luaState, 1); - - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); - lua_getfield(*_luaState, -1, asset->id().c_str()); - lua_getfield(*_luaState, -1, ExportsTableName); - const int exportsTableIndex = lua_gettop(*_luaState); - - // push the second argument - lua_pushvalue(*_luaState, 2); - lua_setfield(*_luaState, exportsTableIndex, exportName.c_str()); - - lua_settop(*_luaState, 0); - ghoul_assert(lua_gettop(*_luaState) == 0, "Incorrect number of items left on stack"); - return 0; -} - -void AssetLoader::addLuaDependencyTable(Asset* dependant, Asset* dependency) { - const int top = lua_gettop(*_luaState); - - const std::string dependantId = dependant->id(); - const std::string dependencyId = dependency->id(); - - // Extract the imported asset's dependants table - lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); - lua_getfield(*_luaState, -1, dependencyId.c_str()); - lua_getfield(*_luaState, -1, DependantsTableName); - const int dependantsTableIndex = lua_gettop(*_luaState); - - // Set up Dependency object - lua_newtable(*_luaState); - const int currentDependantTableIndex = lua_gettop(*_luaState); - - // Register onDependencyInitialize function - // void onInitialize(function initializationFunction) - lua_pushlightuserdata(*_luaState, dependant); - lua_pushlightuserdata(*_luaState, dependency); - lua_pushcclosure(*_luaState, &assetloader::onInitializeDependency, 2); - lua_setfield(*_luaState, currentDependantTableIndex, OnInitializeFunctionName); - - // Register onDependencyDeinitialize function - // void onDeinitialize(function deinitializationFunction) - lua_pushlightuserdata(*_luaState, dependant); - lua_pushlightuserdata(*_luaState, dependency); - lua_pushcclosure(*_luaState, &assetloader::onDeinitializeDependency, 2); - lua_setfield(*_luaState, currentDependantTableIndex, OnDeinitializeFunctionName); - - // Duplicate the table reference on the stack, so it remains after assignment. - lua_pushvalue(*_luaState, -1); - - // Register the dependant table on the imported asset's dependants table. - lua_setfield(*_luaState, dependantsTableIndex, dependantId.c_str()); - - lua_settop(*_luaState, top); -} - -void AssetLoader::addAssetListener(AssetListener* listener) { - const auto it = std::find(_assetListeners.cbegin(), _assetListeners.cend(), listener); - - if (it == _assetListeners.cend()) { - _assetListeners.push_back(listener); - } -} - -void AssetLoader::removeAssetListener(AssetListener* listener) { - _assetListeners.erase(std::remove( - _assetListeners.begin(), - _assetListeners.end(), - listener - )); -} - -void AssetLoader::assetStateChanged(Asset* asset, Asset::State state) { - for (AssetListener* listener : _assetListeners) { - listener->assetStateChanged(asset, state); - } -} - -void AssetLoader::assetRequested(Asset* parent, std::shared_ptr child) { - for (AssetListener* listener : _assetListeners) { - listener->assetRequested(parent, child); - } -} - -void AssetLoader::assetUnrequested(Asset* parent, std::shared_ptr child) { - for (AssetListener* listener : _assetListeners) { - listener->assetUnrequested(parent, child); - } -} - -} // namespace openspace diff --git a/src/scene/assetloader_lua.inl b/src/scene/assetloader_lua.inl deleted file mode 100644 index b47b7ee4b8..0000000000 --- a/src/scene/assetloader_lua.inl +++ /dev/null @@ -1,97 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -namespace openspace::assetloader { - -/** - * Adds a Lua function to be called upon asset initialization - * Usage: void asset.onInitialize(function initFun) - */ -int onInitialize(lua_State* L) { - Asset* asset = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - return asset->loader()->onInitializeLua(asset); -} - -/** - * Adds a Lua function to be called upon asset deinitialization - * Usage: void asset.onDeinitialize(function initFun) - */ -int onDeinitialize(lua_State* L) { - Asset* asset = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - return asset->loader()->onDeinitializeLua(asset); -} - -/** - * Adds a Lua function to be called when a dependency link is initialized - * Usage: void asset.onInitialize(function initFun) - */ -int onInitializeDependency(lua_State* L) { - Asset* dependant = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - Asset* dependency = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(2))); - return dependant->loader()->onInitializeDependencyLua(dependant, dependency); -} - -/** - * Adds a Lua function to be called upon asset deinitialization - * Usage: void asset.onDeinitialize(function initFun) - */ -int onDeinitializeDependency(lua_State* L) { - Asset* dependant = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - Asset* dependency = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(2))); - return dependant->loader()->onDeinitializeDependencyLua(dependant, dependency); -} - -/** - * Requires dependency - * Gives access to - * AssetTable: Exported lua values - * Dependency: ... - * Usage: {AssetTable, Dependency} = asset.import(string assetIdentifier) - */ -int require(lua_State* L) { - Asset* asset = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - return asset->loader()->requireLua(asset); -} - -int exists(lua_State* L) { - Asset* asset = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - return asset->loader()->existsLua(asset); -} - -int localResource(lua_State* L) { - Asset* asset = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - return asset->loader()->localResourceLua(asset); -} - -int syncedResource(lua_State* L) { - Asset* asset = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - return asset->loader()->syncedResourceLua(asset); -} - -int exportAsset(lua_State* L) { - Asset* asset = reinterpret_cast(lua_touserdata(L, lua_upvalueindex(1))); - return asset->loader()->exportAssetLua(asset); -} - -} // namespace openspace::assetloader diff --git a/src/scene/assetmanager.cpp b/src/scene/assetmanager.cpp index 346adf3c7a..c597a1ec7e 100644 --- a/src/scene/assetmanager.cpp +++ b/src/scene/assetmanager.cpp @@ -24,106 +24,779 @@ #include -#include -#include -#include +#include +#include #include -#include -#include +#include #include -#include -#include #include "assetmanager_lua.inl" +namespace { + constexpr const char* _loggerCat = "AssetManager"; + + constexpr const char* AssetGlobalVariableName = "asset"; + + constexpr const char* ExportsTableName = "_exports"; + constexpr const char* AssetTableName = "_asset"; + + enum class PathType { + RelativeToAsset, ///< Specified as a path relative to the requiring asset + RelativeToAssetRoot, ///< Specified as a path relative to the root folder + Absolute, ///< Specified as an absolute path + Tokenized ///< Specified as a path that starts with a token + }; + + PathType classifyPath(const std::string& path) { + if (path.size() > 2 && path[0] == '.' && path[1] == '/') { + return PathType::RelativeToAsset; + } + if (path.size() > 3 && path[0] == '.' && path[1] == '.' && path[2] == '/') { + return PathType::RelativeToAsset; + } + if (path.size() > 3 && path[1] == ':' && (path[2] == '\\' || path[2] == '/')) { + return PathType::Absolute; + } + if (path.size() > 1 && (path[0] == '\\' || path[0] == '/')) { + return PathType::Absolute; + } + if (FileSys.containsToken(path)) { + return PathType::Tokenized; + } + return PathType::RelativeToAssetRoot; + } + + struct [[codegen::Dictionary(AssetMeta)]] Parameters { + // The user-facing name of the asset. It should describe to the user what they can + // expect when loading the asset into a profile + std::optional name; + + // A version number for this specific asset. It is recommended to use SemVer for + // the versioning. The versioning used here does not have to correspond to any + // versioning information provided by OpenSpace + std::optional version; + + // A user-facing description of the asset explaining what the contents are, where + // the data has been acquired from and what a user can do or see with this asset. + // This might also provide additional URLs for a user to read more details about + // the content of this asset + std::optional description; + + // The name of the author for this asset file + std::optional author; + + // A reprentative URL for this asset as chosen by the asset author. This might be + // a URL to the research group that provided the data, the personal URL of the + // author, or a webpage for the group that is responsible for this asset + std::optional url [[codegen::key("URL")]]; + + // The license information under which this asset is released. For suggestions on + // potential licenses, see https://opensource.org/licenses but we suggest the MIT + // or BSD 2-Clause or BSD 3-Clause license. + std::optional license; + + // A list of all identifiers that are exposed by this asset. This list is needed + // to populate the descriptions in the main user interface + std::optional> identifiers; + }; +#include "assetmanager_codegen.cpp" +} // namespace + namespace openspace { -AssetManager::AssetManager(ghoul::lua::LuaState* state, std::string assetRootDirectory) - : _assetLoader(state, &_synchronizationWatcher, std::move(assetRootDirectory)) -{} +AssetManager::AssetManager(ghoul::lua::LuaState* state, + std::filesystem::path assetRootDirectory) + : _assetRootDirectory(std::move(assetRootDirectory)) + , _luaState(state) +{ + ghoul_precondition(state, "Lua state must not be nullptr"); -void AssetManager::initialize() { - ZoneScoped + // Create _assets table + lua_newtable(*_luaState); + _assetsTableRef = luaL_ref(*_luaState, LUA_REGISTRYINDEX); +} - _assetLoader.addAssetListener(this); - _assetLoader.rootAsset().initialize(); +AssetManager::~AssetManager() { + _assets.clear(); + luaL_unref(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); } void AssetManager::deinitialize() { - _assetLoader.rootAsset().deinitialize(); - _assetLoader.rootAsset().unload(); - _assetLoader.removeAssetListener(this); -} - -bool AssetManager::update() { ZoneScoped - // Add assets - for (const std::pair& c : _pendingStateChangeCommands) { - ZoneScopedN("(add) Pending State Change") - const std::string& path = c.first; - const bool add = c.second; - if (add) { - _assetLoader.add(path); - global::profile->addAsset(path); + for (Asset* asset : _rootAssets) { + if (!asset->hasInitializedParent()) { + asset->deinitialize(); } + asset->unload(); } + _toBeDeleted.clear(); +} + +void AssetManager::update() { + ZoneScoped + + // Delete all the assets that have been marked for deletion in the previous frame + { + ZoneScopedN("Deleting assets") + + _toBeDeleted.clear(); + } + + // Initialize all assets that have been loaded and synchronized but that not yet + // initialized + for (auto it = _toBeInitialized.cbegin(); it != _toBeInitialized.cend(); ++it) { + ZoneScopedN("Initializing queued assets") + Asset* a = *it; + + if (a->isInitialized() || !a->isSynchronized()) { + // nothing to do here + continue; + } + + a->initialize(); + + // We are only doing one asset per frame to keep the loading screen working a bit + // smoother, so we remove the current one and then break out of the loop + _toBeInitialized.erase(it); + + // OBS: This can't be replaced with a (get the first one and then bail) as the + // first asset in the list might wait for its child later in the list to finished. + // So if we check the first one over and over again, we'll be in an infinite loop + break; + } + + // Add all assets that have been queued for loading since the last `update` call + for (const std::string& asset : _assetAddQueue) { + ZoneScopedN("Adding queued assets") + + std::filesystem::path path = generateAssetPath(_assetRootDirectory, asset); + Asset* a = retrieveAsset(path); + + const auto it = std::find(_rootAssets.cbegin(), _rootAssets.cend(), a); + if (it != _rootAssets.cend()) { + // Do nothing if the asset has already been requested on a root level. Even if + // another asset has already required this asset, calling `load`, + // `startSynchronization`, etc on it are still fine since all of those + // functions bail out early if they already have been called before + continue; + } + + _rootAssets.push_back(a); + a->load(nullptr); + a->startSynchronizations(); + + _toBeInitialized.push_back(a); + global::profile->addAsset(asset); + } + _assetAddQueue.clear(); + // Remove assets - for (const std::pair& c : _pendingStateChangeCommands) { - ZoneScopedN("(remove) Pending State change") - const std::string& path = c.first; - const bool remove = !c.second; - if (remove && _assetLoader.has(path)) { - _assetLoader.remove(path); - global::profile->removeAsset(path); + for (const std::string& asset : _assetRemoveQueue) { + ZoneScopedN("Removing queued assets") + std::filesystem::path path = generateAssetPath(_assetRootDirectory, asset); + + const auto it = std::find_if( + _assets.cbegin(), + _assets.cend(), + [&path](const std::unique_ptr& asset) { return asset->path() == path; } + ); + if (it == _assets.cend()) { + LWARNING(fmt::format("Tried to remove unknown asset {}. Skipping", asset)); + continue; + } + + Asset* a = it->get(); + auto jt = std::find(_rootAssets.cbegin(), _rootAssets.cend(), a); + if (jt == _rootAssets.cend()) { + // Trying to remove an asset from the middle of the tree might have some + // unexpected behavior since if we were to remove an asset with children, we + // would have to unload those children as well. Also, we don't know if that + // Asset's parents are actually requiring the asset we are about to remove so + // we might break things horribly for people. + // We should figure out a way to fix this without reintroducing the + // require/request confusion, but until then, we'll prohibit removing non-root + // assets + + LWARNING("Tried to remove an asset that was not on the root level. Skipping"); + continue; + } + + _rootAssets.erase(jt); + // Even though we are removing a root asset, we might not be the only person that + // is interested in the asset, so we can only deinitialize it if we were, in fact, + // the only person, meaning that the asset never had any parents + if (!a->hasInitializedParent()) { + a->deinitialize(); + } + if (!a->hasLoadedParent()) { + a->unload(); + } + global::profile->removeAsset(asset); + } + _assetRemoveQueue.clear(); + + + // Change state based on synchronizations. If any of the unfinished synchronizations + // has finished since the last call of this function, we should notify the assets and + // remove the synchronization from the list of unfinished ones so that we don't need + // to check as much next time around + for (auto it = _unfinishedSynchronizations.begin(); + it != _unfinishedSynchronizations.end();) + { + SyncItem* si = *it; + if (si->synchronization->isResolved()) { + for (Asset* a : si->assets) { + a->setSynchronizationStateResolved(); + } + it = _unfinishedSynchronizations.erase(it); + } + else if (si->synchronization->isRejected()) { + LERROR(fmt::format( + "Failed to synchronize resource '{}'", si->synchronization->name() + )); + for (Asset* a : si->assets) { + a->setSynchronizationStateRejected(); + } + it = _unfinishedSynchronizations.erase(it); + } + else { + ++it; } } - _pendingStateChangeCommands.clear(); - - // Change state based on synchronizations - _synchronizationWatcher.notify(); - - return false; -} - -void AssetManager::assetStateChanged(Asset*, Asset::State) { - // Potential todo: notify user about asset stage change - //LINFO(asset->id() << " changed state to " << static_cast(state)); -} - -void AssetManager::assetRequested(Asset*, std::shared_ptr) { - // Potential todo: notify user about asset request - //LINFO(parent->id() << " requested " << child->id()); -} - -void AssetManager::assetUnrequested(Asset*, std::shared_ptr) { - // Potential todo: notify user about asset unrequest - //LINFO(parent->id() << " unrequested " << child->id()); } void AssetManager::add(const std::string& path) { - _pendingStateChangeCommands[path] = true; + ghoul_precondition(!path.empty(), "Path must not be empty"); + // First check if the path is already in the remove queue. If so, remove it from there + const auto it = _assetRemoveQueue.find(path); + if (it != _assetRemoveQueue.end()) { + _assetRemoveQueue.erase(it); + } + + _assetAddQueue.insert(path); } void AssetManager::remove(const std::string& path) { - _pendingStateChangeCommands[path] = false; + ghoul_precondition(!path.empty(), "Path must not be empty"); + + // First check if the path is already in the add queue. If so, remove it from there + const auto it = _assetAddQueue.find(path); + if (it != _assetAddQueue.end()) { + _assetAddQueue.erase(it); + } + + _assetRemoveQueue.insert(path); } -void AssetManager::removeAll() { - ZoneScoped +std::vector AssetManager::allAssets() const { + std::vector res; + res.reserve(_assets.size()); + for (const std::unique_ptr& asset : _assets) { + res.push_back(asset.get()); + } + return res; +} - _pendingStateChangeCommands.clear(); - for (const Asset* a : _assetLoader.rootAsset().requestedAssets()) { - _pendingStateChangeCommands[a->assetFilePath()] = false; +std::vector AssetManager::allSynchronizations() const { + std::vector res; + res.reserve(_synchronizations.size()); + using K = std::string; + using V = std::unique_ptr; + for (const std::pair& p : _synchronizations) { + res.push_back(p.second->synchronization.get()); + } + return res; +} + +bool AssetManager::loadAsset(Asset* asset, Asset* parent) { + ghoul_precondition(asset, "Asset must not be nullptr"); + + const int top = lua_gettop(*_luaState); + + setCurrentAsset(asset); + defer { + lua_settop(*_luaState, top); + setCurrentAsset(parent); + }; + + if (!std::filesystem::is_regular_file(asset->path())) { + LERROR(fmt::format( + "Could not load asset {}: File does not exist", asset->path()) + ); + return false; + } + + try { + ghoul::lua::runScriptFile(*_luaState, asset->path()); + } + catch (const ghoul::lua::LuaRuntimeException& e) { + LERROR(fmt::format("Could not load asset {}: {}", asset->path(), e.message)); + return false; + } + + // Extract meta information from the asset file if it was provided + lua_getglobal(*_luaState, AssetGlobalVariableName); + ghoul_assert(lua_istable(*_luaState, -1), "Expected 'asset' table"); + lua_getfield(*_luaState, -1, "meta"); + ghoul::Dictionary metaDict = ghoul::lua::luaDictionaryFromState(*_luaState); + if (!metaDict.isEmpty()) { + Parameters p = codegen::bake(metaDict); + + Asset::MetaInformation meta; + meta.name = p.name.value_or(""); + meta.version = p.version.value_or(""); + meta.description = p.description.value_or(""); + meta.author = p.author.value_or(""); + meta.url = p.url.value_or(""); + meta.license = p.license.value_or(""); + meta.identifiers = p.identifiers.value_or(std::vector()); + asset->setMetaInformation(std::move(meta)); + } + + return true; +} + +void AssetManager::unloadAsset(Asset* asset) { + ghoul_precondition(asset, "Asset must not be nullptr"); + + for (int ref : _onInitializeFunctionRefs[asset]) { + luaL_unref(*_luaState, LUA_REGISTRYINDEX, ref); + } + _onInitializeFunctionRefs[asset].clear(); + + for (int ref : _onDeinitializeFunctionRefs[asset]) { + luaL_unref(*_luaState, LUA_REGISTRYINDEX, ref); + } + _onDeinitializeFunctionRefs[asset].clear(); + + // + // Tear down asset lua table + const int top = lua_gettop(*_luaState); + // Push the global table of AssetInfos to the lua stack. + lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); + const int globalTableIndex = lua_gettop(*_luaState); + + ghoul::lua::push(*_luaState, ghoul::lua::nil_t()); + + // Clear entry from global asset table (pushed to the Lua stack earlier) + std::string path = asset->path().string(); + lua_setfield(*_luaState, globalTableIndex, path.c_str()); + lua_settop(*_luaState, top); + + + const auto it = std::find_if( + _assets.begin(), + _assets.end(), + [&asset](const std::unique_ptr& a) { return a.get() == asset; } + ); + if (it != _assets.end()) { + // Instead of deleting the asset directly, we are moving it into a to-delete queue + // as this unloadAsset function is called from the asset that we are manipulating + // right now. And deleting the asset while we are in a function of the same asset + // might be painful + _toBeDeleted.push_back(std::move(*it)); + _assets.erase(it); } } -const Asset& AssetManager::rootAsset() const { - return _assetLoader.rootAsset(); +void AssetManager::setUpAssetLuaTable(Asset* asset) { + // Set up Lua table: + // AssetInfo + // |- Exports (table) + // |- Asset + // | |- localResource + // | |- syncedResource + // | |- require + // | |- exists + // | |- export + // | |- onInitialize + // | |- onDeinitialize + // | |- directory + // |- Dependants (table) + // + // where Dependency is a table: + // Dependency + // |- onInitialize + // |- onDeinitialize + + const int top = lua_gettop(*_luaState); + + // Push the global table of AssetInfos + lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); + const int globalTableIndex = lua_gettop(*_luaState); + + // Create a AssetInfo table for the current asset + lua_newtable(*_luaState); + const int assetInfoTableIndex = lua_gettop(*_luaState); + + // Register empty Exports table for the current asset + // (string => exported object) + lua_newtable(*_luaState); + lua_setfield(*_luaState, assetInfoTableIndex, ExportsTableName); + + // Create Asset table + // (string => Lua functions) + lua_newtable(*_luaState); + const int assetTableIndex = lua_gettop(*_luaState); + + // Register local resource function + // string localResource(string path) + ghoul::lua::push(*_luaState, asset); + lua_pushcclosure( + *_luaState, + [](lua_State* L) { + ZoneScoped + + Asset* asset = ghoul::lua::userData(L, 1); + ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::localResourceLua"); + + std::string name = ghoul::lua::value(L); + std::filesystem::path path = asset->path().parent_path() / name; + ghoul::lua::push(L, path); + return 1; + }, + 1 + ); + lua_setfield(*_luaState, assetTableIndex, "localResource"); + + // Register synced resource function + // string syncedResource(table) + ghoul::lua::push(*_luaState, this, asset); + lua_pushcclosure( + *_luaState, + [](lua_State* L) { + ZoneScoped + + AssetManager* manager = ghoul::lua::userData(L, 1); + Asset* asset = ghoul::lua::userData(L, 2); + ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::syncedResourceLua"); + ghoul::Dictionary d = ghoul::lua::value(L); + + std::string uid = ResourceSynchronization::generateUid(d); + SyncItem* syncItem = nullptr; + auto it = manager->_synchronizations.find(uid); + if (it == manager->_synchronizations.end()) { + std::unique_ptr s = + ResourceSynchronization::createFromDictionary(d); + + std::unique_ptr si = std::make_unique(); + si->synchronization = std::move(s); + si->assets.push_back(asset); + syncItem = si.get(); + manager->_synchronizations[uid] = std::move(si); + } + else { + syncItem = it->second.get(); + syncItem->assets.push_back(asset); + } + + if (!syncItem->synchronization->isResolved()) { + manager->_unfinishedSynchronizations.push_back(syncItem); + } + + asset->addSynchronization(syncItem->synchronization.get()); + ghoul::lua::push(L, syncItem->synchronization->directory()); + return 1; + }, + 2 + ); + lua_setfield(*_luaState, assetTableIndex, "syncedResource"); + + // Register require function + // Asset require(string path) + ghoul::lua::push(*_luaState, this, asset); + lua_pushcclosure( + *_luaState, + [](lua_State* L) { + ZoneScoped + + AssetManager* manager = ghoul::lua::userData(L, 1); + Asset* parent = ghoul::lua::userData(L, 2); + + ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::require"); + std::string assetName = ghoul::lua::value(L); + + std::filesystem::path path = manager->generateAssetPath( + parent->path().parent_path(), + assetName + ); + Asset* dependency = manager->retrieveAsset(path); + if (!dependency) { + return ghoul::lua::luaError( + L, + fmt::format("Asset '{}' not found", assetName) + ); + } + // this = parent ; child = dependency + if (parent->isLoaded()) { + return ghoul::lua::luaError( + L, + "Cannot require child asset when already loaded" + ); + + } + + if (dependency->isFailed()) { + return 0; + } + + dependency->load(parent); + if (dependency->isLoaded()) { + if (parent->isSynchronized()) { + dependency->startSynchronizations(); + } + parent->require(dependency); + } + + // Get the exports table + lua_rawgeti(L, LUA_REGISTRYINDEX, manager->_assetsTableRef); + std::string p = dependency->path().string(); + lua_getfield(L, -1, p.c_str()); + lua_getfield(L, -1, ExportsTableName); + return 1; + }, + 2 + ); + lua_setfield(*_luaState, assetTableIndex, "require"); + + // Register exists function + // bool exists(string path) + ghoul::lua::push(*_luaState, this, asset); + lua_pushcclosure( + *_luaState, + [](lua_State* L) { + ZoneScoped + + AssetManager* manager = ghoul::lua::userData(L, 1); + Asset* asset = ghoul::lua::userData(L, 2); + ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::exists"); + const std::string name = ghoul::lua::value(L); + + std::filesystem::path path = manager->generateAssetPath( + asset->path().parent_path(), + name + ); + + ghoul::lua::push(L, std::filesystem::is_regular_file(path)); + return 1; + }, + 2 + ); + lua_setfield(*_luaState, assetTableIndex, "exists"); + + // Register export-dependency function + // export(string key, any value) + ghoul::lua::push(*_luaState, this, asset); + lua_pushcclosure( + *_luaState, + [](lua_State* L) { + ZoneScoped + + AssetManager* manager = ghoul::lua::userData(L, 1); + Asset* asset = ghoul::lua::userData(L, 2); + ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::exportAsset"); + + const std::string exportName = ghoul::lua::value( + L, + 1, + ghoul::lua::PopValue::No + ); + + lua_rawgeti(L, LUA_REGISTRYINDEX, manager->_assetsTableRef); + std::string path = asset->path().string(); + lua_getfield(L, -1, path.c_str()); + lua_getfield(L, -1, ExportsTableName); + const int exportsTableIndex = lua_gettop(L); + + // push the second argument + lua_pushvalue(L, 2); + lua_setfield(L, exportsTableIndex, exportName.c_str()); + + lua_settop(L, 0); + return 0; + }, + 2 + ); + lua_setfield(*_luaState, assetTableIndex, "export"); + + // Register onInitialize function to be called upon asset initialization + // void onInitialize(function initializationFunction) + ghoul::lua::push(*_luaState, this, asset); + lua_pushcclosure( + *_luaState, + [](lua_State* L) { + ZoneScoped + + AssetManager* manager = ghoul::lua::userData(L, 1); + Asset* asset = ghoul::lua::userData(L, 2); + ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::onInitialize"); + + const int referenceIndex = luaL_ref(L, LUA_REGISTRYINDEX); + manager->_onInitializeFunctionRefs[asset].push_back(referenceIndex); + + lua_settop(L, 0); + return 0; + }, + 2 + ); + lua_setfield(*_luaState, assetTableIndex, "onInitialize"); + + // Register onDeinitialize function to be called upon asset deinitialization + // void onDeinitialize(function deinitializationFunction) + ghoul::lua::push(*_luaState, this, asset); + lua_pushcclosure( + *_luaState, + [](lua_State* L) { + ZoneScoped + + AssetManager* manager = ghoul::lua::userData(L, 1); + Asset* asset = ghoul::lua::userData(L, 2); + ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::onDeinitialize"); + + const int referenceIndex = luaL_ref(L, LUA_REGISTRYINDEX); + manager->_onDeinitializeFunctionRefs[asset].push_back(referenceIndex); + + lua_settop(L, 0); + return 0; + }, + 2 + ); + lua_setfield(*_luaState, assetTableIndex, "onDeinitialize"); + + // Register directory constant + // string directory + ghoul::lua::push(*_luaState, asset->path().parent_path()); + lua_setfield(*_luaState, assetTableIndex, "directory"); + + // Register filePath constant + // string filePath + ghoul::lua::push(*_luaState, asset->path()); + lua_setfield(*_luaState, assetTableIndex, "filePath"); + + // Attach Asset table to AssetInfo table + lua_setfield(*_luaState, assetInfoTableIndex, AssetTableName); + + // Extend global asset info table (pushed to the Lua stack earlier) + // with this AssetInfo table + std::string path = asset->path().string(); + lua_setfield(*_luaState, globalTableIndex, path.c_str()); + lua_settop(*_luaState, top); } -Asset& AssetManager::rootAsset() { - return _assetLoader.rootAsset(); +Asset* AssetManager::retrieveAsset(const std::filesystem::path& path) { + // Check if asset is already loaded + const auto it = std::find_if( + _assets.begin(), + _assets.end(), + [&path](const std::unique_ptr& asset) { return asset->path() == path; } + ); + if (it != _assets.end()) { + return it->get(); + } + + std::unique_ptr asset = std::make_unique(*this, path); + Asset* res = asset.get(); + + setUpAssetLuaTable(res); + _assets.push_back(std::move(asset)); + return res; +} + +void AssetManager::callOnInitialize(Asset* asset) const { + ZoneScoped + ghoul_precondition(asset, "Asset must not be nullptr"); + + auto it = _onInitializeFunctionRefs.find(asset); + if (it == _onInitializeFunctionRefs.end()) { + return; + } + + for (int init : it->second) { + lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, init); + if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { + throw ghoul::lua::LuaRuntimeException(fmt::format( + "When initializing {}: {}", + asset->path(), + ghoul::lua::value(*_luaState, -1) + )); + } + // Clean up the stack, in case the pcall left anything there + lua_settop(*_luaState, 0); + } +} + +void AssetManager::callOnDeinitialize(Asset* asset) const { + ZoneScoped + ghoul_precondition(asset, "Asset must not be nullptr"); + + auto it = _onDeinitializeFunctionRefs.find(asset); + if (it == _onDeinitializeFunctionRefs.end()) { + return; + } + + for (int deinit : it->second) { + lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, deinit); + if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { + throw ghoul::lua::LuaRuntimeException(fmt::format( + "When deinitializing {}: {}", + asset->path(), + ghoul::lua::value(*_luaState, -1) + )); + } + // Clean up stack, in case the pcall left anything there + lua_settop(*_luaState, 0); + } +} + +void AssetManager::setCurrentAsset(Asset* asset) { + const int top = lua_gettop(*_luaState); + + if (asset == nullptr) { + ghoul::lua::push(*_luaState, ghoul::lua::nil_t()); + lua_setglobal(*_luaState, AssetGlobalVariableName); + lua_settop(*_luaState, top); + } + else { + // Set `asset` lua global to point to the current asset table + lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, _assetsTableRef); + std::string path = asset->path().string(); + lua_getfield(*_luaState, -1, path.c_str()); + lua_getfield(*_luaState, -1, AssetTableName); + lua_setglobal(*_luaState, AssetGlobalVariableName); + lua_settop(*_luaState, top); + } +} + +std::filesystem::path AssetManager::generateAssetPath( + const std::filesystem::path& baseDirectory, + const std::string& assetPath) const +{ + // Support paths that are + // 1) Relative to baseDirectory (./* or ../*) + // 3) Absolute paths (*:/* or /*) + // 2) Relative to the global asset root (*) + + PathType pathType = classifyPath(assetPath); + std::string prefix; + if (pathType == PathType::RelativeToAsset) { + prefix = baseDirectory.string() + '/'; + } + else if (pathType == PathType::RelativeToAssetRoot) { + prefix = _assetRootDirectory.string() + '/'; + } + // We treat the Absolute and the Tokenized paths the same here since they will + // behave the same when passed into the `absPath` function + + // Construct the full path including the .asset extension + std::string fullAssetPath = prefix + assetPath; + if (std::filesystem::path(assetPath).extension() != ".asset") { + fullAssetPath += ".asset"; + } + + // We don't check whether the file exists here as the error will be more + // comprehensively logged by Lua either way + return absPath(fullAssetPath); } scripting::LuaLibrary AssetManager::luaLibrary() { @@ -135,13 +808,16 @@ scripting::LuaLibrary AssetManager::luaLibrary() { "add", &luascriptfunctions::asset::add, "string", - "" + "Adds an asset to the current scene. The parameter passed into this " + "function is the path to the file that should be loaded" }, { "remove", &luascriptfunctions::asset::remove, "string", - "" + "Removes the asset with the specfied name from the scene. The parameter " + "to this function is the same that was originally used to load this " + "asset, i.e. the path to the asset file" } } }; diff --git a/src/scene/assetmanager_lua.inl b/src/scene/assetmanager_lua.inl index 0c8834af9c..f1f967af75 100644 --- a/src/scene/assetmanager_lua.inl +++ b/src/scene/assetmanager_lua.inl @@ -23,44 +23,22 @@ ****************************************************************************************/ #include -#include #include +#include namespace openspace::luascriptfunctions::asset { int add(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::add"); - - AssetManager& assetManager = global::openSpaceEngine->assetManager(); const std::string assetName = ghoul::lua::value(L); - - if (global::renderEngine->scene()) { - assetManager.add(assetName); - } - else { - // The scene might not exist yet if OpenSpace was started without specifying an - // initial asset - global::openSpaceEngine->scheduleLoadSingleAsset(assetName); - } - + global::openSpaceEngine->assetManager().add(assetName); return 0; } int remove(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::remove"); - - AssetManager& assetManager = global::openSpaceEngine->assetManager(); const std::string assetName = ghoul::lua::value(L); - - assetManager.remove(assetName); - return 0; -} - -int removeAll(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::removeAll"); - - AssetManager& assetManager = global::openSpaceEngine->assetManager(); - assetManager.removeAll(); + global::openSpaceEngine->assetManager().remove(assetName); return 0; } diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 5cf74e1ccf..dad5276cb5 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -853,13 +853,6 @@ scripting::LuaLibrary Scene::luaLibrary() { "Returns a list of property identifiers that match the passed regular " "expression" }, - { - "loadScene", - &luascriptfunctions::loadScene, - "string", - "Loads the scene found at the file passed as an " - "argument. If a scene is already loaded, it is unloaded first" - }, { "addSceneGraphNode", &luascriptfunctions::addSceneGraphNode, diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index 384dd85da2..c000bdac05 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -591,14 +591,6 @@ int property_getProperty(lua_State* L) { return 1; } -int loadScene(lua_State* L) { - ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::loadScene"); - std::string sceneFile = ghoul::lua::value(L); - - global::openSpaceEngine->scheduleLoadSingleAsset(std::move(sceneFile)); - return 0; -} - int addSceneGraphNode(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::addSceneGraphNode"); const ghoul::Dictionary d = ghoul::lua::value(L); diff --git a/src/scene/scenelicensewriter.cpp b/src/scene/scenelicensewriter.cpp index e9eba3ce1a..2ea8f345fd 100644 --- a/src/scene/scenelicensewriter.cpp +++ b/src/scene/scenelicensewriter.cpp @@ -53,7 +53,7 @@ std::string SceneLicenseWriter::generateJson() const { json << "["; std::vector assets = - global::openSpaceEngine->assetManager().rootAsset().subTreeAssets(); + global::openSpaceEngine->assetManager().allAssets(); int metaTotal = 0; int metaCount = 0; @@ -121,7 +121,7 @@ std::string SceneLicenseWriter::generateJson() const { //json << fmt::format(replStr2, "licenseText", escapedJson(license.licenseText)); json << fmt::format(replStr, "license", escapedJson(meta->license)); json << fmt::format(replStr, "identifiers", escapedJson(meta->identifiers)); - json << fmt::format(replStr2, "path", escapedJson(asset->assetFilePath())); + json << fmt::format(replStr2, "path", escapedJson(asset->path().string())); json << "}"; metaCount++; diff --git a/src/util/httprequest.cpp b/src/util/httprequest.cpp index 76f56c3cb4..a82118e0c7 100644 --- a/src/util/httprequest.cpp +++ b/src/util/httprequest.cpp @@ -28,67 +28,15 @@ #include #include #include -#include - -#ifdef OPENSPACE_CURL_ENABLED -#ifdef WIN32 -#pragma warning (push) -#pragma warning (disable: 4574) // 'INCL_WINSOCK_API_TYPEDEFS' is defined to be '0' -#endif // WIN32 - #include - -#ifdef WIN32 -#pragma warning (pop) -#endif // WIN32 -#endif - -namespace { - constexpr const long StatusCodeOk = 200; - constexpr const char* _loggerCat = "HttpRequest"; -} // namespace +#include namespace openspace { -namespace curlfunctions { - -size_t headerCallback(char* ptr, size_t size, size_t nmemb, void* userData) { - HttpRequest* r = reinterpret_cast(userData); - size_t nBytes = r->_onHeader(HttpRequest::Header{ptr, size * nmemb}); - r->setReadyState(HttpRequest::ReadyState::ReceivedHeader); - return nBytes; -} - -int progressCallback(void* userData, int64_t nTotalDownloadBytes, - int64_t nDownloadedBytes, int64_t, int64_t) -{ - HttpRequest* r = reinterpret_cast(userData); - return r->_onProgress( - HttpRequest::Progress{ - nTotalDownloadBytes > 0, - static_cast(nTotalDownloadBytes), - static_cast(nDownloadedBytes) - } - ); -} - -size_t writeCallback(char* ptr, size_t size, size_t nmemb, void* userData) { - HttpRequest* r = reinterpret_cast(userData); - return r->_onData(HttpRequest::Data{ptr, size * nmemb}); -} - -} // namespace curlfunctions - HttpRequest::HttpRequest(std::string url) : _url(std::move(url)) - , _onReadyStateChange([](ReadyState) {}) - , _onProgress([](Progress) { return 0; }) - , _onData([](Data d) { return d.size; }) - , _onHeader([](Header h) { return h.size; }) -{} - -void HttpRequest::onReadyStateChange(ReadyStateChangeCallback cb) { - _onReadyStateChange = std::move(cb); +{ + ghoul_assert(!_url.empty(), "url must not be empty"); } void HttpRequest::onProgress(ProgressCallback cb) { @@ -103,367 +51,324 @@ void HttpRequest::onHeader(HeaderCallback cb) { _onHeader = std::move(cb); } -void HttpRequest::perform(RequestOptions opt) { - setReadyState(ReadyState::Loading); - +bool HttpRequest::perform(std::chrono::milliseconds timeout) { CURL* curl = curl_easy_init(); if (!curl) { - setReadyState(ReadyState::Fail); - return; + return false; } - curl_easy_setopt(curl, CURLOPT_URL, _url.c_str()); // NOLINT - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); // NOLINT + curl_easy_setopt(curl, CURLOPT_URL, _url.data()); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); - curl_easy_setopt(curl, CURLOPT_HEADERDATA, this); // NOLINT - // NOLINTNEXTLINE - curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curlfunctions::headerCallback); + // The leading + in all of the lambda expressions are to cause an implicit conversion + // to a standard C function pointer. Since the `curl_easy_setopt` function just takes + // anything as an argument, passing the standard lambda-created anonoymous struct + // causes crashes while using it if the + is not there - curl_easy_setopt(curl, CURLOPT_WRITEDATA, this); // NOLINT - // NOLINTNEXTLINE - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlfunctions::writeCallback); + curl_easy_setopt(curl, CURLOPT_HEADERDATA, this); + curl_easy_setopt( + curl, + CURLOPT_HEADERFUNCTION, + +[](char* ptr, size_t size, size_t nmemb, void* userData) { + HttpRequest* r = reinterpret_cast(userData); + bool shouldContinue = r->_onHeader ? r->_onHeader(ptr, size * nmemb) : true; + return shouldContinue ? size * nmemb : 0; + } + ); - curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); // NOLINT - #if LIBCURL_VERSION_NUM >= 0x072000 - // xferinfo was introduced in 7.32.0, if a lower curl version is used the progress - // will not be shown for downloads on the splash screen - curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this); // NOLINT - // NOLINTNEXTLINE - curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, curlfunctions::progressCallback); - #endif + curl_easy_setopt(curl, CURLOPT_WRITEDATA, this); + curl_easy_setopt( + curl, + CURLOPT_WRITEFUNCTION, + +[](char* ptr, size_t size, size_t nmemb, void* userData) { + HttpRequest* r = reinterpret_cast(userData); + bool shouldContinue = r->_onData ? r->_onData(ptr, size * nmemb) : true; + return shouldContinue ? size * nmemb : 0; + } + ); - if (opt.requestTimeoutSeconds > 0) { - curl_easy_setopt(curl, CURLOPT_TIMEOUT, opt.requestTimeoutSeconds); // NOLINT - } + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this); + curl_easy_setopt( + curl, + CURLOPT_XFERINFOFUNCTION, + +[](void* userData, int64_t nTotalDownloadBytes, int64_t nDownloadedBytes, + int64_t, int64_t) + { + HttpRequest* r = reinterpret_cast(userData); + + std::optional totalBytes; + if (nTotalDownloadBytes > 0) { + totalBytes = nTotalDownloadBytes; + } + + bool shouldContinue = r->_onProgress ? + r->_onProgress(nDownloadedBytes, totalBytes) : + true; + return shouldContinue ? 0 : 1; + } + ); + + curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, static_cast(timeout.count())); CURLcode res = curl_easy_perform(curl); + bool success = false; if (res == CURLE_OK) { long responseCode; - curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &responseCode); // NOLINT - if (responseCode == StatusCodeOk) { - setReadyState(ReadyState::Success); + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &responseCode); + + if (responseCode >= 400) { + LERRORC( + "HttpRequest", + fmt::format("Failed download {} with code {}", _url, responseCode) + ); + success = false; } else { - setReadyState(ReadyState::Fail); + success = true; } } else { - setReadyState(ReadyState::Fail); + LERRORC( + "HttpRequest", + fmt::format( + "Failed download {} with error {}", _url, curl_easy_strerror(res) + ) + ); } curl_easy_cleanup(curl); -} - -void HttpRequest::setReadyState(openspace::HttpRequest::ReadyState state) { - _readyState = state; - _onReadyStateChange(state); + return success; } const std::string& HttpRequest::url() const { return _url; } -HttpDownload::HttpDownload() : _onProgress([](HttpRequest::Progress) { return true; }) {} -void HttpDownload::onProgress(ProgressCallback progressCallback) { + + +HttpDownload::HttpDownload(std::string url) + : _httpRequest(std::move(url)) +{ + _httpRequest.onData([this](char* buffer, size_t size) { + return handleData(buffer, size) && !_shouldCancel; + }); + + _httpRequest.onProgress( + [this](int64_t downloadedBytes, std::optional totalBytes) { + bool cont = _onProgress ? _onProgress(downloadedBytes, totalBytes) : true; + return cont && !_shouldCancel; + } + ); +} + +HttpDownload::~HttpDownload() { + cancel(); + wait(); +} + +void HttpDownload::onProgress(HttpRequest::ProgressCallback progressCallback) { _onProgress = std::move(progressCallback); } -bool HttpDownload::hasStarted() const { - return _started; -} - bool HttpDownload::hasFailed() const { - return _failed; + return _isFinished && !_isSuccessful; } bool HttpDownload::hasSucceeded() const { - return _successful; + return _isFinished && _isSuccessful; } -void HttpDownload::markAsStarted() { - _started = true; -} - -void HttpDownload::markAsFailed() { - _failed = true; -} - -void HttpDownload::markAsSuccessful() { - _successful = true; -} - -bool HttpDownload::callOnProgress(HttpRequest::Progress p) { - return _onProgress(p); -} - -SyncHttpDownload::SyncHttpDownload(std::string url) : _httpRequest(std::move(url)) {} - -void SyncHttpDownload::download(HttpRequest::RequestOptions opt) { - LTRACE(fmt::format("Start sync download '{}'", _httpRequest.url())); - - if (!initDownload()) { - LERROR(fmt::format("Failed sync download '{}'", _httpRequest.url())); - deinitDownload(); - markAsFailed(); +void HttpDownload::start(std::chrono::milliseconds timeout) { + if (_isDownloading) { return; } - _httpRequest.onData([this] (HttpRequest::Data d) { - return handleData(d); - }); - _httpRequest.onProgress([this](HttpRequest::Progress p) { - // Return a non-zero value to cancel download - // if onProgress returns false. - return callOnProgress(p) ? 0 : 1; - }); - _httpRequest.onReadyStateChange([this](HttpRequest::ReadyState rs) { - if (rs == HttpRequest::ReadyState::Success) { - LTRACE(fmt::format("Finished sync download '{}'", _httpRequest.url())); - deinitDownload(); - markAsSuccessful(); + _isDownloading = true; + _downloadThread = std::thread([this, timeout]() { + _isFinished = false; + LTRACEC("HttpDownload", fmt::format("Start download '{}'", _httpRequest.url())); + + const bool setupSuccess = setup(); + if (setupSuccess) { + _isSuccessful = _httpRequest.perform(timeout); + + const bool teardownSuccess = teardown(); + _isSuccessful = _isSuccessful && teardownSuccess; } - else if (rs == HttpRequest::ReadyState::Fail) { - LERROR(fmt::format("Failed sync download '{}'", _httpRequest.url())); - deinitDownload(); - markAsFailed(); + else { + _isSuccessful = false; } - }); - _httpRequest.perform(opt); - LTRACE(fmt::format("End sync download '{}'", _httpRequest.url())); -} - -const std::string& SyncHttpDownload::url() const { - return _httpRequest.url(); -} - -AsyncHttpDownload::AsyncHttpDownload(std::string url) : _httpRequest(std::move(url)) {} - -AsyncHttpDownload::AsyncHttpDownload(AsyncHttpDownload&& d) - : _httpRequest(std::move(d._httpRequest)) - , _downloadThread(std::move(d._downloadThread)) - , _shouldCancel(std::move(d._shouldCancel)) -{} - -void AsyncHttpDownload::start(HttpRequest::RequestOptions opt) { - std::lock_guard guard(_stateChangeMutex); - if (hasStarted()) { - return; - } - markAsStarted(); - _downloadThread = std::thread([this, opt] { - try { - download(opt); + _isFinished = true; + if (_isSuccessful) { + LTRACEC( + "HttpDownload", + fmt::format("Finished async download '{}'", _httpRequest.url()) + ); } - catch (const ghoul::RuntimeError& e) { - LERRORC(e.component, e.message); + else { + LTRACEC( + "HttpDownload", + fmt::format("Failed async download '{}'", _httpRequest.url()) + ); } + + _downloadFinishCondition.notify_all(); + _isDownloading = false; }); } -void AsyncHttpDownload::cancel() { +void HttpDownload::cancel() { _shouldCancel = true; } -void AsyncHttpDownload::wait() { - std::unique_lock lock(_conditionMutex); - _downloadFinishCondition.wait(lock, [this] { - return hasFailed() || hasSucceeded(); - }); +bool HttpDownload::wait() { + std::mutex conditionMutex; + std::unique_lock lock(conditionMutex); + _downloadFinishCondition.wait(lock, [this]() { return _isFinished; }); if (_downloadThread.joinable()) { _downloadThread.join(); } + return _isSuccessful; } -void AsyncHttpDownload::download(HttpRequest::RequestOptions opt) { - LTRACE(fmt::format("Start async download '{}'", _httpRequest.url())); - - initDownload(); - - _httpRequest.onData([this](HttpRequest::Data d) { - return handleData(d); - }); - - _httpRequest.onProgress([this](HttpRequest::Progress p) { - // Return a non-zero value to cancel download - // if onProgress returns false. - //std::lock_guard guard(_mutex); - const bool shouldContinue = callOnProgress(p); - if (!shouldContinue) { - return 1; - } - if (_shouldCancel) { - return 1; - } - return 0; - }); - - _httpRequest.onReadyStateChange([this](HttpRequest::ReadyState rs) { - if (rs == HttpRequest::ReadyState::Success) { - LTRACE(fmt::format("Finished async download '{}'", _httpRequest.url())); - deinitDownload(); - markAsSuccessful(); - } - else if (rs == HttpRequest::ReadyState::Fail) { - LTRACE(fmt::format("Failed async download '{}'", _httpRequest.url())); - deinitDownload(); - markAsFailed(); - } - }); - - _httpRequest.perform(opt); - if (!hasSucceeded()) { - deinitDownload(); - markAsFailed(); - } - - LTRACE(fmt::format("End async download '{}'", _httpRequest.url())); - - _downloadFinishCondition.notify_all(); -} - -const std::string& AsyncHttpDownload::url() const { +const std::string& HttpDownload::url() const { return _httpRequest.url(); } -const std::vector& HttpMemoryDownload::downloadedData() const { - return _downloadedData; -} - -bool HttpMemoryDownload::initDownload() { +bool HttpDownload::setup() { return true; } -bool HttpMemoryDownload::deinitDownload() { +bool HttpDownload::teardown() { return true; } -size_t HttpMemoryDownload::handleData(HttpRequest::Data d) { - _downloadedData.insert(_downloadedData.end(), d.buffer, d.buffer + d.size); - return d.size; -} -HttpFileDownload::HttpFileDownload(std::string destination, - HttpFileDownload::Overwrite overwrite) - : _destination(std::move(destination)) - , _overwrite(overwrite) -{} -bool HttpFileDownload::initDownload() { - if (!_overwrite && std::filesystem::is_regular_file(_destination)) { - LWARNING(fmt::format("File {} already exists", _destination)); - return false; +std::atomic_int HttpFileDownload::nCurrentFileHandles = 0; +std::mutex HttpFileDownload::_directoryCreationMutex; + +HttpFileDownload::HttpFileDownload(std::string url, std::filesystem::path destination, + Overwrite overwrite) + : HttpDownload(std::move(url)) + , _destination(std::move(destination)) +{ + if (!overwrite && std::filesystem::is_regular_file(_destination)) { + throw ghoul::RuntimeError(fmt::format("File {} already exists", _destination)); } +} - std::filesystem::path d = std::filesystem::path(_destination).parent_path(); - +bool HttpFileDownload::setup() { { std::lock_guard g(_directoryCreationMutex); + std::filesystem::path d = _destination.parent_path(); if (!std::filesystem::is_directory(d)) { std::filesystem::create_directories(d); } } - while (nCurrentFilehandles >= MaxFilehandles) { - std::this_thread::sleep_for(std::chrono::milliseconds(500)); + while (nCurrentFileHandles >= MaxFileHandles) { + std::this_thread::sleep_for(std::chrono::milliseconds(50)); } - ++nCurrentFilehandles; + nCurrentFileHandles++; _hasHandle = true; _file = std::ofstream(_destination, std::ofstream::binary); - if (_file.fail()) { -#ifdef WIN32 - // GetLastError() gives more details than errno. - DWORD errorId = GetLastError(); - if (errorId != 0) { - char Buffer[256]; - size_t size = FormatMessageA( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - nullptr, - errorId, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - Buffer, - 256, - nullptr - ); - - std::string message(Buffer, size); - - LERROR(fmt::format( - "Cannot open file {}: {}", _destination, message) - ); - - return false; - } - else { - LERROR(fmt::format("Cannot open file {}", _destination)); - return false; - } -#else - if (errno) { -#if defined(__unix__) - char buffer[255]; - LERROR(fmt::format( - "Cannot open file '{}': {}", - _destination, - std::string(strerror_r(errno, buffer, sizeof(buffer))) - )); - return false; -#else - LERROR(fmt::format( - "Cannot open file '{}': {}", _destination, std::string(strerror(errno)) - )); - return false; -#endif - } - - LERROR(fmt::format("Cannot open file {}", _destination)); - return false; -#endif + if (_file.good()) { + return true; } - return true; + + +#ifdef WIN32 + // GetLastError() gives more details than errno. + DWORD errorId = GetLastError(); + if (errorId == 0) { + LERRORC("HttpFileDownload", fmt::format("Cannot open file {}", _destination)); + return false; + } + std::array Buffer; + size_t size = FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, + errorId, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + Buffer.data(), + static_cast(Buffer.size()), + nullptr + ); + + std::string message(Buffer.data(), size); + LERRORC( + "HttpFileDownload", + fmt::format("Cannot open file {}: {}", _destination, message) + ); + return false; +#else // ^^^ WIN32 / !WIN32 vvv + if (errno) { +#ifdef __unix__ + char buffer[256]; + LERRORC( + "HttpFileDownload", + fmt::format( + "Cannot open file '{}': {}", + _destination, std::string(strerror_r(errno, buffer, sizeof(buffer))) + ) + ); + return false; +#else // ^^^ __unix__ / !__unix__ vvv + LERRORC( + "HttpFileDownload", + fmt::format( + "Cannot open file '{}': {}", _destination, std::string(strerror(errno)) + ) + ); + return false; +#endif // __unix__ + } + + LERRORC("HttpFileDownload", fmt::format("Cannot open file {}", _destination)); + return false; +#endif // WIN32 } -const std::string& HttpFileDownload::destination() const { +std::filesystem::path HttpFileDownload::destination() const { return _destination; } -bool HttpFileDownload::deinitDownload() { +bool HttpFileDownload::teardown() { if (_hasHandle) { _hasHandle = false; _file.close(); - --nCurrentFilehandles; + nCurrentFileHandles--; + ghoul_assert(nCurrentFileHandles >= 0, "More handles returned than taken out"); + return _file.good(); } + else { + return true; + } +} + +bool HttpFileDownload::handleData(char* buffer, size_t size) { + _file.write(buffer, size); return _file.good(); } -size_t HttpFileDownload::handleData(HttpRequest::Data d) { - _file.write(d.buffer, d.size); - return d.size; + + +HttpMemoryDownload::HttpMemoryDownload(std::string url) + : HttpDownload(std::move(url)) +{} + +const std::vector& HttpMemoryDownload::downloadedData() const { + return _buffer; } -std::atomic_int HttpFileDownload::nCurrentFilehandles(0); -std::mutex HttpFileDownload::_directoryCreationMutex; - -SyncHttpMemoryDownload::SyncHttpMemoryDownload(std::string url) - : SyncHttpDownload(std::move(url)) -{} - -SyncHttpFileDownload::SyncHttpFileDownload(std::string url, std::string destinationPath, - HttpFileDownload::Overwrite overwrite) - : SyncHttpDownload(std::move(url)) - , HttpFileDownload(std::move(destinationPath), overwrite) -{} - -AsyncHttpMemoryDownload::AsyncHttpMemoryDownload(std::string url) - : AsyncHttpDownload(std::move(url)) -{} - -AsyncHttpFileDownload::AsyncHttpFileDownload(std::string url, std::string destinationPath, - HttpFileDownload::Overwrite overwrite) - : AsyncHttpDownload(std::move(url)) - , HttpFileDownload(std::move(destinationPath), overwrite) -{} +bool HttpMemoryDownload::handleData(char* buffer, size_t size) { + _buffer.insert(_buffer.end(), buffer, buffer + size); + return true; +} } // namespace openspace diff --git a/src/util/resourcesynchronization.cpp b/src/util/resourcesynchronization.cpp index 06948ff505..2d38875431 100644 --- a/src/util/resourcesynchronization.cpp +++ b/src/util/resourcesynchronization.cpp @@ -28,6 +28,7 @@ #include #include #include +#include namespace { struct [[codegen::Dictionary(ResourceSynchronization)]] Parameters { @@ -38,6 +39,10 @@ namespace { std::string type [[codegen::annotation("A ResourceSynchronization created by a factory")]]; + // A unique identifier that is used to reference this specific + // ResourceSynchronization object + std::string identifier; + // A user readable name of this synchronization std::string name; }; @@ -58,16 +63,21 @@ std::unique_ptr ResourceSynchronization::createFromDict auto factory = FactoryManager::ref().factory(); ghoul_assert(factory, "ResourceSynchronization factory did not exist"); ResourceSynchronization* sync = factory->create(p.type, dictionary); + sync->_identifier = p.identifier; sync->_name = p.name; return std::unique_ptr(sync); } -ResourceSynchronization::ResourceSynchronization(const ghoul::Dictionary&) {} - -ResourceSynchronization::State ResourceSynchronization::state() const { - return _state; +std::string ResourceSynchronization::generateUid(const ghoul::Dictionary& dictionary) { + const Parameters p = codegen::bake(dictionary); + return fmt::format("{}/{}", p.type, p.identifier); } +ResourceSynchronization::ResourceSynchronization( + std::filesystem::path synchronizationRoot) + : _synchronizationRoot(std::move(synchronizationRoot)) +{} + bool ResourceSynchronization::isResolved() const { return _state == State::Resolved; } @@ -80,65 +90,41 @@ bool ResourceSynchronization::isSyncing() const { return _state == State::Syncing; } -ResourceSynchronization::CallbackHandle -ResourceSynchronization::addStateChangeCallback(StateChangeCallback cb) -{ - std::lock_guard guard(_callbackMutex); - CallbackHandle callbackId = _nextCallbackId++; - _stateChangeCallbacks[callbackId] = std::move(cb); - return callbackId; +size_t ResourceSynchronization::nSynchronizedBytes() const { + return _nSynchronizedBytes; } -void ResourceSynchronization::removeStateChangeCallback(CallbackHandle id) { - std::lock_guard guard(_callbackMutex); - _stateChangeCallbacks.erase(id); +size_t ResourceSynchronization::nTotalBytes() const { + return _nTotalBytes; } -void ResourceSynchronization::resolve() { - setState(State::Resolved); +bool ResourceSynchronization::nTotalBytesIsKnown() const { + return _nTotalBytesKnown; } -void ResourceSynchronization::reject() { - setState(State::Rejected); -} - -void ResourceSynchronization::reset() { - setState(State::Unsynced); -} - -void ResourceSynchronization::begin() { - setState(State::Syncing); -} - -void ResourceSynchronization::setState(State state) { - _state = state; - - _callbackMutex.lock(); - std::vector callbacks; - callbacks.reserve(_stateChangeCallbacks.size()); - using K = CallbackHandle; - using V = StateChangeCallback; - for (const std::pair& it : _stateChangeCallbacks) { - callbacks.push_back(it.second); - } - _callbackMutex.unlock(); - for (const StateChangeCallback& cb : callbacks) { - cb(state); - } -} - -float ResourceSynchronization::progress() { - if (!nTotalBytesIsKnown()) { - return 0.f; - } - if (nTotalBytes() == 0) { - return 1.f; - } - return static_cast(nSynchronizedBytes()) / static_cast(nTotalBytes()); +const std::string& ResourceSynchronization::identifier() const { + return _identifier; } const std::string& ResourceSynchronization::name() const { return _name; } +void ResourceSynchronization::createSyncFile() const { + std::filesystem::path dir = directory(); + std::filesystem::create_directories(dir); + + dir.replace_extension("ossync"); + std::ofstream syncFile(dir, std::ofstream::out); + // The actual text what is written is not used anywhere, but it might be useful to + // user that wants to look at it + syncFile << "Synchronized"; +} + +bool ResourceSynchronization::hasSyncFile() const { + std::filesystem::path path = directory(); + path.replace_extension("ossync"); + return std::filesystem::is_regular_file(path); +} + } // namespace openspace diff --git a/src/util/synchronizationwatcher.cpp b/src/util/synchronizationwatcher.cpp deleted file mode 100644 index 98c724219d..0000000000 --- a/src/util/synchronizationwatcher.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2021 * - * * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this * - * software and associated documentation files (the "Software"), to deal in the Software * - * without restriction, including without limitation the rights to use, copy, modify, * - * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * - * permit persons to whom the Software is furnished to do so, subject to the following * - * conditions: * - * * - * The above copyright notice and this permission notice shall be included in all copies * - * or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * - * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - ****************************************************************************************/ - -#include - -#include -#include - -namespace openspace { - -SynchronizationWatcher::WatchHandle SynchronizationWatcher::watchSynchronization( - std::shared_ptr synchronization, - ResourceSynchronization::StateChangeCallback callback) -{ - std::lock_guard guard(_mutex); - - WatchHandle watchHandle = nextWatchHandle++; - - ResourceSynchronization::CallbackHandle cbh = synchronization->addStateChangeCallback( - [this, synchronization, watchHandle, cb = std::move(callback)] - (ResourceSynchronization::State state) - { - std::lock_guard g(_mutex); - _pendingNotifications.push_back({ synchronization, state, watchHandle, cb }); - } - ); - - _watchedSyncs.insert({ watchHandle, { std::move(synchronization), cbh } }); - - return watchHandle; -} - -void SynchronizationWatcher::unwatchSynchronization(WatchHandle watchHandle) { - std::lock_guard guard(_mutex); - - const auto it = _watchedSyncs.find(watchHandle); - if (it == _watchedSyncs.end()) { - return; - } - - // Remove callback from syncrhonization - std::shared_ptr sync = it->second.synchronization.lock(); - if (sync) { - sync->removeStateChangeCallback(it->second.callbackHandle); - } - - // Remove from the list of watches - _watchedSyncs.erase(it); - - // Remove notifications that are pending - _pendingNotifications.erase(std::remove_if( - _pendingNotifications.begin(), - _pendingNotifications.end(), - [watchHandle](const NotificationData& data) { return data.handle == watchHandle; } - ), _pendingNotifications.end()); -} - -void SynchronizationWatcher::notify() { - ZoneScoped - - std::vector notifications; - { - std::lock_guard guard(_mutex); - notifications = _pendingNotifications; - _pendingNotifications.clear(); - } - - for (const NotificationData& n : notifications) { - ZoneScopedN("Notification") - std::shared_ptr sync = n.synchronization.lock(); - if (!sync) { - continue; - } - n.callback(n.state); - } -} - -} // namespace openspace diff --git a/src/util/versionchecker.cpp b/src/util/versionchecker.cpp index 6ee129c32e..aa9d5fcc30 100644 --- a/src/util/versionchecker.cpp +++ b/src/util/versionchecker.cpp @@ -40,9 +40,6 @@ VersionChecker::~VersionChecker() { } void VersionChecker::requestLatestVersion(const std::string& url) { - HttpRequest::RequestOptions opt; - opt.requestTimeoutSeconds = 0; - std::string fullUrl = fmt::format( "{}?client_version={}&commit_hash={}", url, OPENSPACE_VERSION_NUMBER, OPENSPACE_GIT_COMMIT @@ -54,8 +51,8 @@ void VersionChecker::requestLatestVersion(const std::string& url) { _request = nullptr; } - _request = std::make_unique(std::move(fullUrl)); - _request->start(opt); + _request = std::make_unique(std::move(fullUrl)); + _request->start(); } void VersionChecker::cancel() { diff --git a/tests/test_assetloader.cpp b/tests/test_assetloader.cpp index e5a63e8ead..96cb00a0eb 100644 --- a/tests/test_assetloader.cpp +++ b/tests/test_assetloader.cpp @@ -27,13 +27,12 @@ #include #include #include -#include +#include #include #include #include #include #include -#include #include #include #include @@ -53,10 +52,8 @@ namespace { TEST_CASE("AssetLoader: Assertion", "[assetloader]") { openspace::Scene scene(std::make_unique()); ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); - openspace::SynchronizationWatcher syncWatcher; - openspace::AssetLoader assetLoader( + openspace::AssetManager assetLoader( state, - &syncWatcher, absPath("${TESTDIR}/AssetLoaderTest/").string() ); @@ -67,10 +64,8 @@ TEST_CASE("AssetLoader: Assertion", "[assetloader]") { TEST_CASE("AssetLoader: Basic Export Import", "[assetloader]") { openspace::Scene scene(std::make_unique()); ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); - openspace::SynchronizationWatcher syncWatcher; - openspace::AssetLoader assetLoader( + openspace::AssetManager assetLoader( state, - &syncWatcher, absPath("${TESTDIR}/AssetLoaderTest/").string() ); @@ -80,32 +75,29 @@ TEST_CASE("AssetLoader: Basic Export Import", "[assetloader]") { TEST_CASE("AssetLoader: Asset Functions", "[assetloader]") { openspace::Scene scene(std::make_unique()); ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); - openspace::SynchronizationWatcher syncWatcher; - openspace::AssetLoader assetLoader( + openspace::AssetManager assetLoader( state, - &syncWatcher, absPath("${TESTDIR}/AssetLoaderTest/").string() ); REQUIRE_NOTHROW(assetLoader.add("assetfunctionsexist")); } -TEST_CASE("AssetLoader: Asset Initialization", "[assetloader]") { - openspace::Scene scene(std::make_unique()); - ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); - openspace::SynchronizationWatcher syncWatcher; - openspace::AssetLoader assetLoader( - state, - &syncWatcher, - absPath("${TESTDIR}/AssetLoaderTest/").string() - ); - - bool passed; - lua_pushlightuserdata(*state, &passed); - lua_pushcclosure(*state, &passTest, 1); - lua_setglobal(*state, "passTest"); - - std::shared_ptr asset = assetLoader.add("initialization"); - REQUIRE_NOTHROW(asset->initialize()); - REQUIRE(passed); -} +//TEST_CASE("AssetLoader: Asset Initialization", "[assetloader]") { +// openspace::Scene scene(std::make_unique()); +// ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); +// openspace::SynchronizationWatcher syncWatcher; +// openspace::AssetManager assetLoader( +// state, +// absPath("${TESTDIR}/AssetLoaderTest/").string() +// ); +// +// bool passed; +// lua_pushlightuserdata(*state, &passed); +// lua_pushcclosure(*state, &passTest, 1); +// lua_setglobal(*state, "passTest"); +// +// std::shared_ptr asset = assetLoader.add("initialization"); +// REQUIRE_NOTHROW(asset->initialize()); +// REQUIRE(passed); +//} From af1e5c8cf830beaaa4c6d59a29abe738dde5f2d0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 20 Dec 2021 22:00:36 +0100 Subject: [PATCH 029/117] Cleanup configuration helper --- apps/OpenSpace/ext/sgct | 2 +- ext/ghoul | 2 +- scripts/configuration_helper.lua | 660 ++++++++++++------------------- 3 files changed, 260 insertions(+), 404 deletions(-) diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index b4cb1b540f..d67a9bad53 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit b4cb1b540f4f52aaa2e36c8b3fdc4f918993a5fa +Subproject commit d67a9bad53948c8cb13fa954ae43941932ec1464 diff --git a/ext/ghoul b/ext/ghoul index 6dfb7965bf..251381da71 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 6dfb7965bf7d44a6d3690634daf21848b3be6df5 +Subproject commit 251381da71980942bcff5581a4c190e1e9736922 diff --git a/scripts/configuration_helper.lua b/scripts/configuration_helper.lua index 4520ae77be..7641acec74 100644 --- a/scripts/configuration_helper.lua +++ b/scripts/configuration_helper.lua @@ -75,6 +75,9 @@ function sgct.config.fisheye(arg) end -- Global variable storing the name of the config function called at initialization sgctconfiginitializeString = "" + + + --[[ ########################################################################################## Internal helper functions @@ -82,362 +85,286 @@ sgctconfiginitializeString = "" ]]-- function generateSingleViewportFOV(down, up, left, right, tracked) - return [[ -{ - "pos": { "x": 0.0, "y": 0.0 }, - "size": { "x": 1.0, "y": 1.0 }, - "tracked": ]] .. tostring(tracked) .. [[, - "projection": { - "type": "PlanarProjection", - "fov": { - "left": ]] .. left .. [[, - "right": ]] .. right .. [[, - "up": ]] .. up .. [[, - "down": ]] .. down .. [[ - }, - "orientation": { "heading": 0.0, "pitch": 0.0, "roll": 0.0 } - } -} -]] + local result = {} + + table.insert(result, [[ {]]) + + if tracked then + table.insert(result, [[ "tracked": ]] .. tostring(tracked) .. [[,]]) + end + + table.insert(result, [[ "projection": {]]) + table.insert(result, [[ "type": "PlanarProjection",]]) + table.insert(result, [[ "fov": {]]) + table.insert(result, [[ "left": ]] .. left .. [[,]]) + table.insert(result, [[ "right": ]] .. right .. [[,]]) + table.insert(result, [[ "up": ]] .. up .. [[,]]) + table.insert(result, [[ "down": ]] .. down .. [[ ]]) + table.insert(result, [[ }]]) + table.insert(result, [[ }]]) + table.insert(result, [[ }]]) + + return table.concat(result, "\n") end -function generateFisheyeViewport(fov, quality, tilt, background, crop, offset, tracked) - local background_fragment = [[ -{ - "r": ]] .. background["r"] .. [[, - "g": ]] .. background["g"] .. [[, - "b": ]] .. background["b"] .. [[, - "a": ]] .. background["a"] .. [[ -}]] +function generateFisheyeViewport(fov, quality, tilt, background, crop, offset, tracked) + local result = {} + + table.insert(result, [[ {]]) + + if tracked then + table.insert(result, [[ "tracked": ]] .. tostring(tracked) .. ",") + end + + table.insert(result, [[ "projection": {]]) + table.insert(result, [[ "type": "FisheyeProjection",]]) + + if fov then + table.insert(result, [[ "fov": ]] .. fov .. [[,]]) + end + table.insert(result, [[ "quality": "]] .. quality .. [[",]]) + table.insert(result, [[ "tilt": ]] .. tilt .. ",") -local crop_fragment = "" if crop then - crop_fragment = [[ -{ - "left": ]] .. crop["left"] .. [[, - "right": ]] .. crop["right"] .. [[, - "top": ]] .. crop["top"] .. [[, - "bottom": ]] .. crop["bottom"] .. [[ -}]] - else - crop_fragment = "{}" + table.insert(result, [[ "crop": {]]) + table.insert(result, [[ "left": ]] .. crop["left"] .. ",") + table.insert(result, [[ "right": ]] .. crop["right"] .. ",") + table.insert(result, [[ "top": ]] .. crop["top"] .. ",") + table.insert(result, [[ "bottom": ]] .. crop["bottom"]) + table.insert(result, [[ },]]) end - local offset_fragment = "" if offset then - offset_fragment = [[ -{ - "x": ]] .. offset["x"] .. [[, - "y": ]] .. offset["y"] .. [[, - "z": ]] .. offset["z"] .. [[ -}]] - else - offset_fragment = "{}" + table.insert(result, [[ "offset": {]]) + table.insert(result, [[ "x": ]] .. offset["x"] .. ",") + table.insert(result, [[ "y": ]] .. offset["y"] .. ",") + table.insert(result, [[ "z": ]] .. offset["z"]) + table.insert(result, [[ },]]) end - return [[ -{ - "pos": { "x": 0.0, "y": 0.0 }, - "size": { "x": 1.0, "y": 1.0 }, - "tracked": ]] .. tostring(tracked) .. [[, - "projection": { - "type": "FisheyeProjection", - "fov": ]] .. fov .. [[, - "quality": "]] .. quality .. [[", - "tilt": ]] .. tilt .. [[, - "background": ]] .. background_fragment .. [[, - "crop": ]] .. crop_fragment .. [[, - "offset": ]] .. offset_fragment .. [[ - } -} -]] + table.insert(result, [[ "background": {]]) + table.insert(result, [[ "r": ]] .. background["r"] .. ",") + table.insert(result, [[ "g": ]] .. background["g"] .. ",") + table.insert(result, [[ "b": ]] .. background["b"] .. ",") + table.insert(result, [[ "a": ]] .. background["a"]) + table.insert(result, [[ }]]) + table.insert(result, [[ }]]) + table.insert(result, [[ }]]) + + return table.concat(result, "\n") end -function generateWindow(arg) - local resolution_fragment = "" - if arg["res"] then - arg["res"][1] = arg["res"][1] or arg["windowSize"][1] - arg["res"][2] = arg["res"][2] or arg["windowSize"][2] +function generateWindow(result, fullScreen, msaa, border, monitor, tags, stereo, pos, + size, res, viewport) + table.insert(result, [[ "name": "OpenSpace",]]) - resolution_fragment = - [[ "res": { "x": ]] .. arg["res"][1] .. [[ "y": ]] .. arg["res"][1] .. [[},]] + if fullScreen then + table.insert(result, [[ "fullscreen": ]] .. tostring(fullScreen) .. ",") end - local tags - if arg["tags"] then - tags = table.concat(arg["tags"], ",") + if msaa then + table.insert(result, [[ "msaa": ]] .. msaa .. ",") end - return [[ -{ - "name": "OpenSpace", - "fullscreen": ]] .. tostring(arg["fullScreen"]) .. [[, - "msaa": ]] .. arg["msaa"] .. [[, - "border": ]] .. tostring(arg["border"]) .. [[, - "monitor": ]] .. arg["monitor"] .. [[, - "tags": [ ]] .. tags .. [[ ], - "stereo": "]] .. arg["stereo"] .. [[", - "size": { "x": ]] .. arg["windowSize"][1] .. [[, "y": ]] .. arg["windowSize"][2] .. [[ }, - "pos": { "x": ]] .. arg["pos"][1] .. [[, "y": ]] .. arg["pos"][2] .. [[ }, - ]] .. resolution_fragment .. [[ - "viewports": [ - ]] .. arg["viewport"] .. [[ - ] -} -]] + if border then + table.insert(result, [[ "border": ]] .. tostring(border) .. ",") + end + + if monitor then + table.insert(result, [[ "monitor": ]] .. monitor .. ",") + end + + if #(tags) > 0 then + local t = table.concat(arg["tags"], ",") + table.insert(result, [[ "tags": [ ]] .. t .. [[ ], ]]) + end + + if stereo then + table.insert(result, [[ "stereo": "]] .. stereo .. [[",]]) + end + + local px = pos[1] + local py = pos[2] + table.insert(result, [[ "pos": { "x": ]] .. px .. [[, "y": ]] .. py .. " },") + + local sx = size[1] + local sy = size[2] + table.insert(result, [[ "size": { "x": ]] .. sx .. [[, "y": ]] .. sy .. " },") + + if res then + res[1] = res[1] or size[1] + res[2] = res[2] or size[2] + table.insert(result, [[ "res": {]]) + table.insert(result, [[ "x": ]] .. res[1] .. ",") + table.insert(result, [[ "y": ]] .. res[2]) + table.insert(result, [[ },]]) + end + + table.insert(result, [[ "viewports": []]) + + table.insert(result, viewport) + table.insert(result, [[ ] ]]) end -function generateUser(arg) - return [[ -{ - "eyeSeparation": 0.06, - "pos": { "x": 0.0, "y": 0.0, "z": 0.0 } -} -]] +function generateUser(result) + table.insert(result, [[ {]]) + table.insert(result, [[ "eyeSeparation": 0.06,]]) + table.insert(result, [[ "pos": { "x": 0.0, "y": 0.0, "z": 0.0 }]]) + table.insert(result, [[ }]]) end -function generateScene(arg) - local scene = arg["scene"] - +function generateScene(result, scene) if scene == nil then - return "{}" + return nil end local offset = scene["offset"] or { x = 0.0, y = 0.0, z = 0.0 } local orientation = scene["orientation"] or { yaw = 0.0, pitch = 0.0, roll = 0.0 } local scale = scene["scale"] or 1.0 - return [[ -{ - "offset": { - "x": ]] .. offset["x"] .. [[, - "y": ]] .. offset["y"] .. [[, - "z": ]] .. offset["z"] .. [[ - }, - "orientation": { - "yaw": ]] .. orientation["yaw"] .. [[, - "pitch": ]] .. orientation["pitch"] .. [[, - "roll": ]] .. orientation["roll"] .. [[ - }, - "scale": ]] .. scale .. [[ -} -]] + table.insert(result, [[{]]) + table.insert(result, [[ "offset": {]]) + table.insert(result, [[ "x": ]] .. offset["x"] .. ",") + table.insert(result, [[ "y": ]] .. offset["y"] .. ",") + table.insert(result, [[ "z": ]] .. offset["z"] .. ",") + table.insert(result, [[ },]]) + table.insert(result, [[ "orientation": {]]) + table.insert(result, [[ "yaw": ]] .. orientation["yaw"] .. ",") + table.insert(result, [[ "pitch": ]] .. orientation["pitch"] .. ",") + table.insert(result, [[ "roll": ]] .. orientation["roll"] .. ",") + table.insert(result, [[ },]]) + table.insert(result, [[ "scale": ]] .. scale) + table.insert(result, [[}]]) end -function generateSettings(arg) - local v +function generateSettings(result, refreshRate, vsync) + table.insert(result, [[ "display": {]]) + + if (arg["refreshRate"]) then + table.insert(result, [[ "refreshRate": ]] .. arg["refreshRate"] .. ",") + end + if arg["vsync"] then - v = 1 + table.insert(result, [[ "swapInterval": 1]]) else - v = 0 + table.insert(result, [[ "swapInterval": 0]]) end - local refresh_fragment = "" - if arg["refreshRate"] then - refresh_fragment = [[ "refreshRate": ]] .. arg["refreshRate"] .. "," - end - - return [[ -{ - "display": { - ]] .. refresh_fragment .. [[ - "swapInterval": ]] .. v .. [[ - } -} -]] + table.insert(result, [[ }]]) end -function generateCluster(arg) - return [[ -{ - "version": 1, - "masterAddress": "127.0.0.1", - "debug": ]] .. tostring(arg["sgctDebug"]) .. [[, - "settings": ]] .. (arg["settings"] or "{}") .. [[, - "scene": ]] .. (arg["scene"] or "{}") .. [[, - "nodes": [ - { - "address": "127.0.0.1", - "port": 20401, - "windows": [ - ]] .. arg["window"] .. [[ - ] - } - ], - "users": [ - ]] .. arg["user"] .. [[ - ] -} -]] +function generateCluster(arg, viewport) + local result = {} + + table.insert(result, [[{]]) + table.insert(result, [[ "version": 1,]]) + table.insert(result, [[ "masterAddress": "127.0.0.1",]]) + + if arg["sgctDebug"] then + table.insert(result, [[ "debug": ]] .. tostring(arg["sgctDebug"]) .. ",") + end + + if (arg["settings"]) then + table.insert(result, [[ "settings": {]]) + generateSettings(result, arg["refreshRate"], arg["vsync"]) + table.insert(result, [[ },]]) + end + + if arg["scene"] then + table.insert(result, [[ "scene": {]]) + generateScene(result, arg["scene"]) + table.insert(result, [[ },]]) + end + + table.insert(result, [[ "nodes": []]) + table.insert(result, [[ {]]) + table.insert(result, [[ "address": "127.0.0.1",]]) + table.insert(result, [[ "port": 20401,]]) + table.insert(result, [[ "windows": []]) + table.insert(result, [[ {]]) + generateWindow(result, arg["fullScreen"], arg["msaa"], arg["border"], arg["monitor"], + arg["tags"], arg["stereo"], arg["pos"], arg["size"], arg["res"], viewport) + table.insert(result, [[ }]]) + table.insert(result, [[ ] ]]) + table.insert(result, [[ }]]) + table.insert(result, [[ ],]]) + table.insert(result, [[ "users": []]) + generateUser(result) + table.insert(result, [[ ] ]]) + table.insert(result, [[}]]) + + return table.concat(result, "\n") end -function generateSingleWindowConfig(arg) - assert( - type(arg["res"]) == "table" or type(arg["res"]) == "nil", - "res must be a table or nil" - ) - if (type(arg["res"]) == "table") then - assert(type(arg["res"][1]) == "number", "res[1] must be a number") - assert(type(arg["res"][2]) == "number", "res[2] must be a number") +function check(type_string, arg, param, subparam_type) + local t = type(arg[param]) + assert(t == type_string or t == "nil", param .. " must be a " .. type_string .. " or nil") + + if type_string == "table" and subparam_type and arg[param] then + for k, v in pairs(arg[param]) do + assert( + type(v == subparam_type), + param .. "[" .. k .. "] must be a " .. subparam_type + ) + end end +end - assert( - type(arg["shared"]) == "boolean" or type(arg["shared"]) == "nil", - "shared must be a boolean or nil" - ) - assert( - type(arg["tags"]) == "table" or type(arg["tags"]) == "nil", - "tags must be a table or nil" - ) - if (type(arg["tags"]) == "table") and (next(arg["tags"]) ~= nil) then - for index, value in ipairs(arg["tags"]) do - assert(type(value) == "string", "Each tag must be a string") - end + +function generateSingleWindowConfig(arg, viewport) + check("table", arg, "res", "number") + check("table", arg, "tags", "string") + check("table", arg, "pos", "number") + check("boolean", arg, "shared") + check("boolean", arg, "fullScreen") + check("boolean", arg, "border") + check("boolean", arg, "vsync") + check("boolean", arg, "sgctDebug") + check("number", arg, "monitor") + check("number", arg, "msaa") + check("number", arg, "refreshRate") + check("string", arg, "stereo") + + check("table", arg, "scene") + if arg["scene"] then + check("table", arg["scene"], "offset", "number") + check("table", arg["scene"], "orientation", "number") + check("number", arg["scene"], "scale") end - - assert( - type(arg["pos"]) == "table" or type(arg["pos"]) == "nil", - "pos must be a table or nil" - ) - if (type(arg["pos"]) == "table") then - assert(type(arg["pos"][1]) == "number", "pos[1] must be a number") - assert(type(arg["pos"][2]) == "number", "pos[2] must be a number") - end - - assert( - type(arg["fullScreen"]) == "boolean" or type(arg["fullScreen"]) == "nil", - "fullScreen must be a boolean or nil" - ) - - assert( - type(arg["monitor"]) == "number" or type(arg["monitor"]) == "nil", - "monitor must be a number or nil" - ) - - assert( - type(arg["border"]) == "boolean" or type(arg["border"]) == "nil", - "border must be a boolean or nil" - ) - - assert( - type(arg["msaa"]) == "number" or type(arg["msaa"]) == "nil", - "msaa must be a number or nil" - ) - - assert( - type(arg["vsync"]) == "boolean" or type(arg["vsync"]) == "nil", - "vsync must be a boolean or nil" - ) - - assert( - type(arg["refreshRate"]) == "number" or type(arg["refreshRate"]) == "nil", - "refreshRate must be a number or nil" - ) - assert( - type(arg["stereo"]) == "string" or type(arg["stereo"]) == "nil", - "stereo must be a boolean or nil" - ) - - assert( - type(arg["sgctDebug"]) == "boolean" or type(arg["sgctDebug"]) == "nil", - "sgctDebug must be a boolean or nil" - ) - - assert( - type(arg["scene"]) == "table" or type(arg["scene"]) == "nil", - "scene must be a table or nil" - ) - if type(arg["scene"]) == "table" then - local offset = arg["scene"]["offset"] - assert( - type(offset) == "table" or type(offset) == "nil", - "scene['offset'] must be a table or nil" - ) - if type(offset) == "table" then - assert(type(offset["x"]) == "number", "scene['offset']['x'] must be a number") - assert(type(offset["y"]) == "number", "scene['offset']['y'] must be a number") - assert(type(offset["z"]) == "number", "scene['offset']['z'] must be a number") - end - - local orientation = arg["scene"]["orientation"] - assert( - type(orientation) == "table" or type(orientation) == "nil", - "scene['orientation] must be a table or nil" - ) - if type(orientation) == "table" then - assert(type(orientation["yaw"]) == "number", "orientation['yaw'] must be a number") - assert(type(orientation["pitch"]) == "number", "orientation['pitch'] must be a number") - assert(type(orientation["roll"]) == "number", "orientation['roll'] must be a number") - end - - local scale = arg["scene"]["scale"] - assert( - type(scale) == "number" or type(scale) == "nil", - "scene['scale'] must be a number or nil" - ) - end - - assert(type(arg["viewport"]) == "string", "viewport must be a string") - - -- Then setting reasonable default values - arg["vsync"] = arg["vsync"] or false - arg["fullScreen"] = arg["fullScreen"] or false - arg["monitor"] = arg["monitor"] or 0 - arg["tags"] = arg["tags"] or {} - arg["msaa"] = arg["msaa"] or 1 - arg["border"] = arg["border"] or true - arg["stereo"] = arg["stereo"] or "none" - arg["pos"] = arg["pos"] or { 50, 50 } - arg["sgctDebug"] = arg["sgctDebug"] or false - arg["windowSize"] = arg["windowSize"] or { 1280, 720 } - if arg["shared"] then local t = arg["tags"] t[#t + 1] = "Spout" end - - arg["scene"] = generateScene(arg) - arg["settings"] = generateSettings(arg) - arg["window"] = generateWindow(arg) - arg["user"] = generateUser(arg) - - return generateCluster(arg) + return generateCluster(arg, viewport) end + function normalizeArg(arg) arg = arg or {} - assert( - type(arg[1]) == "number" or type(arg[1]) == "nil", - "First argument must be a number or nil" - ) - assert( - type(arg[2]) == "number" or type(arg[2]) == "nil", - "Second argument must be a number or nil" - ) - if (type(arg[1]) == "number") then - if (type(arg[2]) == "nil") then - arg[2] = arg[1] * 9/16 - end - arg["windowSize"] = { arg[1], arg[2] } + check("number", arg, 1) + check("number", arg, 2) + + if type(arg[1]) == "number" and type(arg[2]) == "number" then + arg["size"] = { arg[1], arg[2] } arg[1] = nil arg[2] = nil end @@ -446,9 +373,9 @@ function normalizeArg(arg) end + function sgct.makeConfig(config) - -- local configFile = os.tmpname() .. ".json" - local configFile = "C:/Development/testing.json" + local configFile = os.tmpname() .. ".json" local file = io.open(configFile, "w+") file:write(config) io.close(file) @@ -460,76 +387,49 @@ end function sgct.config.single(arg) arg = normalizeArg(arg) - assert( - type(arg["windowSize"]) == "table" or type(arg["windowSize"]) == "nil", - "windowSize must be a table or nil" - ) + check("table", arg, "size", "number") + check("table", arg, "fov", "number") - assert( - type(arg["fov"]) == "table" or type(arg["fov"]) == "nil", - "fov must be a table or nil" - ) - if (type(arg["fov"]) == "table") then - assert(type(arg["fov"]["left"]) == "number", "fov['left'] must be a number") - assert(type(arg["fov"]["right"]) == "number", "fov['right'] must be a number") - assert(type(arg["fov"]["up"]) == "number", "fov['up'] must be a number") - assert(type(arg["fov"]["down"]) == "number", "fov['down'] must be a number") - else - local defaultFov = 40 - local defaultRatio = 16/9 -- comes from default res 1280 x 720 - local tanDefaultFov = math.tan(math.pi * defaultFov / 180) + arg["vsync"] = arg["vsync"] or false + arg["tags"] = arg["tags"] or {} + arg["pos"] = arg["pos"] or { 50, 50 } + arg["size"] = arg["size"] or { 1280, 720 } - if (type(arg["windowSize"]) == "table") then - assert(type(arg["windowSize"][1]) == "number", "windowSize[1] must be a number") - assert(type(arg["windowSize"][2]) == "number", "windowSize[2] must be a number") - local tanHorizontalFov = tanDefaultFov - local tanVerticalFov = tanDefaultFov + if (not arg["fov"]) then + local tanDefaultFov = math.tan(math.rad(40.0)) - local ratio = arg["windowSize"][1] / arg["windowSize"][2] - - -- ratio between w and h should be - -- same as tan(horizontalFov) and tan(verticalFov) - - if (ratio > 1) then - tanVerticalFov = tanHorizontalFov / ratio - else - tanHorizontalFov = tanVerticalFov * ratio - end - - -- sgct expects fov in degrees - arg["fov"] = { - down = 180 * math.atan(tanVerticalFov) / math.pi, - up = 180 * math.atan(tanVerticalFov) / math.pi, - left = 180 * math.atan(tanHorizontalFov) / math.pi, - right = 180 * math.atan(tanHorizontalFov) / math.pi - } + local tanHorizontalFov + local tanVerticalFov + local aspectRatio = arg["size"][1] / arg["size"][2] + if (aspectRatio > 1) then + tanHorizontalFov = tanDefaultFov + tanVerticalFov = tanDefaultFov / aspectRatio else - -- sgct expects fov in degrees - arg["fov"] = { - down = 180 * math.atan(tanDefaultFov / defaultRatio) / math.pi, - up = 180 * math.atan(tanDefaultFov / defaultRatio) / math.pi, - left = 180 * math.atan(tanDefaultFov) / math.pi, - right = 180 * math.atan(tanDefaultFov) / math.pi - } + tanHorizontalFov = tanDefaultFov * aspectRatio + tanVerticalFov = tanDefaultFov end + + arg["fov"] = { + down = math.deg(math.atan(tanVerticalFov)), + up = math.deg(math.atan(tanVerticalFov)), + left = math.deg(math.atan(tanHorizontalFov)), + right = math.deg(math.atan(tanHorizontalFov)) + } end - assert( - type(arg["tracked"]) == "boolean" or type(arg["tracked"]) == "nil", - "tracked must be a boolean or nil" - ) + check("boolean", arg, "tracked") sgctconfiginitializeString = "sgct.config.single" - arg["tracked"] = arg["tracked"] or false + arg["tracked"] = arg["tracked"] or true - arg["viewport"] = generateSingleViewportFOV( + local viewport = generateSingleViewportFOV( arg["fov"]["down"], arg["fov"]["up"], arg["fov"]["left"], arg["fov"]["right"], arg["tracked"] ) - return sgct.makeConfig(generateSingleWindowConfig(arg)) + return sgct.makeConfig(generateSingleWindowConfig(arg, viewport)) end @@ -537,70 +437,26 @@ end function sgct.config.fisheye(arg) arg = normalizeArg(arg) - assert( - type(arg["fov"]) == "number" or type(arg["fov"]) == "nil", - "fov must be a number or nil" - ) - - assert( - type(arg["quality"]) == "string" or type(arg["quality"]) == "nil", - "quality must be a string or nil" - ) - - assert( - type(arg["tilt"]) == "number" or type(arg["tilt"]) == "nil", - "tilt must be a number or nil" - ) - - assert( - type(arg["background"]) == "table" or type(arg["background"]) == "nil", - "background must be a table or nil" - ) - if type(arg["background"]) == "table" then - assert(type(background["r"]) == "number", "backgroud['r'] must be a number") - assert(type(background["g"]) == "number", "backgroud['g'] must be a number") - assert(type(background["b"]) == "number", "backgroud['b'] must be a number") - assert(type(background["a"]) == "number", "backgroud['a'] must be a number") - end - - assert( - type(arg["crop"]) == "table" or type(arg["crop"]) == "nil", - "crop must be a table or nil" - ) - if type(arg["crop"]) == "table" then - assert( - type(arg["crop"]["left"]) == "number", "crop['left'] must be a number" - ) - assert( - type(arg["crop"]["right"]) == "number", "crop['right'] must be a number" - ) - assert( - type(arg["crop"]["top"]) == "number", "crop['top'] must be a number" - ) - assert( - type(arg["crop"]["bottom"]) == "number", "crop['bottom'] must be a number" - ) - end - - assert( - type(arg["offset"]) == "table" or type(arg["offset"]) == "nil", - "offset must be a table or nil" - ) - if type(arg["offset"]) == "table" then - assert(type(arg["offset"]["x"]) == "number", "offset['x'] must be a number") - assert(type(arg["offset"]["y"]) == "number", "offset['y'] must be a number") - assert(type(arg["offset"]["z"]) == "number", "offset['z'] must be a number") - end + check("number", arg, "fov") + check("string", arg, "quality") + check("number", arg, "tilt") + check("table", arg, "background", "number") + check("table", arg, "crop", "number") + check("table", arg, "offset", "number") sgctconfiginitializeString = "sgct.config.fisheye" - arg["fov"] = arg["fov"] or 180.0 + arg["vsync"] = arg["vsync"] or false + arg["tags"] = arg["tags"] or {} + arg["pos"] = arg["pos"] or { 50, 50 } + arg["size"] = arg["size"] or { 1024, 1024 } + arg["quality"] = arg["quality"] or "1k" arg["tilt"] = arg["tilt"] or 90.0 arg["background"] = arg["background"] or { r = 0.0, g = 0.0, b = 0.0, a = 1.0 } arg["tracked"] = arg["tracked"] or false - arg["viewport"] = generateFisheyeViewport( + local viewport = generateFisheyeViewport( arg["fov"], arg["quality"], arg["tilt"], @@ -610,5 +466,5 @@ function sgct.config.fisheye(arg) arg["tracked"] ) - return sgct.makeConfig(generateSingleWindowConfig(arg)) + return sgct.makeConfig(generateSingleWindowConfig(arg, viewport)) end From 6ddf62f2ab5c43e939a0ef6b6e91be79a04d76ce Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 20 Dec 2021 22:42:32 +0100 Subject: [PATCH 030/117] Some more cleanup for configuration_helper script --- apps/OpenSpace/ext/sgct | 2 +- scripts/configuration_helper.lua | 35 ++++++++++---------------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index d67a9bad53..21f5e8b123 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit d67a9bad53948c8cb13fa954ae43941932ec1464 +Subproject commit 21f5e8b123db93e2077a10333cfcd8a5b4ee4404 diff --git a/scripts/configuration_helper.lua b/scripts/configuration_helper.lua index 7641acec74..9126d17128 100644 --- a/scripts/configuration_helper.lua +++ b/scripts/configuration_helper.lua @@ -310,11 +310,11 @@ end -function check(type_string, arg, param, subparam_type) +function check(type_str, arg, param, subparam_type) local t = type(arg[param]) - assert(t == type_string or t == "nil", param .. " must be a " .. type_string .. " or nil") + assert(t == type_str or t == "nil", param .. " must be a " .. type_str .. " or nil") - if type_string == "table" and subparam_type and arg[param] then + if type_str == "table" and subparam_type and arg[param] then for k, v in pairs(arg[param]) do assert( type(v == subparam_type), @@ -368,8 +368,6 @@ function normalizeArg(arg) arg[1] = nil arg[2] = nil end - - return arg end @@ -385,7 +383,7 @@ end function sgct.config.single(arg) - arg = normalizeArg(arg) + normalizeArg(arg) check("table", arg, "size", "number") check("table", arg, "fov", "number") @@ -422,24 +420,20 @@ function sgct.config.single(arg) arg["tracked"] = arg["tracked"] or true - local viewport = generateSingleViewportFOV( - arg["fov"]["down"], - arg["fov"]["up"], - arg["fov"]["left"], - arg["fov"]["right"], - arg["tracked"] - ) + local viewport = generateSingleViewportFOV(arg["fov"]["down"], arg["fov"]["up"], + arg["fov"]["left"], arg["fov"]["right"], arg["tracked"]) + return sgct.makeConfig(generateSingleWindowConfig(arg, viewport)) end function sgct.config.fisheye(arg) - arg = normalizeArg(arg) + normalizeArg(arg) check("number", arg, "fov") - check("string", arg, "quality") check("number", arg, "tilt") + check("string", arg, "quality") check("table", arg, "background", "number") check("table", arg, "crop", "number") check("table", arg, "offset", "number") @@ -456,15 +450,8 @@ function sgct.config.fisheye(arg) arg["background"] = arg["background"] or { r = 0.0, g = 0.0, b = 0.0, a = 1.0 } arg["tracked"] = arg["tracked"] or false - local viewport = generateFisheyeViewport( - arg["fov"], - arg["quality"], - arg["tilt"], - arg["background"], - arg["crop"], - arg["offset"], - arg["tracked"] - ) + local viewport = generateFisheyeViewport(arg["fov"], arg["quality"], arg["tilt"], + arg["background"], arg["crop"], arg["offset"], arg["tracked"]) return sgct.makeConfig(generateSingleWindowConfig(arg, viewport)) end From 76b9c7587b897a52f0a25f635e28448b3ac25576 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 26 Dec 2021 19:19:04 +0100 Subject: [PATCH 031/117] Adapt to explicit specifcation of texture size (#1794) * Adapt to explicit specifcation of texture size --- ext/ghoul | 2 +- .../openspace/rendering/texturecomponent.h | 22 ++++++++++++------- modules/base/rendering/renderabledisc.cpp | 2 +- .../rendering/renderableplaneimagelocal.cpp | 5 ++++- .../rendering/renderableplaneimageonline.cpp | 1 + .../renderableplanetimevaryingimage.cpp | 3 ++- modules/base/rendering/renderablesphere.cpp | 2 +- .../rendering/renderabletimevaryingsphere.cpp | 2 +- .../base/rendering/screenspaceframebuffer.cpp | 9 ++++---- .../base/rendering/screenspaceimagelocal.cpp | 5 ++++- .../base/rendering/screenspaceimageonline.cpp | 1 + .../rendering/renderablebillboardscloud.cpp | 5 +++-- .../rendering/renderableplanescloud.cpp | 2 +- .../rendering/renderablepoints.cpp | 3 ++- .../rendering/renderableorbitdisc.cpp | 2 +- .../gaia/rendering/renderablegaiastars.cpp | 8 +++++-- modules/galaxy/rendering/renderablegalaxy.cpp | 4 +++- .../src/memoryawaretilecache.cpp | 1 + modules/globebrowsing/src/ringscomponent.cpp | 18 ++++++++++----- modules/globebrowsing/src/tileprovider.cpp | 4 ++-- modules/imgui/src/gui.cpp | 3 ++- modules/iswa/rendering/datacygnet.cpp | 1 + modules/iswa/rendering/texturecygnet.cpp | 1 + .../rendering/renderablekameleonvolume.cpp | 1 + .../multiresvolume/rendering/atlasmanager.cpp | 1 + .../multiresvolume/rendering/brickmanager.cpp | 1 + modules/space/rendering/renderablerings.cpp | 3 ++- modules/space/rendering/renderablestars.cpp | 9 +++++--- .../rendering/renderableplaneprojection.cpp | 2 +- .../rendering/renderableplanetprojection.cpp | 6 +++-- .../util/projectioncomponent.cpp | 10 +++++++-- .../rendering/renderabletimevaryingvolume.cpp | 1 + modules/volume/textureslicevolumereader.inl | 4 ++-- modules/volume/transferfunctionhandler.cpp | 1 + modules/webbrowser/src/screenspacebrowser.cpp | 3 ++- src/rendering/loadingscreen.cpp | 3 ++- src/rendering/texturecomponent.cpp | 18 +++++++++++---- src/rendering/transferfunction.cpp | 3 ++- 38 files changed, 117 insertions(+), 55 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 6dfb7965bf..89d1e7f6b6 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 6dfb7965bf7d44a6d3690634daf21848b3be6df5 +Subproject commit 89d1e7f6b63546f430854cbb208d18987dc7635a diff --git a/include/openspace/rendering/texturecomponent.h b/include/openspace/rendering/texturecomponent.h index 1940e05fac..cceb5beb4f 100644 --- a/include/openspace/rendering/texturecomponent.h +++ b/include/openspace/rendering/texturecomponent.h @@ -35,13 +35,14 @@ namespace openspace { class TextureComponent { public: - using Texture = ghoul::opengl::Texture; + // nDimensions must be 1, 2, 3 + TextureComponent(int nDimensions); - const Texture* texture() const; - Texture* texture(); + const ghoul::opengl::Texture* texture() const; + ghoul::opengl::Texture* texture(); - void setFilterMode(Texture::FilterMode filterMode); - void setWrapping(Texture::WrappingMode wrapping); + void setFilterMode(ghoul::opengl::Texture::FilterMode filterMode); + void setWrapping(ghoul::opengl::Texture::WrappingMode wrapping); void setShouldWatchFileForChanges(bool value); void setShouldPurgeFromRAM(bool value); @@ -57,15 +58,20 @@ public: private: std::unique_ptr _textureFile; - std::unique_ptr _texture; + std::unique_ptr _texture; - Texture::FilterMode _filterMode = Texture::FilterMode::LinearMipMap; - Texture::WrappingMode _wrappingMode = Texture::WrappingMode::Repeat; + ghoul::opengl::Texture::FilterMode _filterMode = + ghoul::opengl::Texture::FilterMode::LinearMipMap; + ghoul::opengl::Texture::WrappingMode _wrappingMode = + ghoul::opengl::Texture::WrappingMode::Repeat; + bool _shouldWatchFile = true; bool _shouldPurgeFromRAM = true; bool _fileIsDirty = false; bool _textureIsDirty = false; + + const int _nDimensions; }; } // namespace openspace diff --git a/modules/base/rendering/renderabledisc.cpp b/modules/base/rendering/renderabledisc.cpp index 52a733131c..26cd8cfe93 100644 --- a/modules/base/rendering/renderabledisc.cpp +++ b/modules/base/rendering/renderabledisc.cpp @@ -116,7 +116,7 @@ bool RenderableDisc::isReady() const { } void RenderableDisc::initialize() { - _texture = std::make_unique(); + _texture = std::make_unique(1); _texture->setFilterMode(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap); _texture->setWrapping(ghoul::opengl::Texture::WrappingMode::ClampToEdge); _texture->setShouldWatchFileForChanges(true); diff --git a/modules/base/rendering/renderableplaneimagelocal.cpp b/modules/base/rendering/renderableplaneimagelocal.cpp index 6f6d88cacd..d29159da72 100644 --- a/modules/base/rendering/renderableplaneimagelocal.cpp +++ b/modules/base/rendering/renderableplaneimagelocal.cpp @@ -192,7 +192,10 @@ void RenderablePlaneImageLocal::loadTexture() { std::to_string(hash), [path = _texturePath]() -> std::unique_ptr { std::unique_ptr texture = - ghoul::io::TextureReader::ref().loadTexture(absPath(path).string()); + ghoul::io::TextureReader::ref().loadTexture( + absPath(path).string(), + 2 + ); LDEBUGC( "RenderablePlaneImageLocal", diff --git a/modules/base/rendering/renderableplaneimageonline.cpp b/modules/base/rendering/renderableplaneimageonline.cpp index d0179e9d79..1e01bdd2dc 100644 --- a/modules/base/rendering/renderableplaneimageonline.cpp +++ b/modules/base/rendering/renderableplaneimageonline.cpp @@ -127,6 +127,7 @@ void RenderablePlaneImageOnline::update(const UpdateData& data) { ghoul::io::TextureReader::ref().loadTexture( reinterpret_cast(imageFile.buffer), imageFile.size, + 2, imageFile.format ); diff --git a/modules/base/rendering/renderableplanetimevaryingimage.cpp b/modules/base/rendering/renderableplanetimevaryingimage.cpp index 4e43399061..05f3844b88 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.cpp +++ b/modules/base/rendering/renderableplanetimevaryingimage.cpp @@ -168,7 +168,8 @@ void RenderablePlaneTimeVaryingImage::initializeGL() { _textureFiles.resize(_sourceFiles.size()); for (size_t i = 0; i < _sourceFiles.size(); ++i) { _textureFiles[i] = ghoul::io::TextureReader::ref().loadTexture( - absPath(_sourceFiles[i]).string() + absPath(_sourceFiles[i]).string(), + 2 ); _textureFiles[i]->setInternalFormat(GL_COMPRESSED_RGBA); _textureFiles[i]->uploadTexture(); diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index be23335a4e..8663283f04 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -437,7 +437,7 @@ void RenderableSphere::update(const UpdateData&) { void RenderableSphere::loadTexture() { if (!_texturePath.value().empty()) { std::unique_ptr texture = - ghoul::io::TextureReader::ref().loadTexture(_texturePath); + ghoul::io::TextureReader::ref().loadTexture(_texturePath, 2); if (texture) { LDEBUGC( diff --git a/modules/base/rendering/renderabletimevaryingsphere.cpp b/modules/base/rendering/renderabletimevaryingsphere.cpp index eb1f824b0f..0ba3a64c4f 100644 --- a/modules/base/rendering/renderabletimevaryingsphere.cpp +++ b/modules/base/rendering/renderabletimevaryingsphere.cpp @@ -439,7 +439,7 @@ void RenderableTimeVaryingSphere::extractMandatoryInfoFromSourceFolder() { std::string filePath = e.path().string(); double time = extractTriggerTimeFromFileName(filePath); std::unique_ptr t = - ghoul::io::TextureReader::ref().loadTexture(filePath); + ghoul::io::TextureReader::ref().loadTexture(filePath, 2); t->setInternalFormat(GL_COMPRESSED_RGBA); t->uploadTexture(); diff --git a/modules/base/rendering/screenspaceframebuffer.cpp b/modules/base/rendering/screenspaceframebuffer.cpp index abe30c7099..6469b0892f 100644 --- a/modules/base/rendering/screenspaceframebuffer.cpp +++ b/modules/base/rendering/screenspaceframebuffer.cpp @@ -175,11 +175,10 @@ void ScreenSpaceFramebuffer::createFramebuffer() { _framebuffer = std::make_unique(); _framebuffer->activate(); - _texture = std::make_unique(glm::uvec3( - resolution.x, - resolution.y, - 1 - )); + _texture = std::make_unique( + glm::uvec3(resolution.x, resolution.y, 1), + GL_TEXTURE_2D + ); _objectSize = glm::ivec2(resolution); _texture->uploadTexture(); diff --git a/modules/base/rendering/screenspaceimagelocal.cpp b/modules/base/rendering/screenspaceimagelocal.cpp index d4cf2672c6..1cab2d9abc 100644 --- a/modules/base/rendering/screenspaceimagelocal.cpp +++ b/modules/base/rendering/screenspaceimagelocal.cpp @@ -114,7 +114,10 @@ bool ScreenSpaceImageLocal::deinitializeGL() { void ScreenSpaceImageLocal::update() { if (_textureIsDirty && !_texturePath.value().empty()) { std::unique_ptr texture = - ghoul::io::TextureReader::ref().loadTexture(absPath(_texturePath).string()); + ghoul::io::TextureReader::ref().loadTexture( + absPath(_texturePath).string(), + 2 + ); if (texture) { // Images don't need to start on 4-byte boundaries, for example if the diff --git a/modules/base/rendering/screenspaceimageonline.cpp b/modules/base/rendering/screenspaceimageonline.cpp index 8219965b11..6dcac1bfdf 100644 --- a/modules/base/rendering/screenspaceimageonline.cpp +++ b/modules/base/rendering/screenspaceimageonline.cpp @@ -118,6 +118,7 @@ void ScreenSpaceImageOnline::update() { ghoul::io::TextureReader::ref().loadTexture( reinterpret_cast(imageFile.buffer), imageFile.size, + 2, imageFile.format ); diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 8b334a02e6..430c6b7a80 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -970,9 +970,10 @@ void RenderableBillboardsCloud::update(const UpdateData&) { _spriteTexture = DigitalUniverseModule::TextureManager.request( std::to_string(hash), [path = _spriteTexturePath]() -> std::unique_ptr { - LINFO(fmt::format("Loaded texture from {}", absPath(path))); + std::filesystem::path p = absPath(path); + LINFO(fmt::format("Loaded texture from {}", p)); std::unique_ptr t = - ghoul::io::TextureReader::ref().loadTexture(absPath(path).string()); + ghoul::io::TextureReader::ref().loadTexture(p.string(), 2); t->uploadTexture(); t->setFilter(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap); t->purgeFromRAM(); diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index 18d0117607..dbb93b5d1b 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -631,7 +631,7 @@ void RenderablePlanesCloud::loadTextures() { } std::unique_ptr t = - ghoul::io::TextureReader::ref().loadTexture(path.string()); + ghoul::io::TextureReader::ref().loadTexture(path.string(), 2); if (t) { LINFOC("RenderablePlanesCloud", fmt::format("Loaded texture {}", path)); diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index e3449d0095..cd2535e54f 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -344,7 +344,8 @@ void RenderablePoints::update(const UpdateData&) { _spriteTexture = nullptr; if (!_spriteTexturePath.value().empty()) { _spriteTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(_spriteTexturePath).string() + absPath(_spriteTexturePath).string(), + 2 ); if (_spriteTexture) { LDEBUG( diff --git a/modules/exoplanets/rendering/renderableorbitdisc.cpp b/modules/exoplanets/rendering/renderableorbitdisc.cpp index 8688d84e22..70fbcf661a 100644 --- a/modules/exoplanets/rendering/renderableorbitdisc.cpp +++ b/modules/exoplanets/rendering/renderableorbitdisc.cpp @@ -131,7 +131,7 @@ bool RenderableOrbitDisc::isReady() const { } void RenderableOrbitDisc::initialize() { - _texture = std::make_unique(); + _texture = std::make_unique(1); _texture->setFilterMode(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap); _texture->setWrapping(ghoul::opengl::Texture::WrappingMode::ClampToEdge); _plane = std::make_unique(planeSize()); diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp index 44e8d3f579..f9f05f7c3d 100644 --- a/modules/gaia/rendering/renderablegaiastars.cpp +++ b/modules/gaia/rendering/renderablegaiastars.cpp @@ -2067,6 +2067,7 @@ void RenderableGaiaStars::update(const UpdateData&) { glm::vec2 screenSize = glm::vec2(global::renderEngine->renderingResolution()); _fboTexture = std::make_unique( glm::uvec3(screenSize, 1), + GL_TEXTURE_2D, ghoul::opengl::Texture::Format::RGBA, GL_RGBA32F, GL_FLOAT @@ -2100,7 +2101,8 @@ void RenderableGaiaStars::update(const UpdateData&) { _pointSpreadFunctionTexture = nullptr; if (!_pointSpreadFunctionTexturePath.value().empty()) { _pointSpreadFunctionTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(_pointSpreadFunctionTexturePath).string() + absPath(_pointSpreadFunctionTexturePath).string(), + 2 ); if (_pointSpreadFunctionTexture) { @@ -2128,7 +2130,8 @@ void RenderableGaiaStars::update(const UpdateData&) { _colorTexture = nullptr; if (!_colorTexturePath.value().empty()) { _colorTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(_colorTexturePath).string() + absPath(_colorTexturePath).string(), + 2 ); if (_colorTexture) { LDEBUG(fmt::format("Loaded texture from {}", absPath(_colorTexturePath))); @@ -2153,6 +2156,7 @@ void RenderableGaiaStars::update(const UpdateData&) { if (hasChanged) { _fboTexture = std::make_unique( glm::uvec3(screenSize, 1), + GL_TEXTURE_2D, ghoul::opengl::Texture::Format::RGBA, GL_RGBA32F, GL_FLOAT diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index 062cab243d..dc0516c8df 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -370,6 +370,7 @@ void RenderableGalaxy::initializeGL() { _texture = std::make_unique( _volumeDimensions, + GL_TEXTURE_3D, ghoul::opengl::Texture::Format::RGBA, GL_RGBA, GL_UNSIGNED_BYTE, @@ -414,7 +415,8 @@ void RenderableGalaxy::initializeGL() { if (!_pointSpreadFunctionTexturePath.empty()) { _pointSpreadFunctionTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(_pointSpreadFunctionTexturePath).string() + absPath(_pointSpreadFunctionTexturePath).string(), + 2 ); if (_pointSpreadFunctionTexture) { diff --git a/modules/globebrowsing/src/memoryawaretilecache.cpp b/modules/globebrowsing/src/memoryawaretilecache.cpp index 1f42d9d69a..320ee99853 100644 --- a/modules/globebrowsing/src/memoryawaretilecache.cpp +++ b/modules/globebrowsing/src/memoryawaretilecache.cpp @@ -210,6 +210,7 @@ void MemoryAwareTileCache::TextureContainer::reset() { using namespace ghoul::opengl; std::unique_ptr tex = std::make_unique( _initData.dimensions, + GL_TEXTURE_2D, _initData.ghoulTextureFormat, toGlTextureFormat(_initData.glType, _initData.ghoulTextureFormat), _initData.glType, diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index f8c2ff1f1d..22235549ed 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -621,7 +621,8 @@ void RingsComponent::loadTexture() { if (!_texturePath.value().empty()) { std::unique_ptr texture = TextureReader::ref().loadTexture( - absPath(_texturePath).string() + absPath(_texturePath).string(), + 1 ); if (texture) { @@ -643,7 +644,8 @@ void RingsComponent::loadTexture() { if (!_textureFwrdPath.value().empty()) { std::unique_ptr textureForwards = TextureReader::ref().loadTexture( - absPath(_textureFwrdPath).string() + absPath(_textureFwrdPath).string(), + 1 ); if (textureForwards) { @@ -669,7 +671,8 @@ void RingsComponent::loadTexture() { if (!_textureBckwrdPath.value().empty()) { std::unique_ptr textureBackwards = TextureReader::ref().loadTexture( - absPath(_textureBckwrdPath).string() + absPath(_textureBckwrdPath).string(), + 1 ); if (textureBackwards) { @@ -695,7 +698,8 @@ void RingsComponent::loadTexture() { if (!_textureUnlitPath.value().empty()) { std::unique_ptr textureUnlit = TextureReader::ref().loadTexture( - absPath(_textureUnlitPath).string() + absPath(_textureUnlitPath).string(), + 1 ); if (textureUnlit) { @@ -717,7 +721,8 @@ void RingsComponent::loadTexture() { if (!_textureColorPath.value().empty()) { std::unique_ptr textureColor = TextureReader::ref().loadTexture( - absPath(_textureColorPath).string() + absPath(_textureColorPath).string(), + 1 ); if (textureColor) { @@ -739,7 +744,8 @@ void RingsComponent::loadTexture() { if (!_textureTransparencyPath.value().empty()) { std::unique_ptr textureTransparency = TextureReader::ref().loadTexture( - absPath(_textureTransparencyPath).string() + absPath(_textureTransparencyPath).string(), + 1 ); if (textureTransparency) { diff --git a/modules/globebrowsing/src/tileprovider.cpp b/modules/globebrowsing/src/tileprovider.cpp index 9c071f5ef6..2b50b423ad 100644 --- a/modules/globebrowsing/src/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider.cpp @@ -670,7 +670,7 @@ void initializeDefaultTile() { memset(pixels, 0, initData.totalNumBytes * sizeof(char)); // Create ghoul texture - DefaultTileTexture = std::make_unique(initData.dimensions); + DefaultTileTexture = std::make_unique(initData.dimensions, GL_TEXTURE_2D); DefaultTileTexture->setDataOwnership(Texture::TakeOwnership::Yes); DefaultTileTexture->setPixelData(pixels); DefaultTileTexture->uploadTexture(); @@ -1648,7 +1648,7 @@ void reset(TileProvider& tp) { if (t.filePath.value().empty()) { return; } - t.tileTexture = ghoul::io::TextureReader::ref().loadTexture(t.filePath); + t.tileTexture = ghoul::io::TextureReader::ref().loadTexture(t.filePath, 2); if (!t.tileTexture) { throw ghoul::RuntimeError( fmt::format("Unable to load texture '{}'", t.filePath.value()) diff --git a/modules/imgui/src/gui.cpp b/modules/imgui/src/gui.cpp index ff6e488acc..0d41287812 100644 --- a/modules/imgui/src/gui.cpp +++ b/modules/imgui/src/gui.cpp @@ -336,7 +336,8 @@ void GUI::initializeGL() { } _fontTexture = std::make_unique( texData, - glm::uvec3(texSize.x, texSize.y, 1) + glm::uvec3(texSize.x, texSize.y, 1), + GL_TEXTURE_2D ); _fontTexture->setName("Gui Text"); _fontTexture->setDataOwnership(ghoul::opengl::Texture::TakeOwnership::No); diff --git a/modules/iswa/rendering/datacygnet.cpp b/modules/iswa/rendering/datacygnet.cpp index 6d8e217807..27bc34219c 100644 --- a/modules/iswa/rendering/datacygnet.cpp +++ b/modules/iswa/rendering/datacygnet.cpp @@ -136,6 +136,7 @@ bool DataCygnet::updateTexture() { std::unique_ptr texture = std::make_unique( values, _textureDimensions, + GL_TEXTURE_2D, ghoul::opengl::Texture::Format::Red, GL_RED, GL_FLOAT, diff --git a/modules/iswa/rendering/texturecygnet.cpp b/modules/iswa/rendering/texturecygnet.cpp index a9c08e9323..7a3948bd32 100644 --- a/modules/iswa/rendering/texturecygnet.cpp +++ b/modules/iswa/rendering/texturecygnet.cpp @@ -47,6 +47,7 @@ bool TextureCygnet::updateTexture() { std::unique_ptr texture = io::TextureReader::ref().loadTexture( reinterpret_cast(_imageFile.buffer), _imageFile.size, + 2, _imageFile.format ); diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index dde78c643c..02bee3ec91 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -422,6 +422,7 @@ void RenderableKameleonVolume::updateTextureFromVolume() { _volumeTexture = std::make_shared( _dimensions, + GL_TEXTURE_3D, ghoul::opengl::Texture::Format::Red, GL_RED, GL_FLOAT, diff --git a/modules/multiresvolume/rendering/atlasmanager.cpp b/modules/multiresvolume/rendering/atlasmanager.cpp index d35740429e..4bd903b5d4 100644 --- a/modules/multiresvolume/rendering/atlasmanager.cpp +++ b/modules/multiresvolume/rendering/atlasmanager.cpp @@ -57,6 +57,7 @@ bool AtlasManager::initialize() { _textureAtlas = new ghoul::opengl::Texture( glm::size3_t(_atlasDim, _atlasDim, _atlasDim), + GL_TEXTURE_3D, ghoul::opengl::Texture::Format::RGBA, GL_RGBA, GL_FLOAT diff --git a/modules/multiresvolume/rendering/brickmanager.cpp b/modules/multiresvolume/rendering/brickmanager.cpp index 0e72a9977c..6998662a0a 100644 --- a/modules/multiresvolume/rendering/brickmanager.cpp +++ b/modules/multiresvolume/rendering/brickmanager.cpp @@ -143,6 +143,7 @@ bool BrickManager::initialize() { dims.push_back(_atlasDim); _textureAtlas = new ghoul::opengl::Texture( glm::size3_t(_atlasDim, _atlasDim, _atlasDim), + GL_TEXTURE_3D, ghoul::opengl::Texture::Format::RGBA, GL_RGBA, GL_FLOAT diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index e013449b9c..dd8553d905 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -235,7 +235,8 @@ void RenderableRings::loadTexture() { using namespace ghoul::io; using namespace ghoul::opengl; std::unique_ptr texture = TextureReader::ref().loadTexture( - absPath(_texturePath).string() + absPath(_texturePath).string(), + 1 ); if (texture) { diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index f8aa080ae6..c087527200 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -860,7 +860,8 @@ void RenderableStars::loadPSFTexture() { std::filesystem::exists(_pointSpreadFunctionTexturePath.value())) { _pointSpreadFunctionTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(_pointSpreadFunctionTexturePath).string() + absPath(_pointSpreadFunctionTexturePath).string(), + 2 ); if (_pointSpreadFunctionTexture) { @@ -1264,7 +1265,8 @@ void RenderableStars::update(const UpdateData&) { _colorTexture = nullptr; if (_colorTexturePath.value() != "") { _colorTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(_colorTexturePath).string() + absPath(_colorTexturePath).string(), + 1 ); if (_colorTexture) { LDEBUG(fmt::format("Loaded texture from {}", absPath(_colorTexturePath))); @@ -1286,7 +1288,8 @@ void RenderableStars::update(const UpdateData&) { _otherDataColorMapTexture = nullptr; if (!_otherDataColorMapPath.value().empty()) { _otherDataColorMapTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(_otherDataColorMapPath).string() + absPath(_otherDataColorMapPath).string(), + 1 ); if (_otherDataColorMapTexture) { LDEBUG(fmt::format( diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp index 3a442112c9..982afa8929 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp @@ -180,7 +180,7 @@ void RenderablePlaneProjection::loadTexture() { } std::unique_ptr texture = - ghoul::io::TextureReader::ref().loadTexture(absPath(_texturePath).string()); + ghoul::io::TextureReader::ref().loadTexture(absPath(_texturePath).string(), 2); if (!texture) { return; } diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index 72845c2ecb..37cc1be049 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -640,7 +640,8 @@ void RenderablePlanetProjection::loadColorTexture() { _baseTexture = nullptr; if (selectedPath != NoImageText) { _baseTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(selectedPath).string() + absPath(selectedPath).string(), + 2 ); if (_baseTexture) { ghoul::opengl::convertTextureFormat(*_baseTexture, Texture::Format::RGB); @@ -662,7 +663,8 @@ void RenderablePlanetProjection::loadHeightTexture() { _heightMapTexture = nullptr; if (selectedPath != NoImageText) { _heightMapTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath(selectedPath).string() + absPath(selectedPath).string(), + 2 ); if (_heightMapTexture) { ghoul::opengl::convertTextureFormat(*_heightMapTexture, Texture::Format::RGB); diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index 729abeb98b..2f407d1107 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -352,7 +352,8 @@ bool ProjectionComponent::initializeGL() { using ghoul::opengl::Texture; std::unique_ptr texture = ghoul::io::TextureReader::ref().loadTexture( - absPath(placeholderFile).string() + absPath(placeholderFile).string(), + 2 ); if (texture) { texture->uploadTexture(); @@ -874,7 +875,8 @@ std::shared_ptr ProjectionComponent::loadProjectionTextu } std::unique_ptr texture = ghoul::io::TextureReader::ref().loadTexture( - absPath(texturePath).string() + absPath(texturePath).string(), + 2 ); if (texture) { if (texture->format() == Texture::Format::Red) { @@ -895,6 +897,7 @@ bool ProjectionComponent::generateProjectionLayerTexture(const glm::ivec2& size) using namespace ghoul::opengl; _projectionTexture = std::make_unique( glm::uvec3(size, 1), + GL_TEXTURE_2D, Texture::Format::RGBA ); if (_projectionTexture) { @@ -904,6 +907,7 @@ bool ProjectionComponent::generateProjectionLayerTexture(const glm::ivec2& size) if (_dilation.isEnabled) { _dilation.texture = std::make_unique( glm::uvec3(size, 1), + GL_TEXTURE_2D, ghoul::opengl::Texture::Format::RGBA ); @@ -913,6 +917,7 @@ bool ProjectionComponent::generateProjectionLayerTexture(const glm::ivec2& size) _dilation.stencilTexture = std::make_unique( glm::uvec3(size, 1), + GL_TEXTURE_2D, ghoul::opengl::Texture::Format::Red, static_cast(ghoul::opengl::Texture::Format::Red) ); @@ -930,6 +935,7 @@ bool ProjectionComponent::generateDepthTexture(const glm::ivec2& size) { _shadowing.texture = std::make_unique( glm::uvec3(size, 1), + GL_TEXTURE_2D, ghoul::opengl::Texture::Format::DepthComponent, GL_DEPTH_COMPONENT32F ); diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index e949f4c24f..8dbfa827ed 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -255,6 +255,7 @@ void RenderableTimeVaryingVolume::initializeGL() { t.texture = std::make_shared( t.metadata.dimensions, + GL_TEXTURE_3D, ghoul::opengl::Texture::Format::Red, GL_RED, GL_FLOAT, diff --git a/modules/volume/textureslicevolumereader.inl b/modules/volume/textureslicevolumereader.inl index cf46cbceae..dd8ca4a891 100644 --- a/modules/volume/textureslicevolumereader.inl +++ b/modules/volume/textureslicevolumereader.inl @@ -44,7 +44,7 @@ void TextureSliceVolumeReader::initialize() { ghoul_assert(_paths.size() > 0, "No paths to read slices from."); std::shared_ptr firstSlice = - ghoul::io::TextureReader::ref().loadTexture(_paths[0]); + ghoul::io::TextureReader::ref().loadTexture(_paths[0], 2); glm::uvec3 dimensions = firstSlice->dimensions(); _sliceDimensions = glm::uvec2(dimensions.x, dimensions.y); @@ -80,7 +80,7 @@ TextureSliceVolumeReader::getSlice(int sliceIndex) const if (!_cache.has(sliceIndex)) { std::shared_ptr texture = - ghoul::io::TextureReader::ref().loadTexture(_paths[sliceIndex]); + ghoul::io::TextureReader::ref().loadTexture(_paths[sliceIndex], 2); glm::ivec2 dimensions = glm::uvec2(texture->dimensions()); ghoul_assert(dimensions == _sliceDimensions, "Slice dimensions do not agree."); diff --git a/modules/volume/transferfunctionhandler.cpp b/modules/volume/transferfunctionhandler.cpp index f99fc7d055..53bdbb6234 100644 --- a/modules/volume/transferfunctionhandler.cpp +++ b/modules/volume/transferfunctionhandler.cpp @@ -87,6 +87,7 @@ void TransferFunctionHandler::initialize() { this->addTag("TF"); _texture = std::make_shared( glm::uvec3(1024, 1, 1), + GL_TEXTURE_1D, ghoul::opengl::Texture::Format::RGBA, GL_RGBA, GL_FLOAT, diff --git a/modules/webbrowser/src/screenspacebrowser.cpp b/modules/webbrowser/src/screenspacebrowser.cpp index b4e3a87765..1a72b6e637 100644 --- a/modules/webbrowser/src/screenspacebrowser.cpp +++ b/modules/webbrowser/src/screenspacebrowser.cpp @@ -114,7 +114,8 @@ ScreenSpaceBrowser::ScreenSpaceBrowser(const ghoul::Dictionary& dictionary) bool ScreenSpaceBrowser::initializeGL() { _texture = std::make_unique( - glm::uvec3(_dimensions.value(), 1.f) + glm::uvec3(_dimensions.value(), 1), + GL_TEXTURE_2D ); _renderHandler->setTexture(*_texture); diff --git a/src/rendering/loadingscreen.cpp b/src/rendering/loadingscreen.cpp index 0b34385054..3c80967feb 100644 --- a/src/rendering/loadingscreen.cpp +++ b/src/rendering/loadingscreen.cpp @@ -140,7 +140,8 @@ LoadingScreen::LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeName { // Logo stuff _logoTexture = ghoul::io::TextureReader::ref().loadTexture( - absPath("${DATA}/openspace-logo.png").string() + absPath("${DATA}/openspace-logo.png").string(), + 2 ); _logoTexture->uploadTexture(); } diff --git a/src/rendering/texturecomponent.cpp b/src/rendering/texturecomponent.cpp index 1b06a99ea0..9997953d20 100644 --- a/src/rendering/texturecomponent.cpp +++ b/src/rendering/texturecomponent.cpp @@ -35,6 +35,15 @@ namespace { namespace openspace { +TextureComponent::TextureComponent(int nDimensions) + : _nDimensions(nDimensions) +{ + ghoul_assert( + _nDimensions >= 1 && _nDimensions <= 4, + "nDimensions must be 1, 2, or 3" + ); +} + const ghoul::opengl::Texture* TextureComponent::texture() const { return _texture.get(); } @@ -43,11 +52,11 @@ ghoul::opengl::Texture* TextureComponent::texture() { return _texture.get(); } -void TextureComponent::setFilterMode(Texture::FilterMode filterMode) { +void TextureComponent::setFilterMode(ghoul::opengl::Texture::FilterMode filterMode) { _filterMode = filterMode; } -void TextureComponent::setWrapping(Texture::WrappingMode wrapping) { +void TextureComponent::setWrapping(ghoul::opengl::Texture::WrappingMode wrapping) { _wrappingMode = wrapping; } @@ -82,7 +91,8 @@ void TextureComponent::loadFromFile(const std::filesystem::path& path) { using namespace ghoul::io; using namespace ghoul::opengl; std::unique_ptr texture = TextureReader::ref().loadTexture( - absPath(path.string()).string() + absPath(path.string()).string(), + _nDimensions ); if (texture) { @@ -102,7 +112,7 @@ void TextureComponent::loadFromFile(const std::filesystem::path& path) { void TextureComponent::update() { if (_fileIsDirty) { - loadFromFile(_textureFile->path()); + loadFromFile(_textureFile->path()), _nDimensions; } if (_textureIsDirty) { diff --git a/src/rendering/transferfunction.cpp b/src/rendering/transferfunction.cpp index 260a3985b8..e28ec4764a 100644 --- a/src/rendering/transferfunction.cpp +++ b/src/rendering/transferfunction.cpp @@ -195,6 +195,7 @@ void TransferFunction::setTextureFromTxt() { _texture = std::make_unique( transferFunction, glm::size3_t(width, 1, 1), + GL_TEXTURE_1D, ghoul::opengl::Texture::Format::RGBA, GL_RGBA, GL_FLOAT, @@ -204,7 +205,7 @@ void TransferFunction::setTextureFromTxt() { } void TransferFunction::setTextureFromImage() { - _texture = ghoul::io::TextureReader::ref().loadTexture(_filepath.string()); + _texture = ghoul::io::TextureReader::ref().loadTexture(_filepath.string(), 1); _texture->setWrapping(ghoul::opengl::Texture::WrappingMode::ClampToEdge); } From 7cf5c374745348516098f6cfd78ea9fdf2b17e47 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 27 Dec 2021 18:58:05 +0100 Subject: [PATCH 032/117] Image sequence tileprovider (#1798) * Fix for rendering DoublePropertys in ImGui * Adding an ImageSequenceTileProvider that loads a folder of images and makes them available through a user-selectable index --- modules/globebrowsing/globebrowsingmodule.cpp | 5 + .../shaders/texturetilemapping.glsl | 15 +- modules/globebrowsing/src/gpulayergroup.cpp | 6 +- modules/globebrowsing/src/layer.cpp | 12 +- modules/globebrowsing/src/layergroupid.h | 20 +-- modules/globebrowsing/src/tileprovider.cpp | 146 ++++++++++++++++++ modules/globebrowsing/src/tileprovider.h | 16 ++ modules/imgui/src/renderproperties.cpp | 5 + 8 files changed, 204 insertions(+), 21 deletions(-) diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index 09b75daa7b..9003102be1 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -293,6 +293,11 @@ void GlobeBrowsingModule::internalInitialize(const ghoul::Dictionary& dict) { layergroupid::TypeID::SingleImageTileLayer )] ); + fTileProvider->registerClass( + layergroupid::LAYER_TYPE_NAMES[static_cast( + layergroupid::TypeID::ImageSequenceTileLayer + )] + ); fTileProvider->registerClass( layergroupid::LAYER_TYPE_NAMES[static_cast( layergroupid::TypeID::TemporalTileLayer diff --git a/modules/globebrowsing/shaders/texturetilemapping.glsl b/modules/globebrowsing/shaders/texturetilemapping.glsl index 5b39d02c42..fa026392ef 100644 --- a/modules/globebrowsing/shaders/texturetilemapping.glsl +++ b/modules/globebrowsing/shaders/texturetilemapping.glsl @@ -149,18 +149,21 @@ vec4 getSample#{layerGroup}#{i}(vec2 uv, vec3 levelWeights, c = getTexVal(#{layerGroup}[#{i}].pile, levelWeights, uv, #{layerGroup}[#{i}].padding); #elif (#{#{layerGroup}#{i}LayerType} == 1) // SingleImageTileLayer c = getTexVal(#{layerGroup}[#{i}].pile, levelWeights, uv, #{layerGroup}[#{i}].padding); -#elif (#{#{layerGroup}#{i}LayerType} == 2) // SizeReferenceTileLayer +#elif (#{#{layerGroup}#{i}LayerType} == 2) // ImageSequenceTileLayer c = getTexVal(#{layerGroup}[#{i}].pile, levelWeights, uv, #{layerGroup}[#{i}].padding); -#elif (#{#{layerGroup}#{i}LayerType} == 3) // TemporalTileLayer +#elif (#{#{layerGroup}#{i}LayerType} == 3) // SizeReferenceTileLayer c = getTexVal(#{layerGroup}[#{i}].pile, levelWeights, uv, #{layerGroup}[#{i}].padding); -#elif (#{#{layerGroup}#{i}LayerType} == 4) // TileIndexTileLayer +#elif (#{#{layerGroup}#{i}LayerType} == 4) // TemporalTileLayer c = getTexVal(#{layerGroup}[#{i}].pile, levelWeights, uv, #{layerGroup}[#{i}].padding); -#elif (#{#{layerGroup}#{i}LayerType} == 5) // ByIndexTileLayer +#elif (#{#{layerGroup}#{i}LayerType} == 5) // TileIndexTileLayer c = getTexVal(#{layerGroup}[#{i}].pile, levelWeights, uv, #{layerGroup}[#{i}].padding); -#elif (#{#{layerGroup}#{i}LayerType} == 6) // ByLevelTileLayer +#elif (#{#{layerGroup}#{i}LayerType} == 6) // ByIndexTileLayer c = getTexVal(#{layerGroup}[#{i}].pile, levelWeights, uv, #{layerGroup}[#{i}].padding); -#elif (#{#{layerGroup}#{i}LayerType} == 7) // SolidColor +#elif (#{#{layerGroup}#{i}LayerType} == 7) // ByLevelTileLayer + c = getTexVal(#{layerGroup}[#{i}].pile, levelWeights, uv, #{layerGroup}[#{i}].padding); +#elif (#{#{layerGroup}#{i}LayerType} == 8) // SolidColor c.rgb = #{layerGroup}[#{i}].color; + #endif return c; diff --git a/modules/globebrowsing/src/gpulayergroup.cpp b/modules/globebrowsing/src/gpulayergroup.cpp index 7511d5ef90..d3fba0f108 100644 --- a/modules/globebrowsing/src/gpulayergroup.cpp +++ b/modules/globebrowsing/src/gpulayergroup.cpp @@ -68,6 +68,7 @@ void GPULayerGroup::setValue(ghoul::opengl::ProgramObject& program, // Intentional fall through. Same for all tile layers case layergroupid::TypeID::DefaultTileLayer: case layergroupid::TypeID::SingleImageTileLayer: + case layergroupid::TypeID::ImageSequenceTileLayer: case layergroupid::TypeID::SizeReferenceTileLayer: case layergroupid::TypeID::TemporalTileLayer: case layergroupid::TypeID::TileIndexTileLayer: @@ -103,7 +104,7 @@ void GPULayerGroup::setValue(ghoul::opengl::ProgramObject& program, program.setUniform(galuc.color, al.solidColor()); break; default: - break; + throw ghoul::MissingCaseException(); } if (gal.isHeightLayer) { @@ -148,6 +149,7 @@ void GPULayerGroup::bind(ghoul::opengl::ProgramObject& p, // Intentional fall through. Same for all tile layers case layergroupid::TypeID::DefaultTileLayer: case layergroupid::TypeID::SingleImageTileLayer: + case layergroupid::TypeID::ImageSequenceTileLayer: case layergroupid::TypeID::SizeReferenceTileLayer: case layergroupid::TypeID::TemporalTileLayer: case layergroupid::TypeID::TileIndexTileLayer: @@ -177,7 +179,7 @@ void GPULayerGroup::bind(ghoul::opengl::ProgramObject& p, galuc.color = p.uniformLocation(name + "color"); break; default: - break; + throw ghoul::MissingCaseException(); } if (gal.isHeightLayer) { diff --git a/modules/globebrowsing/src/layer.cpp b/modules/globebrowsing/src/layer.cpp index 0d9e4fbb45..014f440b0f 100644 --- a/modules/globebrowsing/src/layer.cpp +++ b/modules/globebrowsing/src/layer.cpp @@ -113,8 +113,9 @@ namespace { // Specifies the type of layer that is to be added. If this value is not // specified, the layer is a DefaultTileLayer std::optional type [[codegen::inlist("DefaultTileLayer", - "SingleImageTileLayer", "SizeReferenceTileLayer", "TemporalTileLayer", - "TileIndexTileLayer", "ByIndexTileLayer", "ByLevelTileLayer", "SolidColor")]]; + "SingleImageTileLayer", "ImageSequenceTileLayer", "SizeReferenceTileLayer", + "TemporalTileLayer", "TileIndexTileLayer", "ByIndexTileLayer", + "ByLevelTileLayer", "SolidColor")]]; // Determine whether the layer is enabled or not. If this value is not specified, // the layer is disabled @@ -301,6 +302,7 @@ Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict, // Intentional fall through. Same for all tile layers case layergroupid::TypeID::DefaultTileLayer: case layergroupid::TypeID::SingleImageTileLayer: + case layergroupid::TypeID::ImageSequenceTileLayer: case layergroupid::TypeID::SizeReferenceTileLayer: case layergroupid::TypeID::TemporalTileLayer: case layergroupid::TypeID::TileIndexTileLayer: @@ -314,7 +316,7 @@ Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict, removeProperty(_solidColor); break; default: - break; + throw ghoul::MissingCaseException(); } _type = static_cast(_typeOption.value()); @@ -471,6 +473,7 @@ void Layer::initializeBasedOnType(layergroupid::TypeID id, ghoul::Dictionary ini // Intentional fall through. Same for all tile layers case layergroupid::TypeID::DefaultTileLayer: case layergroupid::TypeID::SingleImageTileLayer: + case layergroupid::TypeID::ImageSequenceTileLayer: case layergroupid::TypeID::SizeReferenceTileLayer: case layergroupid::TypeID::TemporalTileLayer: case layergroupid::TypeID::TileIndexTileLayer: @@ -502,6 +505,7 @@ void Layer::addVisibleProperties() { // Intentional fall through. Same for all tile layers case layergroupid::TypeID::DefaultTileLayer: case layergroupid::TypeID::SingleImageTileLayer: + case layergroupid::TypeID::ImageSequenceTileLayer: case layergroupid::TypeID::SizeReferenceTileLayer: case layergroupid::TypeID::TemporalTileLayer: case layergroupid::TypeID::TileIndexTileLayer: @@ -517,7 +521,7 @@ void Layer::addVisibleProperties() { break; } default: - break; + throw ghoul::MissingCaseException(); } } diff --git a/modules/globebrowsing/src/layergroupid.h b/modules/globebrowsing/src/layergroupid.h index 1679803143..e83403dd6b 100644 --- a/modules/globebrowsing/src/layergroupid.h +++ b/modules/globebrowsing/src/layergroupid.h @@ -53,19 +53,20 @@ enum GroupID { Overlays, NightLayers, WaterMasks, - Unknown, + Unknown }; -static constexpr const int NUM_LAYER_TYPES = 8; +static constexpr const int NUM_LAYER_TYPES = 9; static constexpr const char* LAYER_TYPE_NAMES[NUM_LAYER_TYPES] = { "DefaultTileLayer", "SingleImageTileLayer", + "ImageSequenceTileLayer", "SizeReferenceTileLayer", "TemporalTileLayer", "TileIndexTileLayer", "ByIndexTileLayer", "ByLevelTileLayer", - "SolidColor", + "SolidColor" }; /** @@ -75,12 +76,13 @@ enum class TypeID { Unknown = -1, DefaultTileLayer = 0, SingleImageTileLayer = 1, - SizeReferenceTileLayer = 2, - TemporalTileLayer = 3, - TileIndexTileLayer = 4, - ByIndexTileLayer = 5, - ByLevelTileLayer = 6, - SolidColor = 7, + ImageSequenceTileLayer = 2, + SizeReferenceTileLayer = 3, + TemporalTileLayer = 4, + TileIndexTileLayer = 5, + ByIndexTileLayer = 6, + ByLevelTileLayer = 7, + SolidColor = 8 }; static constexpr int NUM_ADJUSTMENT_TYPES = 3; diff --git a/modules/globebrowsing/src/tileprovider.cpp b/modules/globebrowsing/src/tileprovider.cpp index 2b50b423ad..8761ab1e09 100644 --- a/modules/globebrowsing/src/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider.cpp @@ -118,6 +118,28 @@ namespace singleimageprovider { }; } // namespace singleimageprovider +namespace imagesequenceprovider { + constexpr openspace::properties::Property::PropertyInfo IndexInfo = { + "Index", + "Index", + "The index into the list of images that is used to pick the currently displayed " + "image" + }; + + constexpr openspace::properties::Property::PropertyInfo CurrentImageInfo = { + "CurrentImage", + "Current Image", + "The read-only value of the currently selected image" + }; + + constexpr openspace::properties::Property::PropertyInfo FolderPathInfo = { + "FolderPath", + "Folder Path", + "The path that is used to look for images for this image provider. The path must " + "point to an existing folder that contains images" + }; +} // namepsace imagesequenceprovider + namespace sizereferenceprovider { constexpr const char* KeyRadii = "Radii"; } // namespace sizereferenceprovider @@ -779,6 +801,38 @@ SingleImageProvider::SingleImageProvider(const ghoul::Dictionary& dictionary) +ImageSequenceTileProvider::ImageSequenceTileProvider(const ghoul::Dictionary& dictionary) + : index(imagesequenceprovider::IndexInfo, 0) + , currentImage(imagesequenceprovider::CurrentImageInfo) + , folderPath(imagesequenceprovider::FolderPathInfo) + , initDict(dictionary) +{ + ZoneScoped + + type = Type::ImageSequenceTileProvider; + + if (dictionary.hasValue(imagesequenceprovider::IndexInfo.identifier)) { + index = dictionary.value(imagesequenceprovider::IndexInfo.identifier); + } + index.setMinValue(0); + index.onChange([this]() { isImageDirty = true; }); + addProperty(index); + + folderPath.setReadOnly(true); + addProperty(folderPath); + + folderPath = dictionary.value( + imagesequenceprovider::FolderPathInfo.identifier + ); + addProperty(folderPath); + + reset(*this); +} + + + + + TextTileProvider::TextTileProvider(TileTextureInitData initData_, size_t fontSize_) : initData(std::move(initData_)) , fontSize(fontSize_) @@ -1047,6 +1101,8 @@ bool initialize(TileProvider& tp) { break; case Type::SingleImageTileProvider: break; + case Type::ImageSequenceTileProvider: + break; case Type::SizeReferenceTileProvider: { SizeReferenceTileProvider& t = static_cast(tp); initialize(t); @@ -1091,6 +1147,8 @@ bool deinitialize(TileProvider& tp) { break; case Type::SingleImageTileProvider: break; + case Type::ImageSequenceTileProvider: + break; case Type::SizeReferenceTileProvider: { SizeReferenceTileProvider& t = static_cast(tp); deinitialize(t); @@ -1322,6 +1380,16 @@ Tile tile(TileProvider& tp, const TileIndex& tileIndex) { SingleImageProvider& t = static_cast(tp); return t.tile; } + case Type::ImageSequenceTileProvider: { + ZoneScopedN("Type::ImageSequenceTileProvider") + ImageSequenceTileProvider& t = static_cast(tp); + if (t.currentTileProvider) { + return tile(*t.currentTileProvider, tileIndex); + } + else { + return Tile(); + } + } case Type::SizeReferenceTileProvider: { ZoneScopedN("Type::SizeReferenceTileProvider") SizeReferenceTileProvider& t = static_cast(tp); @@ -1447,6 +1515,15 @@ Tile::Status tileStatus(TileProvider& tp, const TileIndex& index) { SingleImageProvider& t = static_cast(tp); return t.tile.status; } + case Type::ImageSequenceTileProvider: { + ImageSequenceTileProvider& t = static_cast(tp); + if (t.currentTileProvider) { + return tileStatus(*t.currentTileProvider, index); + } + else { + return Tile::Status::Unavailable; + } + } case Type::SizeReferenceTileProvider: return Tile::Status::OK; case Type::TileIndexTileProvider: @@ -1510,6 +1587,15 @@ TileDepthTransform depthTransform(TileProvider& tp) { } case Type::SingleImageTileProvider: return { 0.f, 1.f }; + case Type::ImageSequenceTileProvider: { + ImageSequenceTileProvider& t = static_cast(tp); + if (t.currentTileProvider) { + return depthTransform(*t.currentTileProvider); + } + else { + return { 1.f, 0.f }; + } + } case Type::SizeReferenceTileProvider: return { 0.f, 1.f }; case Type::TileIndexTileProvider: @@ -1571,6 +1657,29 @@ int update(TileProvider& tp) { } case Type::SingleImageTileProvider: break; + case Type::ImageSequenceTileProvider: { + ImageSequenceTileProvider& t = static_cast(tp); + + if (t.isImageDirty && !t.imagePaths.empty() && + t.index >= 0 && t.index < t.imagePaths.size()) + { + if (t.currentTileProvider) { + deinitialize(*t.currentTileProvider); + } + + std::string p = t.imagePaths[t.index].string(); + t.currentImage = p; + t.initDict.setValue(KeyFilePath, p); + t.currentTileProvider = std::make_unique(t.initDict); + initialize(*t.currentTileProvider); + t.isImageDirty = false; + } + + if (t.currentTileProvider) { + update(*t.currentTileProvider); + } + break; + } case Type::SizeReferenceTileProvider: break; case Type::TileIndexTileProvider: @@ -1664,6 +1773,25 @@ void reset(TileProvider& tp) { t.tile = Tile{ t.tileTexture.get(), std::nullopt, tileStatus }; break; } + case Type::ImageSequenceTileProvider: { + namespace fs = std::filesystem; + ImageSequenceTileProvider& t = static_cast(tp); + std::string path = t.folderPath; + t.imagePaths.clear(); + for (const fs::directory_entry& p : fs::directory_iterator(path)) { + if (p.is_regular_file()) { + t.imagePaths.push_back(p.path()); + } + } + + t.index = 0; + t.index.setMaxValue(static_cast(t.imagePaths.size() - 1)); + + if (t.currentTileProvider) { + reset(*t.currentTileProvider); + } + break; + } case Type::SizeReferenceTileProvider: { SizeReferenceTileProvider& t = static_cast(tp); reset(t); @@ -1733,6 +1861,15 @@ int maxLevel(TileProvider& tp) { } case Type::SingleImageTileProvider: return 1337; // unlimited + case Type::ImageSequenceTileProvider: { + ImageSequenceTileProvider& t = static_cast(tp); + if (t.currentTileProvider) { + return maxLevel(*t.currentTileProvider); + } + else { + return 0; + } + } case Type::SizeReferenceTileProvider: return 1337; // unlimited case Type::TileIndexTileProvider: @@ -1782,6 +1919,15 @@ float noDataValueAsFloat(TileProvider& tp) { } case Type::SingleImageTileProvider: return std::numeric_limits::min(); + case Type::ImageSequenceTileProvider: { + ImageSequenceTileProvider& t = static_cast(tp); + if (t.currentTileProvider) { + return noDataValueAsFloat(*t.currentTileProvider); + } + else { + return std::numeric_limits::min(); + } + } case Type::SizeReferenceTileProvider: return std::numeric_limits::min(); case Type::TileIndexTileProvider: diff --git a/modules/globebrowsing/src/tileprovider.h b/modules/globebrowsing/src/tileprovider.h index 20c4eed05c..c141d8b041 100644 --- a/modules/globebrowsing/src/tileprovider.h +++ b/modules/globebrowsing/src/tileprovider.h @@ -38,6 +38,7 @@ #include #include #include + struct CPLXMLNode; namespace ghoul::fontrendering { @@ -59,6 +60,7 @@ namespace openspace::globebrowsing::tileprovider { enum class Type { DefaultTileProvider = 0, SingleImageTileProvider, + ImageSequenceTileProvider, SizeReferenceTileProvider, TemporalTileProvider, TileIndexTileProvider, @@ -169,6 +171,20 @@ struct TileProviderByLevel : public TileProvider { }; +struct ImageSequenceTileProvider : public TileProvider { + ImageSequenceTileProvider(const ghoul::Dictionary& dictionary); + + std::unique_ptr currentTileProvider = nullptr; + + properties::IntProperty index; + properties::StringProperty currentImage; + properties::StringProperty folderPath; + + ghoul::Dictionary initDict; + bool isImageDirty = true; + std::vector imagePaths; +}; + /** * Provide Tiles from web map services that have temporal resolution. * diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp index 620745e581..f8a804b5dc 100644 --- a/modules/imgui/src/renderproperties.cpp +++ b/modules/imgui/src/renderproperties.cpp @@ -386,6 +386,11 @@ void renderDoubleProperty(properties::Property* prop, const std::string& ownerNa float value = static_cast(*p); float min = static_cast(p->minValue()); float max = static_cast(p->maxValue()); + + // Since we are doing a DoubleProperty, it would actually overflow here and produce + // -inf and inf as the min and max which confuses ImGui + min = std::max(min, std::numeric_limits::min() / 2.f); + max = std::min(max, std::numeric_limits::max() / 2.f); bool changed = ImGui::SliderFloat( name.c_str(), From 1245a9f9fa407e2429dd5afce460f023f7369fe0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 27 Dec 2021 22:16:42 +0100 Subject: [PATCH 033/117] Remove some unnecessary state from TemporalTileProvider and return value from update functions --- modules/globebrowsing/src/layer.cpp | 7 +- modules/globebrowsing/src/layer.h | 3 +- modules/globebrowsing/src/layergroup.cpp | 7 +- modules/globebrowsing/src/layergroup.h | 3 +- modules/globebrowsing/src/layermanager.cpp | 6 +- modules/globebrowsing/src/layermanager.h | 3 +- modules/globebrowsing/src/tileprovider.cpp | 74 ++++++---------------- modules/globebrowsing/src/tileprovider.h | 5 +- 8 files changed, 31 insertions(+), 77 deletions(-) diff --git a/modules/globebrowsing/src/layer.cpp b/modules/globebrowsing/src/layer.cpp index 014f440b0f..1054247f10 100644 --- a/modules/globebrowsing/src/layer.cpp +++ b/modules/globebrowsing/src/layer.cpp @@ -436,14 +436,11 @@ void Layer::onChange(std::function callback) { _onChangeCallback = std::move(callback); } -int Layer::update() { +void Layer::update() { ZoneScoped if (_tileProvider) { - return tileprovider::update(*_tileProvider); - } - else { - return 0; + tileprovider::update(*_tileProvider); } } diff --git a/modules/globebrowsing/src/layer.h b/modules/globebrowsing/src/layer.h index d0f6402270..16460d38ac 100644 --- a/modules/globebrowsing/src/layer.h +++ b/modules/globebrowsing/src/layer.h @@ -66,8 +66,7 @@ public: void onChange(std::function callback); - // Return: number of tiles that were updated - int update(); + void update(); glm::ivec2 tilePixelStartOffset() const; glm::ivec2 tilePixelSizeDifference() const; diff --git a/modules/globebrowsing/src/layergroup.cpp b/modules/globebrowsing/src/layergroup.cpp index 276b5af11c..28c8f19e29 100644 --- a/modules/globebrowsing/src/layergroup.cpp +++ b/modules/globebrowsing/src/layergroup.cpp @@ -100,20 +100,17 @@ void LayerGroup::deinitialize() { } } -int LayerGroup::update() { +void LayerGroup::update() { ZoneScoped - int res = 0; _activeLayers.clear(); for (const std::unique_ptr& layer : _layers) { if (layer->enabled()) { - res += layer->update(); + layer->update(); _activeLayers.push_back(layer.get()); } } - - return res; } Layer* LayerGroup::addLayer(const ghoul::Dictionary& layerDict) { diff --git a/modules/globebrowsing/src/layergroup.h b/modules/globebrowsing/src/layergroup.h index 8aa83d4b9a..ce8a2e66ee 100644 --- a/modules/globebrowsing/src/layergroup.h +++ b/modules/globebrowsing/src/layergroup.h @@ -48,8 +48,7 @@ struct LayerGroup : public properties::PropertyOwner { void deinitialize(); /// Updates all layers tile providers within this group - /// Return: Number of tiles that were updated - int update(); + void update(); Layer* addLayer(const ghoul::Dictionary& layerDict); void deleteLayer(const std::string& layerName); diff --git a/modules/globebrowsing/src/layermanager.cpp b/modules/globebrowsing/src/layermanager.cpp index 51f0cc4dbc..3306a5abbe 100644 --- a/modules/globebrowsing/src/layermanager.cpp +++ b/modules/globebrowsing/src/layermanager.cpp @@ -141,14 +141,12 @@ std::array LayerManager::layerGroups( return res; } -int LayerManager::update() { +void LayerManager::update() { ZoneScoped - int res = 0; for (std::unique_ptr& layerGroup : _layerGroups) { - res += layerGroup->update(); + layerGroup->update(); } - return res; } void LayerManager::reset(bool includeDisabled) { diff --git a/modules/globebrowsing/src/layermanager.h b/modules/globebrowsing/src/layermanager.h index 25fbde482f..91cfb26e24 100644 --- a/modules/globebrowsing/src/layermanager.h +++ b/modules/globebrowsing/src/layermanager.h @@ -66,8 +66,7 @@ public: std::array layerGroups() const; - // Return: Number of tiles updated - int update(); + void update(); void reset(bool includeDisabled = false); void onChange(std::function callback); diff --git a/modules/globebrowsing/src/tileprovider.cpp b/modules/globebrowsing/src/tileprovider.cpp index 8761ab1e09..5552f397f8 100644 --- a/modules/globebrowsing/src/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider.cpp @@ -1053,11 +1053,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) addProperty(fixedTime); readFilePath(*this); - successfulInitialization = true; - - if (!successfulInitialization) { - LERRORC("TemporalTileProvider", "Unable to read file " + filePath.value()); - } + if (interpolation) { interpolateTileProvider = std::make_unique(dictionary); interpolateTileProvider->colormap = colormap; @@ -1474,13 +1470,8 @@ Tile tile(TileProvider& tp, const TileIndex& tileIndex) { case Type::TemporalTileProvider: { ZoneScopedN("Type::TemporalTileProvider") TemporalTileProvider& t = static_cast(tp); - if (t.successfulInitialization) { - ensureUpdated(t); - return tile(*t.currentTileProvider, tileIndex); - } - else { - return Tile(); - } + ensureUpdated(t); + return tile(*t.currentTileProvider, tileIndex); } default: throw ghoul::MissingCaseException(); @@ -1554,13 +1545,8 @@ Tile::Status tileStatus(TileProvider& tp, const TileIndex& index) { } case Type::TemporalTileProvider: { TemporalTileProvider& t = static_cast(tp); - if (t.successfulInitialization) { - ensureUpdated(t); - return tileStatus(*t.currentTileProvider, index); - } - else { - return Tile::Status::Unavailable; - } + ensureUpdated(t); + return tileStatus(*t.currentTileProvider, index); } default: throw ghoul::MissingCaseException(); @@ -1612,13 +1598,8 @@ TileDepthTransform depthTransform(TileProvider& tp) { } case Type::TemporalTileProvider: { TemporalTileProvider& t = static_cast(tp); - if (t.successfulInitialization) { - ensureUpdated(t); - return depthTransform(*t.currentTileProvider); - } - else { - return { 1.f, 0.f }; - } + ensureUpdated(t); + return depthTransform(*t.currentTileProvider); } default: throw ghoul::MissingCaseException(); @@ -1630,7 +1611,7 @@ TileDepthTransform depthTransform(TileProvider& tp) { -int update(TileProvider& tp) { +void update(TileProvider& tp) { ZoneScoped switch (tp.type) { @@ -1641,7 +1622,7 @@ int update(TileProvider& tp) { } t.asyncTextureDataProvider->update(); - bool hasUploaded = initTexturesFromLoadedData(t); + initTexturesFromLoadedData(t); if (t.asyncTextureDataProvider->shouldBeDeleted()) { t.asyncTextureDataProvider = nullptr; @@ -1650,9 +1631,6 @@ int update(TileProvider& tp) { tileTextureInitData(t.layerGroupID, t.padTiles, t.tilePixelSize) ); } - if (hasUploaded) { - return 1; - } break; } case Type::SingleImageTileProvider: @@ -1711,21 +1689,18 @@ int update(TileProvider& tp) { } case Type::TemporalTileProvider: { TemporalTileProvider& t = static_cast(tp); - if (t.successfulInitialization) { - TileProvider* newCurr = getTileProvider(t, global::timeManager->time()); - if (newCurr) { - t.currentTileProvider = newCurr; - } - if (t.currentTileProvider) { - update(*t.currentTileProvider); - } + TileProvider* newCurr = getTileProvider(t, global::timeManager->time()); + if (newCurr) { + t.currentTileProvider = newCurr; + } + if (t.currentTileProvider) { + update(*t.currentTileProvider); } break; } default: throw ghoul::MissingCaseException(); } - return 0; } @@ -1829,12 +1804,10 @@ void reset(TileProvider& tp) { } case Type::TemporalTileProvider: { TemporalTileProvider& t = static_cast(tp); - if (t.successfulInitialization) { - using K = TemporalTileProvider::TimeKey; - using V = std::unique_ptr; - for (std::pair& it : t.tileProviderMap) { - reset(*it.second); - } + using K = TemporalTileProvider::TimeKey; + using V = std::unique_ptr; + for (std::pair& it : t.tileProviderMap) { + reset(*it.second); } break; } @@ -1888,13 +1861,8 @@ int maxLevel(TileProvider& tp) { } case Type::TemporalTileProvider: { TemporalTileProvider& t = static_cast(tp); - if (t.successfulInitialization) { - ensureUpdated(t); - return maxLevel(*t.currentTileProvider); - } - else { - return 0; - } + ensureUpdated(t); + return maxLevel(*t.currentTileProvider); } default: throw ghoul::MissingCaseException(); diff --git a/modules/globebrowsing/src/tileprovider.h b/modules/globebrowsing/src/tileprovider.h index c141d8b041..2284b02771 100644 --- a/modules/globebrowsing/src/tileprovider.h +++ b/modules/globebrowsing/src/tileprovider.h @@ -227,7 +227,6 @@ struct TemporalTileProvider : public TileProvider { std::string colormap; std::string myResolution; - bool successfulInitialization = false; std::unique_ptr interpolateTileProvider; }; @@ -267,10 +266,8 @@ TileDepthTransform depthTransform(TileProvider& tp); /** * This method should be called once per frame. Here, TileProviders * are given the opportunity to update their internal state. - * - * \return The number of tiles that have been updated in this call */ -int update(TileProvider& tp); +void update(TileProvider& tp); /** * Provides a uniform way of all TileProviders to reload or From fdd995ba0130caaacd130ee3992aaf561bd748fb Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Dec 2021 00:10:01 +0100 Subject: [PATCH 034/117] No longer require the filenames from a synced resource to start with a / --- data/assets/examples/animation.asset | 10 +- data/assets/examples/approachevents.asset | 2 +- data/assets/examples/globerotation.asset | 2 +- data/assets/examples/globetranslation.asset | 4 +- .../examples/modelshader/modelshader.asset | 2 +- .../examples/temperature_land_highres.asset | 2 +- data/assets/global/openspacebookmarks.asset | 2 +- data/assets/scene/digitaluniverse/2dF.asset | 6 +- data/assets/scene/digitaluniverse/2mass.asset | 6 +- data/assets/scene/digitaluniverse/6dF.asset | 6 +- data/assets/scene/digitaluniverse/abell.asset | 6 +- .../digitaluniverse/alternatestarlabels.asset | 2 +- .../digitaluniverse/backgroundradiation.asset | 8 +- .../scene/digitaluniverse/clusters.asset | 2 +- .../digitaluniverse/constellationbounds.asset | 4 +- .../digitaluniverse/constellations.asset | 8 +- .../scene/digitaluniverse/deepsky.asset | 12 +- .../assets/scene/digitaluniverse/dwarfs.asset | 8 +- .../scene/digitaluniverse/exoplanets.asset | 6 +- .../digitaluniverse/globularclusters.asset | 6 +- data/assets/scene/digitaluniverse/grids.asset | 54 +- .../assets/scene/digitaluniverse/groups.asset | 2 +- .../scene/digitaluniverse/h2regions.asset | 6 +- data/assets/scene/digitaluniverse/hdf.asset | 6 +- .../assets/scene/digitaluniverse/kepler.asset | 4 +- .../scene/digitaluniverse/localdwarfs.asset | 8 +- .../digitaluniverse/milkyway_label.asset | 2 +- .../digitaluniverse/milkyway_sphere.asset | 4 +- .../digitaluniverse/obassociations.asset | 8 +- .../scene/digitaluniverse/openclusters.asset | 6 +- .../digitaluniverse/planetarynebulae.asset | 6 +- .../scene/digitaluniverse/pulsars.asset | 6 +- .../scene/digitaluniverse/quasars.asset | 4 +- data/assets/scene/digitaluniverse/sdss.asset | 6 +- .../scene/digitaluniverse/starlabels.asset | 2 +- .../scene/digitaluniverse/starorbits.asset | 28 +- data/assets/scene/digitaluniverse/stars.asset | 18 +- .../scene/digitaluniverse/superclusters.asset | 6 +- .../digitaluniverse/supernovaremnants.asset | 6 +- data/assets/scene/digitaluniverse/tully.asset | 12 +- data/assets/scene/digitaluniverse/voids.asset | 2 +- .../constellations/constellation_art.asset | 2 +- .../milkyway/exoplanets/exoplanets_data.asset | 2 +- .../exoplanets/exoplanets_textures.asset | 10 +- data/assets/scene/milkyway/gaia/apogee.asset | 10 +- .../gaia/gaia_dr2_download_stars.asset | 2 +- .../scene/milkyway/gaia/gaiastars.asset | 20 +- data/assets/scene/milkyway/gaia/galah.asset | 10 +- data/assets/scene/milkyway/milkyway/eso.asset | 2 +- .../scene/milkyway/milkyway/volume.asset | 6 +- .../objects/orionnebula/cluster.asset | 6 +- .../milkyway/objects/orionnebula/nebula.asset | 6 +- data/assets/scene/milkyway/stars/denver.asset | 6 +- .../dwarf_planets/pluto/charon/charon.asset | 2 +- .../dwarf_planets/pluto/kernels.asset | 6 +- .../dwarf_planets/pluto/pluto.asset | 2 +- .../bastille_day/fluxnodescutplane.asset | 4 +- .../bastille_day/fluxnodeslegend.asset | 2 +- .../interstellar/c-2019_q4_borisov.asset | 4 +- .../solarsystem/interstellar/oumuamua.asset | 4 +- .../missions/apollo/11/apollo11.asset | 6 +- .../missions/apollo/11/kernels.asset | 10 +- .../solarsystem/missions/apollo/11/lem.asset | 4 +- .../missions/apollo/15/apollo15.asset | 2 +- .../missions/apollo/15/kernels.asset | 20 +- .../missions/apollo/17/bouldersstation2.asset | 6 +- .../missions/apollo/17/bouldersstation6.asset | 6 +- .../missions/apollo/17/bouldersstation7.asset | 2 +- .../solarsystem/missions/apollo/17/lem.asset | 2 +- .../missions/apollo/8/kernels.asset | 12 +- .../missions/apollo/8/launch_model.asset | 2 +- .../solarsystem/missions/apollo/8/model.asset | 2 +- .../missions/apollo/insignias_map.asset | 2 +- .../solarsystem/missions/dawn/ceres.asset | 14 +- .../solarsystem/missions/dawn/dawn.asset | 1164 ++++++++--------- .../solarsystem/missions/dawn/vesta.asset | 6 +- .../solarsystem/missions/gaia/gaia.asset | 2 +- .../solarsystem/missions/gaia/trail.asset | 4 +- .../missions/gaia/transforms.asset | 2 +- .../solarsystem/missions/insight/edl.asset | 74 +- .../solarsystem/missions/juno/juno.asset | 210 +-- .../solarsystem/missions/jwst/jwst.asset | 4 +- .../solarsystem/missions/jwst/trail.asset | 6 +- .../missions/jwst/transforms.asset | 4 +- .../messenger/mercurymagnetosphere.asset | 2 +- .../missions/messenger/messengerSC.asset | 58 +- .../missions/newhorizons/charon.asset | 12 +- .../missions/newhorizons/kernels.asset | 50 +- .../missions/newhorizons/model.asset | 2 +- .../missions/newhorizons/othermoons.asset | 8 +- .../missions/newhorizons/pluto.asset | 20 +- .../missions/osirisrex/bennu.asset | 2 +- .../missions/osirisrex/bennu_projection.asset | 2 +- .../missions/osirisrex/imageplane.asset | 2 +- .../missions/osirisrex/kernels.asset | 160 +-- .../missions/osirisrex/model.asset | 6 +- .../missions/perseverance/model.asset | 2 +- .../missions/perseverance/trail.asset | 12 +- .../missions/pioneer/pioneer10.asset | 2 +- .../missions/pioneer/pioneer11.asset | 4 +- .../missions/pioneer/pioneermodel.asset | 2 +- .../solarsystem/missions/rosetta/67p.asset | 6 +- .../missions/rosetta/rosetta.asset | 87 +- .../missions/voyager/voyager1.asset | 20 +- .../missions/voyager/voyager2.asset | 24 +- .../solarsystem/planets/earth/earth.asset | 2 +- .../planets/earth/lagrange_points/L1.asset | 4 +- .../planets/earth/lagrange_points/L2.asset | 4 +- .../planets/earth/lagrange_points/L4.asset | 4 +- .../planets/earth/lagrange_points/L5.asset | 4 +- .../colorlayers/fallbacks/blue_marble.asset | 2 +- .../fallbacks/blue_marble_height.asset | 2 +- .../fallbacks/earth_night_texture.asset | 2 +- .../solarsystem/planets/earth/markers.asset | 2 +- .../solarsystem/planets/earth/moon/moon.asset | 2 +- .../planets/earth/satellites/misc/iss.asset | 4 +- .../planets/jupiter/callisto/callisto.asset | 2 +- .../layers/colorlayers/callisto_texture.asset | 2 +- .../planets/jupiter/europa/europa.asset | 2 +- .../layers/colorlayers/europa_texture.asset | 2 +- .../voyager_global_mosaic_local.asset | 2 +- .../planets/jupiter/ganymede/ganymede.asset | 2 +- .../layers/colorlayers/ganymede_texture.asset | 2 +- .../solarsystem/planets/jupiter/io/io.asset | 2 +- .../io/layers/colorlayers/io_texture.asset | 2 +- .../solarsystem/planets/jupiter/kernels.asset | 4 +- .../layers/colorlayers/jupiter_texture.asset | 2 +- .../colorlayers/fallbacks/mars_texture.asset | 2 +- .../layers/colorlayers/mars_texture.asset | 2 +- .../scene/solarsystem/planets/mars/mars.asset | 2 +- .../planets/mars/moons/deimos.asset | 4 +- .../planets/mars/moons/phobos.asset | 4 +- .../layers/colorlayers/alsimap_02122015.asset | 2 +- .../layers/colorlayers/casimap_02122015.asset | 2 +- .../layers/colorlayers/fesimap_02122015.asset | 2 +- .../layers/colorlayers/mgsimap_02122015.asset | 2 +- .../layers/colorlayers/ssimap_02122015.asset | 2 +- .../solarsystem/planets/mercury/mercury.asset | 2 +- .../solarsystem/planets/neptune/kernels.asset | 8 +- .../layers/colorlayers/neptune_texture.asset | 2 +- .../planets/saturn/dione/dione.asset | 2 +- .../layers/colorlayers/dione_texture.asset | 2 +- .../planets/saturn/enceladus/enceladus.asset | 2 +- .../colorlayers/enceladus_texture.asset | 2 +- .../planets/saturn/hyperion/hyperion.asset | 2 +- .../planets/saturn/iapetus/iapetus.asset | 2 +- .../layers/colorlayers/iapetus_texture.asset | 2 +- .../solarsystem/planets/saturn/kernels.asset | 8 +- .../layers/colorlayers/saturn_texture.asset | 2 +- .../layers/colorlayers/mimas_texture.asset | 2 +- .../planets/saturn/mimas/mimas.asset | 2 +- .../layers/colorlayers/rhea_texture.asset | 2 +- .../planets/saturn/rhea/rhea.asset | 2 +- .../solarsystem/planets/saturn/saturn.asset | 10 +- .../layers/colorlayers/tethys_texture.asset | 2 +- .../planets/saturn/tethys/tethys.asset | 2 +- .../cassini_iss_global_mosaic_4km_local.asset | 2 +- .../planets/saturn/titan/titan.asset | 2 +- .../solarsystem/planets/uranus/kernels.asset | 6 +- .../layers/colorlayers/uranus_texture.asset | 2 +- .../layers/colorlayers/venus_texture.asset | 2 +- .../solarsystem/planets/venus/venus.asset | 2 +- .../scene/solarsystem/sssb/astraea.asset | 4 +- .../scene/solarsystem/sssb/c2019y4atlas.asset | 2 +- .../scene/solarsystem/sssb/sssb_shared.asset | 2 +- .../scene/solarsystem/sssb/swifttuttle.asset | 4 +- .../solarsystem/sssb/tesla_roadster.asset | 4 +- data/assets/scene/solarsystem/sun/glare.asset | 2 +- .../sun/layers/colorlayers/sun_texture.asset | 2 +- .../assets/scene/solarsystem/sun/marker.asset | 2 +- data/assets/spice/base.asset | 2 +- data/assets/sync/everything.asset | 10 - data/assets/util/add_marker.asset | 2 +- data/assets/util/static_server.asset | 2 +- data/assets/util/webgui.asset | 6 +- src/scene/assetmanager.cpp | 4 +- 176 files changed, 1324 insertions(+), 1333 deletions(-) delete mode 100644 data/assets/sync/everything.asset diff --git a/data/assets/examples/animation.asset b/data/assets/examples/animation.asset index 24a66a4d94..2f5bf38af2 100644 --- a/data/assets/examples/animation.asset +++ b/data/assets/examples/animation.asset @@ -22,7 +22,7 @@ local animationLoop = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/BoxAnimated.glb", + GeometryFile = model .. "BoxAnimated.glb", EnableAnimation = true, AnimationMode = "LoopFromStart", AnimationStartTime = StartTime, @@ -56,7 +56,7 @@ local animationLoopInf = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/BoxAnimated.glb", + GeometryFile = model .. "BoxAnimated.glb", EnableAnimation = true, AnimationMode = "LoopInfinitely", AnimationStartTime = StartTime, @@ -90,7 +90,7 @@ local animationOnce = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/BoxAnimated.glb", + GeometryFile = model .. "BoxAnimated.glb", EnableAnimation = true, AnimationMode = "Once", AnimationStartTime = StartTime, @@ -124,7 +124,7 @@ local animationBounceInf = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/BoxAnimated.glb", + GeometryFile = model .. "BoxAnimated.glb", EnableAnimation = true, AnimationMode = "BounceInfinitely", AnimationStartTime = StartTime, @@ -158,7 +158,7 @@ local animationBounce = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/BoxAnimated.glb", + GeometryFile = model .. "BoxAnimated.glb", EnableAnimation = true, AnimationMode = "BounceFromStart", AnimationStartTime = StartTime, diff --git a/data/assets/examples/approachevents.asset b/data/assets/examples/approachevents.asset index 47ddc3281c..ee68a34667 100644 --- a/data/assets/examples/approachevents.asset +++ b/data/assets/examples/approachevents.asset @@ -32,7 +32,7 @@ local obj = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/BoxAnimated.glb", + GeometryFile = model .. "BoxAnimated.glb", ModelScale = 1.0, LightSources = { { diff --git a/data/assets/examples/globerotation.asset b/data/assets/examples/globerotation.asset index f685b0ae5e..c59332b311 100644 --- a/data/assets/examples/globerotation.asset +++ b/data/assets/examples/globerotation.asset @@ -37,7 +37,7 @@ local Example_GlobeRotation = { Renderable = { Type = "RenderableModel", Body = "NEW HORIZONS", - GeometryFile = models .. "/NewHorizonsCleanModel.obj" + GeometryFile = models .. "NewHorizonsCleanModel.obj" }, GUI = { Path = "/Example" diff --git a/data/assets/examples/globetranslation.asset b/data/assets/examples/globetranslation.asset index a61de7e465..a49af06d09 100644 --- a/data/assets/examples/globetranslation.asset +++ b/data/assets/examples/globetranslation.asset @@ -24,7 +24,7 @@ local Example_Fixed_Height = { Renderable = { Type = "RenderableModel", Body = "NEW HORIZONS", - GeometryFile = models .. "/NewHorizonsCleanModel.obj" + GeometryFile = models .. "NewHorizonsCleanModel.obj" }, GUI = { Path = "/Example" @@ -46,7 +46,7 @@ local Example_Adaptive_Height = { Renderable = { Type = "RenderableModel", Body = "NEW HORIZONS", - GeometryFile = models .. "/NewHorizonsCleanModel.obj" + GeometryFile = models .. "NewHorizonsCleanModel.obj" }, GUI = { Path = "/Example" diff --git a/data/assets/examples/modelshader/modelshader.asset b/data/assets/examples/modelshader/modelshader.asset index 3fafbb7184..fa5cea97a7 100644 --- a/data/assets/examples/modelshader/modelshader.asset +++ b/data/assets/examples/modelshader/modelshader.asset @@ -20,7 +20,7 @@ local model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/BoxAnimated.glb", + GeometryFile = model .. "BoxAnimated.glb", ModelScale = 3E7, LightSources = { { diff --git a/data/assets/examples/temperature_land_highres.asset b/data/assets/examples/temperature_land_highres.asset index a5a07af757..0015da8ac8 100644 --- a/data/assets/examples/temperature_land_highres.asset +++ b/data/assets/examples/temperature_land_highres.asset @@ -17,7 +17,7 @@ local layer = { "1990-10-01" .. "1M" .. "YYYY-MM-DD" .. - "" .. path .. "/rainbow.png" .. + "" .. path .. "rainbow.png" .. "linear" .. "" .. path .. "/${OpenSpaceTimeId}-land.png" .. "", diff --git a/data/assets/global/openspacebookmarks.asset b/data/assets/global/openspacebookmarks.asset index 2d3893d1a3..1c591050c8 100644 --- a/data/assets/global/openspacebookmarks.asset +++ b/data/assets/global/openspacebookmarks.asset @@ -15,7 +15,7 @@ local bookmarksCSV = asset.syncedResource({ local nodes = {} asset.onInitialize(function () - nodes = bookmarkHelper.getBookmarks('OpenSpace Bookmarks', bookmarksCSV .. '/bookmarks.csv') + nodes = bookmarkHelper.getBookmarks('OpenSpace Bookmarks', bookmarksCSV .. 'bookmarks.csv') for _, n in ipairs(nodes) do openspace.addSceneGraphNode(n); end diff --git a/data/assets/scene/digitaluniverse/2dF.asset b/data/assets/scene/digitaluniverse/2dF.asset index 4c881fe192..0c37d3dfec 100644 --- a/data/assets/scene/digitaluniverse/2dF.asset +++ b/data/assets/scene/digitaluniverse/2dF.asset @@ -23,10 +23,10 @@ local object = { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 1.0, - File = speck .. "/2dF.speck", + File = speck .. "2dF.speck", Unit = "Mpc", - Texture = textures .. "/point3A.png", - ColorMap = speck .. "/2dF.cmap", + Texture = textures .. "point3A.png", + ColorMap = speck .. "2dF.cmap", ColorOption = { "redshift", "proximity" }, ColorRange = { { 0.0, 0.075 }, { 1.0, 25.0 } }, ScaleFactor = 520.0, diff --git a/data/assets/scene/digitaluniverse/2mass.asset b/data/assets/scene/digitaluniverse/2mass.asset index 5e5cfa091d..f86ba14f8b 100644 --- a/data/assets/scene/digitaluniverse/2mass.asset +++ b/data/assets/scene/digitaluniverse/2mass.asset @@ -23,10 +23,10 @@ local object = { Enabled = false, Color = { 1.0, 0.4, 0.2 }, Opacity = 1.0, - File = speck .. "/2MASS.speck", + File = speck .. "2MASS.speck", Unit = "Mpc", - Texture = textures .. "/point3A.png", - ColorMap = speck .. "/lss.cmap", + Texture = textures .. "point3A.png", + ColorMap = speck .. "lss.cmap", ColorOption = { "redshift", "prox5Mpc" }, ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } }, CorrectionSizeEndDistance = 20.6, diff --git a/data/assets/scene/digitaluniverse/6dF.asset b/data/assets/scene/digitaluniverse/6dF.asset index 90f9ed8634..c58ebe8bf4 100644 --- a/data/assets/scene/digitaluniverse/6dF.asset +++ b/data/assets/scene/digitaluniverse/6dF.asset @@ -23,10 +23,10 @@ local object = { Enabled = false, Color = { 1.0, 1.0, 0.0 }, Opacity = 1.0, - File = speck .. "/6dF.speck", + File = speck .. "6dF.speck", Unit = "Mpc", - Texture = textures .. "/point3A.png", - ColorMap = speck .. "/6dF.cmap", + Texture = textures .. "point3A.png", + ColorMap = speck .. "6dF.cmap", ColorOption = { "redshift", "proximity" }, ColorRange = { { 0.0, 0.075 }, { 1.0, 10.0 } }, ScaleFactor = 534.0, diff --git a/data/assets/scene/digitaluniverse/abell.asset b/data/assets/scene/digitaluniverse/abell.asset index 38863eba9d..a4b7395a11 100644 --- a/data/assets/scene/digitaluniverse/abell.asset +++ b/data/assets/scene/digitaluniverse/abell.asset @@ -24,9 +24,9 @@ local object = { Color = { 1.0, 0.4, 0.2 }, Opacity = 1.0, --ColorMap = speck .. "/abell.cmap", - File = speck .. "/abell.speck", - Texture = textures .. "/point3A.png", - LabelFile = speck .. "/abell.label", + File = speck .. "abell.speck", + Texture = textures .. "point3A.png", + LabelFile = speck .. "abell.label", Unit = "Mpc", TextColor = { 0.0, 0.8, 0.0 }, TextSize = 22, diff --git a/data/assets/scene/digitaluniverse/alternatestarlabels.asset b/data/assets/scene/digitaluniverse/alternatestarlabels.asset index 5e19b98207..23d6a5f50d 100644 --- a/data/assets/scene/digitaluniverse/alternatestarlabels.asset +++ b/data/assets/scene/digitaluniverse/alternatestarlabels.asset @@ -16,7 +16,7 @@ local object = { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, - LabelFile = speck .. "/stars-altlbl.label", + LabelFile = speck .. "stars-altlbl.label", Unit = "pc", TextColor = { 0.4, 0.4, 0.4 }, DrawLabels = true, diff --git a/data/assets/scene/digitaluniverse/backgroundradiation.asset b/data/assets/scene/digitaluniverse/backgroundradiation.asset index b2f6908637..72d77bb0fb 100644 --- a/data/assets/scene/digitaluniverse/backgroundradiation.asset +++ b/data/assets/scene/digitaluniverse/backgroundradiation.asset @@ -22,7 +22,7 @@ local wmap = { Size = 3975.41417036064E23, Segments = 80, Opacity = 0.5, - Texture = textures .. "/wmap_ilc_7yr_v4_200uK_RGB_sos.png", + Texture = textures .. "wmap_ilc_7yr_v4_200uK_RGB_sos.png", Orientation = "Both", MirrorTexture = true, UseAdditiveBlending = true, @@ -48,7 +48,7 @@ local cbe = { Size = 3975.41417036064E23, Segments = 80, Opacity = 0.5, - Texture = textures .. "/COBErect.png", + Texture = textures .. "COBErect.png", Orientation = "Both", MirrorTexture = true, UseAdditiveBlending = true, @@ -74,7 +74,7 @@ local planck = { Size = 3975.41417036064E23, Segments = 80, Opacity = 0.3, - Texture = textures .. "/cmb4k.jpg", + Texture = textures .. "cmb4k.jpg", Orientation = "Both", MirrorTexture = true, UseAdditiveBlending = true, @@ -101,7 +101,7 @@ local Halpha = { Size = 9.2E21, Segments = 40, Opacity = 0.4, - Texture = textures .. "/mwHalpha-f.png", + Texture = textures .. "mwHalpha-f.png", Orientation = "Inside", UseAdditiveBlending = true, MirrorTexture = true, diff --git a/data/assets/scene/digitaluniverse/clusters.asset b/data/assets/scene/digitaluniverse/clusters.asset index 03c232a957..5f6c4835f1 100644 --- a/data/assets/scene/digitaluniverse/clusters.asset +++ b/data/assets/scene/digitaluniverse/clusters.asset @@ -16,7 +16,7 @@ local object = { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, - LabelFile = speck .. "/galclust.label", + LabelFile = speck .. "galclust.label", Unit = "Mpc", TextColor = { 1.0, 0.44, 0.0 }, DrawLabels = true, diff --git a/data/assets/scene/digitaluniverse/constellationbounds.asset b/data/assets/scene/digitaluniverse/constellationbounds.asset index 8987fd2407..517a2e2684 100644 --- a/data/assets/scene/digitaluniverse/constellationbounds.asset +++ b/data/assets/scene/digitaluniverse/constellationbounds.asset @@ -19,8 +19,8 @@ local object = { Renderable = { Type = "RenderableConstellationBounds", Enabled = false, - File = data .. "/bound_20.dat", - ConstellationFile = data .. "/constellations.dat" + File = data .. "bound_20.dat", + ConstellationFile = data .. "constellations.dat" -- ConstellationSelection = zodiacs }, Transform = { diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index a96db07f75..2fc48498f2 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -15,8 +15,8 @@ local constellationsExtragalactic = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/constellationsEXGAL.speck", - LabelFile = speck .. "/constellationsEXGAL.label", + File = speck .. "constellationsEXGAL.speck", + LabelFile = speck .. "constellationsEXGAL.label", TextColor = { 0.8, 0.8, 0.8 }, TextOpacity = 0.4, TextSize = 20.0, @@ -36,8 +36,8 @@ local constellations = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.3, - File = speck .. "/constellations.speck", - LabelFile = speck .. "/constellations.label", + File = speck .. "constellations.speck", + LabelFile = speck .. "constellations.label", TextColor = { 0.8, 0.8, 0.8 }, TextOpacity = 0.3, TextSize = 14.5, diff --git a/data/assets/scene/digitaluniverse/deepsky.asset b/data/assets/scene/digitaluniverse/deepsky.asset index b8d91282b0..618c671b30 100644 --- a/data/assets/scene/digitaluniverse/deepsky.asset +++ b/data/assets/scene/digitaluniverse/deepsky.asset @@ -22,14 +22,14 @@ local deepSkyPoints = { Color = { 1.0, 1.0, 0.0 }, Opacity = 0.99, ScaleFactor = 500.0, - File = speck .. "/dso.speck", - Texture = textures .. "/point3.png", - --ColorMap = speck .. "/tully.cmap", - --ColorMap = speck .. "/lss.cmap", + File = speck .. "dso.speck", + Texture = textures .. "point3.png", + --ColorMap = speck .. "tully.cmap", + --ColorMap = speck .. "lss.cmap", --ColorOption = { "proximity" }, --ColorOption = { "prox5Mpc" }, --ColorRange = { { 1.0, 30.0 } }, - LabelFile = speck .. "/dso.label", + LabelFile = speck .. "dso.label", Unit = "pc", TextColor = { 0.1, 0.4, 0.6 }, TextSize = 20.50, @@ -61,7 +61,7 @@ local deepSkyImages = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.99, ScaleFactor = 1.0, - File = speck .. "/dso.speck", + File = speck .. "dso.speck", TexturePath = textures, Luminosity = "radius", ScaleLuminosity = 0.001, diff --git a/data/assets/scene/digitaluniverse/dwarfs.asset b/data/assets/scene/digitaluniverse/dwarfs.asset index c4922feb04..0b37e59bf9 100644 --- a/data/assets/scene/digitaluniverse/dwarfs.asset +++ b/data/assets/scene/digitaluniverse/dwarfs.asset @@ -23,11 +23,11 @@ local object = { Enabled = false, Color = { 0.4, 0.0, 0.1 }, Opacity = 1.0, - File = speck .. "/dwarfs.speck", - Texture = textures .. "/point3.png", - LabelFile = speck .. "/dwarfs.label", + File = speck .. "dwarfs.speck", + Texture = textures .. "point3.png", + LabelFile = speck .. "dwarfs.label", Unit = "pc", - ColorMap = speck .. "/dwarfs.cmap", + ColorMap = speck .. "dwarfs.cmap", ColorOption = { "typeindex" }, --ColorRange = { { 1.0, 4.0} }, TextColor = { 0.5, 0.1, 0.2 }, diff --git a/data/assets/scene/digitaluniverse/exoplanets.asset b/data/assets/scene/digitaluniverse/exoplanets.asset index 27ccda1a29..4a37ecebc7 100644 --- a/data/assets/scene/digitaluniverse/exoplanets.asset +++ b/data/assets/scene/digitaluniverse/exoplanets.asset @@ -24,9 +24,9 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 1.0, ScaleFactor = 10.0, - Texture = textures .. "/target-blue.png", - File = speck .. "/expl.speck", - LabelFile = speck .. "/expl.label", + Texture = textures .. "target-blue.png", + File = speck .. "expl.speck", + LabelFile = speck .. "expl.label", Unit = "pc", ScaleFactor = 388.67923, TextColor = { 0.3, 0.3, 0.8 }, diff --git a/data/assets/scene/digitaluniverse/globularclusters.asset b/data/assets/scene/digitaluniverse/globularclusters.asset index 77e85d35c5..b4f4a0bd9e 100644 --- a/data/assets/scene/digitaluniverse/globularclusters.asset +++ b/data/assets/scene/digitaluniverse/globularclusters.asset @@ -23,10 +23,10 @@ local object = { Enabled = false, Color = { 0.8, 0.8, 0.0 }, Opacity = 0.4, - File = speck .. "/gc.speck", - Texture = textures .. "/point4.png", + File = speck .. "gc.speck", + Texture = textures .. "point4.png", PolygonSides = 5, - LabelFile = speck .. "/gc.label", + LabelFile = speck .. "gc.label", Unit = "pc", TextColor = { 0.5, 0.5, 0.0 }, ScaleFactor = 431.0, diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index 9ba8ad9a53..fd66c34487 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -109,7 +109,7 @@ local eclipticLabels = { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, - LabelFile = speck .. "/eclip.label", + LabelFile = speck .. "eclip.label", Unit = "pc", DrawLabels = true, TextColor = { 0.5, 0.5, 0.5 }, @@ -162,7 +162,7 @@ local equatorialLabels = { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, - LabelFile = speck .. "/radec.label", + LabelFile = speck .. "radec.label", Unit = "pc", DrawLabels = true, TextColor = { 0.5, 0.5, 0.5 }, @@ -211,7 +211,7 @@ local galacticLabels = { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, - LabelFile = speck .. "/galac.label", + LabelFile = speck .. "galac.label", Unit = "pc", DrawLabels = true, TextColor = { 0.5, 0.5, 0.5 }, @@ -237,9 +237,9 @@ local plane1ld = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/1ld.speck", + File = speck .. "1ld.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/1ld.label", + LabelFile = speck .. "1ld.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 10.3, TextMinMaxSize = { 0, 30 }, @@ -264,9 +264,9 @@ local plane1lm = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/1lm.speck", + File = speck .. "1lm.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/1lm.label", + LabelFile = speck .. "1lm.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 11.8, TextMinMaxSize = { 0, 30 }, @@ -291,9 +291,9 @@ local plane1ly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/1ly.speck", + File = speck .. "1ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/1ly.label", + LabelFile = speck .. "1ly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 13.0, TextMinMaxSize = { 0, 30 }, @@ -318,9 +318,9 @@ local plane10ly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/10ly.speck", + File = speck .. "10ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/10ly.label", + LabelFile = speck .. "10ly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 14.17, TextMinMaxSize = { 0, 30 }, @@ -345,9 +345,9 @@ local plane100ly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/100ly.speck", + File = speck .. "100ly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/100ly.label", + LabelFile = speck .. "100ly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 15.0, TextMinMaxSize = { 0, 30 }, @@ -372,9 +372,9 @@ local plane1kly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/1kly.speck", + File = speck .. "1kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/1kly.label", + LabelFile = speck .. "1kly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 16.0, TextMinMaxSize = { 0, 30 }, @@ -399,9 +399,9 @@ local plane10kly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/10kly.speck", + File = speck .. "10kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/10kly.label", + LabelFile = speck .. "10kly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 17.25, TextMinMaxSize = { 0, 30 }, @@ -419,9 +419,9 @@ local plane100kly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/100kly.speck", + File = speck .. "100kly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/100kly.label", + LabelFile = speck .. "100kly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 18.6, TextMinMaxSize = { 0, 30 }, @@ -439,9 +439,9 @@ local plane1Mly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/1Mly.speck", + File = speck .. "1Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/1Mly.label", + LabelFile = speck .. "1Mly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 19.6, TextMinMaxSize = { 0, 30 }, @@ -459,9 +459,9 @@ local plane10Mly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/10Mly.speck", + File = speck .. "10Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/10Mly.label", + LabelFile = speck .. "10Mly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 20.6, TextMinMaxSize = { 0, 30 }, @@ -479,9 +479,9 @@ local plane100Mly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/100Mly.speck", + File = speck .. "100Mly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/100Mly.label", + LabelFile = speck .. "100Mly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 21.6, TextMinMaxSize = { 0, 30 }, @@ -499,9 +499,9 @@ local plane20Gly = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 0.4, - File = speck .. "/20Gly.speck", + File = speck .. "20Gly.speck", MeshColor = {{ 0.1, 0.5, 0.6 }}, - LabelFile = speck .. "/20Gly.label", + LabelFile = speck .. "20Gly.label", TextColor = { 0.0, 0.2, 0.5 }, TextSize = 23.6, TextMinMaxSize = { 0, 30 }, diff --git a/data/assets/scene/digitaluniverse/groups.asset b/data/assets/scene/digitaluniverse/groups.asset index ed426cbdd2..e24689c384 100644 --- a/data/assets/scene/digitaluniverse/groups.asset +++ b/data/assets/scene/digitaluniverse/groups.asset @@ -17,7 +17,7 @@ local object = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, --ScaleFactor = 10.0, - LabelFile = speck .. "/groups.label", + LabelFile = speck .. "groups.label", Unit = "Mpc", TextColor = { 0.1, 0.6, 0.2 }, TextSize = 21.5, diff --git a/data/assets/scene/digitaluniverse/h2regions.asset b/data/assets/scene/digitaluniverse/h2regions.asset index 9648f7d088..f333273608 100644 --- a/data/assets/scene/digitaluniverse/h2regions.asset +++ b/data/assets/scene/digitaluniverse/h2regions.asset @@ -23,10 +23,10 @@ local object = { Enabled = false, Color = { 0.0, 0.5, 1.0 }, Opacity = 0.70, - File = speck .. "/h2.speck", - Texture = textures .."/point4.png", + File = speck .. "h2.speck", + Texture = textures .."point4.png", PolygonSides = 6, - LabelFile = speck .. "/h2.label", + LabelFile = speck .. "h2.label", Unit = "pc", TextColor = { 0.5, 0.5, 0.5 }, ScaleFactor = 420, diff --git a/data/assets/scene/digitaluniverse/hdf.asset b/data/assets/scene/digitaluniverse/hdf.asset index c943e1542f..45483e4672 100644 --- a/data/assets/scene/digitaluniverse/hdf.asset +++ b/data/assets/scene/digitaluniverse/hdf.asset @@ -28,9 +28,9 @@ local object = { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 1.0, - File = HUDFSpeck .. "/hudf.speck", - Texture = circle .. "/circle.png", - ColorMap = ColorMap .. "/hudf.cmap", + File = HUDFSpeck .. "hudf.speck", + Texture = circle .. "circle.png", + ColorMap = ColorMap .. "hudf.cmap", ColorOption = { "redshift", "proximity" }, ColorRange = { { 0.0, 0.075 }, { 1.0, 25.0 } }, Unit = "Mpc", diff --git a/data/assets/scene/digitaluniverse/kepler.asset b/data/assets/scene/digitaluniverse/kepler.asset index d07868db17..68e2db1e9a 100644 --- a/data/assets/scene/digitaluniverse/kepler.asset +++ b/data/assets/scene/digitaluniverse/kepler.asset @@ -24,9 +24,9 @@ local object = { Color = { 1.0, 1.0, 0.0 }, Opacity = 0.99, ScaleFactor = 410.0, - File = speck .. "/kepler.speck", + File = speck .. "kepler.speck", Unit = "pc", - Texture = textures .. "/halo.png", + Texture = textures .. "halo.png", CorrectionSizeEndDistance = 15.86, CorrectionSizeFactor = 8.59, BillboardMinMaxSize = { 0.0, 30.0 }, diff --git a/data/assets/scene/digitaluniverse/localdwarfs.asset b/data/assets/scene/digitaluniverse/localdwarfs.asset index ac23ad0dc6..9619f0d762 100644 --- a/data/assets/scene/digitaluniverse/localdwarfs.asset +++ b/data/assets/scene/digitaluniverse/localdwarfs.asset @@ -22,13 +22,13 @@ local object = { Type = "RenderableBillboardsCloud", Enabled = false, Color = { 0.5, 1.0, 0.2 }, - ColorMap = speck .. "/localgroup.cmap", + ColorMap = speck .. "localgroup.cmap", ColorOption = { "association" }, Opacity = 0.3, - File = speck .. "/localgroup.speck", - Texture = textures .. "/point4.png", + File = speck .. "localgroup.speck", + Texture = textures .. "point4.png", PolygonSides = 12, - LabelFile = speck .. "/localgroup.label", + LabelFile = speck .. "localgroup.label", Unit = "Mpc", TextColor = { 0.3, 0.3, 1.0 }, ScaleFactor = 465, diff --git a/data/assets/scene/digitaluniverse/milkyway_label.asset b/data/assets/scene/digitaluniverse/milkyway_label.asset index 60908e0a35..5d4e5405bf 100644 --- a/data/assets/scene/digitaluniverse/milkyway_label.asset +++ b/data/assets/scene/digitaluniverse/milkyway_label.asset @@ -19,7 +19,7 @@ local homeLabel = { Opacity = 0.99, ScaleFactor = 500.0, DrawLabels = true, - LabelFile = homespeck .. "/home.label", + LabelFile = homespeck .. "home.label", Unit = "Mpc", TextColor = { 0.8, 0.8, 0.8 }, TextSize = 20.50, diff --git a/data/assets/scene/digitaluniverse/milkyway_sphere.asset b/data/assets/scene/digitaluniverse/milkyway_sphere.asset index 2857777793..db8348e4cd 100644 --- a/data/assets/scene/digitaluniverse/milkyway_sphere.asset +++ b/data/assets/scene/digitaluniverse/milkyway_sphere.asset @@ -15,7 +15,7 @@ local sphere = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = {0, 0, 3.14159265359} + Rotation = { 0, 0, 3.14159265359 } } }, Renderable = { @@ -23,7 +23,7 @@ local sphere = { Size = 9.2E21, Segments = 40, Opacity = 0.35, - Texture = sphereTextures .. "/DarkUniverse_mellinger_4k.jpg", + Texture = sphereTextures .. "DarkUniverse_mellinger_4k.jpg", Orientation = "Inside", UseAdditiveBlending = true, MirrorTexture = true, diff --git a/data/assets/scene/digitaluniverse/obassociations.asset b/data/assets/scene/digitaluniverse/obassociations.asset index 1339706042..7d878d5b3b 100644 --- a/data/assets/scene/digitaluniverse/obassociations.asset +++ b/data/assets/scene/digitaluniverse/obassociations.asset @@ -22,16 +22,16 @@ local object = { Type = "RenderableBillboardsCloud", Enabled = false, Color = { 1.0, 1.0, 1.0 }, - ColorMap = speck .. "/ob.cmap", + ColorMap = speck .. "ob.cmap", ColorOption = { "arm" }, SizeOption = { "diameter" }, ExactColorMap = true, Opacity = 0.7, - File = speck .. "/ob.speck", + File = speck .. "ob.speck", Unit = "pc", - Texture = textures .. "/point4.png", + Texture = textures .. "point4.png", PolygonSides = 7, - LabelFile = speck .. "/ob.label", + LabelFile = speck .. "ob.label", TextColor = { 0.4, 0.5, 1.0 }, ScaleFactor = 390.0, TextSize = 16.24, diff --git a/data/assets/scene/digitaluniverse/openclusters.asset b/data/assets/scene/digitaluniverse/openclusters.asset index bb4ae711e5..a3d800cc40 100644 --- a/data/assets/scene/digitaluniverse/openclusters.asset +++ b/data/assets/scene/digitaluniverse/openclusters.asset @@ -23,12 +23,12 @@ local object = { Enabled = false, Color = { 0.1, 0.8, 0.4 }, Opacity = 0.5, - File = speck .. "/oc.speck", + File = speck .. "oc.speck", Unit = "pc", - Texture = textures .. "/point4.png", + Texture = textures .. "point4.png", PolygonSides = 12, TextColor = { 0.05, 0.4, 0.2 }, - LabelFile = speck .. "/oc.label", + LabelFile = speck .. "oc.label", ScaleFactor = 405.75, TextSize = 15.5, TextMinMaxSize = { 4, 30 }, diff --git a/data/assets/scene/digitaluniverse/planetarynebulae.asset b/data/assets/scene/digitaluniverse/planetarynebulae.asset index c2a0c107d2..83d9b7f3d6 100644 --- a/data/assets/scene/digitaluniverse/planetarynebulae.asset +++ b/data/assets/scene/digitaluniverse/planetarynebulae.asset @@ -23,10 +23,10 @@ local object = { Enabled = false, Color = { 0.4, 0.4, 0.9 }, Opacity = 0.65, - File = speck .. "/pn.speck", - Texture = textures .. "/point4.png", + File = speck .. "pn.speck", + Texture = textures .. "point4.png", PolygonSides = 3, - LabelFile = speck .. "/pn.label", + LabelFile = speck .. "pn.label", Unit = "pc", TextColor = { 0.25, 0.25, 0.65 }, ScaleFactor = 425.0, diff --git a/data/assets/scene/digitaluniverse/pulsars.asset b/data/assets/scene/digitaluniverse/pulsars.asset index 6e122a3336..46b61b397c 100644 --- a/data/assets/scene/digitaluniverse/pulsars.asset +++ b/data/assets/scene/digitaluniverse/pulsars.asset @@ -23,10 +23,10 @@ local object = { Enabled = false, Color = { 0.7, 0.0, 0.0 }, Opacity = 1.0, - File = speck .. "/pulsar.speck", - Texture = textures .. "/point4.png", + File = speck .. "pulsar.speck", + Texture = textures .. "point4.png", PolygonSides = 4, - LabelFile = speck .. "/pulsar.label", + LabelFile = speck .. "pulsar.label", Unit = "pc", TextColor = { 0.7, 0.2, 0.2 }, ScaleFactor = 424, diff --git a/data/assets/scene/digitaluniverse/quasars.asset b/data/assets/scene/digitaluniverse/quasars.asset index 3ec14ef05b..6591ab5456 100644 --- a/data/assets/scene/digitaluniverse/quasars.asset +++ b/data/assets/scene/digitaluniverse/quasars.asset @@ -23,8 +23,8 @@ local object = { Enabled = true, Color = { 1.0, 0.4, 0.2 }, Opacity = 0.95, - File = speck .. "/quasars.speck", - Texture = textures .. "/point3A.png", + File = speck .. "quasars.speck", + Texture = textures .. "point3A.png", Unit = "Mpc", ScaleFactor = 540.9, FadeInDistances = { 1000.0, 10000.0 }, -- Fade in value in the same unit as "Unit" diff --git a/data/assets/scene/digitaluniverse/sdss.asset b/data/assets/scene/digitaluniverse/sdss.asset index de7391eba0..12f5527dc9 100644 --- a/data/assets/scene/digitaluniverse/sdss.asset +++ b/data/assets/scene/digitaluniverse/sdss.asset @@ -24,11 +24,11 @@ local object = { Color = { 0.8, 0.8, 1.0 }, Opacity = 0.8, ScaleFactor = 520.0, - File = speck .. "/SDSSgals.speck", - ColorMap = speck .. "/SDSSgals.cmap", + File = speck .. "SDSSgals.speck", + ColorMap = speck .. "SDSSgals.cmap", ColorOption = { "redshift", "proximity" }, ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } }, - Texture = textures .. "/point3A.png", + Texture = textures .. "point3A.png", Unit = "Mpc", FadeInDistances = { 220.0, 650.0 }, -- Fade in value in the same unit as "Unit" BillboardMinMaxSize = { 0.0, 5.5 }, diff --git a/data/assets/scene/digitaluniverse/starlabels.asset b/data/assets/scene/digitaluniverse/starlabels.asset index 387975abbd..42c54d2524 100644 --- a/data/assets/scene/digitaluniverse/starlabels.asset +++ b/data/assets/scene/digitaluniverse/starlabels.asset @@ -16,7 +16,7 @@ local object = { Enabled = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, - LabelFile = speck .. "/stars.label", + LabelFile = speck .. "stars.label", Unit = "pc", TextColor = { 0.4, 0.4, 0.4 }, DrawLabels = true, diff --git a/data/assets/scene/digitaluniverse/starorbits.asset b/data/assets/scene/digitaluniverse/starorbits.asset index d79d96d2fa..685581f534 100644 --- a/data/assets/scene/digitaluniverse/starorbits.asset +++ b/data/assets/scene/digitaluniverse/starorbits.asset @@ -17,9 +17,9 @@ local sunOrbit = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 1.0, - File = speck .. "/starorbits-Sun.speck", + File = speck .. "starorbits-Sun.speck", MeshColor = {{ 1.0, 0.65, 0.0 }}, - --LabelFile = speck .. "/1ld.label", + --LabelFile = speck .. "1ld.label", -- TextColor = { 0.0, 0.2, 0.5 }, -- TextMinMaxSize = { 0, 30 }, Unit = "pc" @@ -38,9 +38,9 @@ local barnardsOrbit = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 1.0, - File = speck .. "/starorbits-BarnardsStar.speck", + File = speck .. "starorbits-BarnardsStar.speck", MeshColor = {{0.39, 0.58, 0.93}}, - --LabelFile = speck .. "/1ld.label", + --LabelFile = speck .. "1ld.label", -- TextColor = { 0.0, 0.2, 0.5 }, -- TextSize = 10.3, -- TextMinMaxSize = { 0, 30 }, @@ -60,9 +60,9 @@ local kapteynsOrbit = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 1.0, - File = speck .. "/starorbits-KapteynsStar.speck", + File = speck .. "starorbits-KapteynsStar.speck", MeshColor = {{0.6, 0.6, 0.6}}, - --LabelFile = speck .. "/1ld.label", + --LabelFile = speck .. "1ld.label", -- TextColor = { 0.0, 0.2, 0.5 }, -- TextSize = 10.3, -- TextMinMaxSize = { 0, 30 }, @@ -82,9 +82,9 @@ local lacaille9352Orbit = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 1.0, - File = speck .. "/starorbits-Lacaille9352.speck", + File = speck .. "starorbits-Lacaille9352.speck", MeshColor = {{0.58, 0.0, 0.83}}, - --LabelFile = speck .. "/1ld.label", + --LabelFile = speck .. "1ld.label", -- TextColor = { 0.0, 0.2, 0.5 }, -- TextSize = 10.3, -- TextMinMaxSize = { 0, 30 }, @@ -104,9 +104,9 @@ local lSR1826Orbit = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 1.0, - File = speck .. "/starorbits-LSR1826+3014.speck", + File = speck .. "starorbits-LSR1826+3014.speck", MeshColor = {{0.0, 0.39, 0.0}}, - --LabelFile = speck .. "/1ld.label", + --LabelFile = speck .. "1ld.label", -- TextColor = { 0.0, 0.2, 0.5 }, -- TextSize = 10.3, -- TextMinMaxSize = { 0, 30 }, @@ -126,9 +126,9 @@ local lSRJ0822Orbit = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 1.0, - File = speck .. "/starorbits-LSRJ0822+1700.speck", + File = speck .. "starorbits-LSRJ0822+1700.speck", MeshColor = {{0.5, 1.0, 0.0}}, - --LabelFile = speck .. "/1ld.label", + --LabelFile = speck .. "1ld.label", -- TextColor = { 0.0, 0.2, 0.5 }, -- TextSize = 10.3, -- TextMinMaxSize = { 0, 30 }, @@ -148,9 +148,9 @@ local pM_J13420Orbit = { Type = "RenderableDUMeshes", Enabled = false, Opacity = 1.0, - File = speck .. "/starorbits-PM_J13420-3415.speck", + File = speck .. "starorbits-PM_J13420-3415.speck", MeshColor = {{0.70, 0.13, 0.13}}, - --LabelFile = speck .. "/1ld.label", + --LabelFile = speck .. "1ld.label", -- TextColor = { 0.0, 0.2, 0.5 }, -- TextSize = 10.3, -- TextMinMaxSize = { 0, 30 }, diff --git a/data/assets/scene/digitaluniverse/stars.asset b/data/assets/scene/digitaluniverse/stars.asset index 77624e5725..35ec3cf742 100644 --- a/data/assets/scene/digitaluniverse/stars.asset +++ b/data/assets/scene/digitaluniverse/stars.asset @@ -21,11 +21,11 @@ local stars = { Identifier = "Stars", Renderable = { Type = "RenderableStars", - File = speck .. "/stars.speck", - Texture = textures .. "/halo.png", - --ShapeTexture = textures .. "/disc.png", - ColorMap = colormaps .. "/colorbv.cmap", - OtherDataColorMap = colormaps .. "/viridis.cmap", + File = speck .. "stars.speck", + Texture = textures .. "halo.png", + --ShapeTexture = textures .. "disc.png", + ColorMap = colormaps .. "colorbv.cmap", + OtherDataColorMap = colormaps .. "viridis.cmap", MagnitudeExponent = 6.2, SizeComposition = "Distance Modulus", RenderMethod = "Texture Based", -- or PSF @@ -57,10 +57,10 @@ local sunstar = { Identifier = "SunStar", Renderable = { Type = "RenderableStars", - File = sunspeck .. "/sunstar.speck", - Texture = textures .. "/halo.png", - --ShapeTexture = textures .. "/disc.png", - ColorMap = colormaps .. "/colorbv.cmap", + File = sunspeck .. "sunstar.speck", + Texture = textures .. "halo.png", + --ShapeTexture = textures .. "disc.png", + ColorMap = colormaps .. "colorbv.cmap", MagnitudeExponent = 6.2, SizeComposition = "Distance Modulus", RenderMethod = "Texture Based", -- or PSF diff --git a/data/assets/scene/digitaluniverse/superclusters.asset b/data/assets/scene/digitaluniverse/superclusters.asset index facc29d313..ccd95d0a4a 100644 --- a/data/assets/scene/digitaluniverse/superclusters.asset +++ b/data/assets/scene/digitaluniverse/superclusters.asset @@ -24,9 +24,9 @@ local object = { DrawElements = false, Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, - File = speck .. "/superclust.speck", - Texture = textures .. "/point3A.png", - LabelFile = speck .. "/superclust.label", + File = speck .. "superclust.speck", + Texture = textures .. "point3A.png", + LabelFile = speck .. "superclust.label", Unit = "Mpc", TextColor = { 0.9, 0.9, 0.9 }, ScaleFactor = 531.0, diff --git a/data/assets/scene/digitaluniverse/supernovaremnants.asset b/data/assets/scene/digitaluniverse/supernovaremnants.asset index efa2c2844f..8d6b781f38 100644 --- a/data/assets/scene/digitaluniverse/supernovaremnants.asset +++ b/data/assets/scene/digitaluniverse/supernovaremnants.asset @@ -23,10 +23,10 @@ local object = { Enabled = false, Color = { 1.0, 0.5, 0.0 }, Opacity = 0.32, - File = speck .. "/snr.speck", - Texture = textures .. "/point4.png", + File = speck .. "snr.speck", + Texture = textures .. "point4.png", PolygonSides = 7, - LabelFile = speck .. "/snr.label", + LabelFile = speck .. "snr.label", Unit = "pc", TextColor = { 0.6, 0.46, 0.0 }, ScaleFactor = 424, diff --git a/data/assets/scene/digitaluniverse/tully.asset b/data/assets/scene/digitaluniverse/tully.asset index d06deb8a4c..b43b368c49 100644 --- a/data/assets/scene/digitaluniverse/tully.asset +++ b/data/assets/scene/digitaluniverse/tully.asset @@ -24,14 +24,14 @@ local tullyPoints = { Color = { 1.0, 0.4, 0.2 }, Opacity = 0.99, ScaleFactor = 504.0, - File = speck .. "/tully.speck", - Texture = textures .. "/point3A.png", - --ColorMap = speck .. "/tully.cmap", - ColorMap = speck .. "/lss.cmap", + File = speck .. "tully.speck", + Texture = textures .. "point3A.png", + --ColorMap = speck .. "tully.cmap", + ColorMap = speck .. "lss.cmap", --ColorOption = { "proximity" }, ColorOption = { "prox5Mpc" }, ColorRange = { { 1.0, 30.0 } }, - LabelFile = speck .. "/tully.label", + LabelFile = speck .. "tully.label", DrawLabels = false, Unit = "Mpc", TextColor = { 0.7, 0.7, 0.7 }, @@ -79,7 +79,7 @@ local tullyImages = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.99, ScaleFactor = 1.0, - File = speck .. "/tully.speck", + File = speck .. "tully.speck", TexturePath = textures, Luminosity = "diamkpc", ScaleLuminosity = 0.001, diff --git a/data/assets/scene/digitaluniverse/voids.asset b/data/assets/scene/digitaluniverse/voids.asset index 269ae7c7e7..5bc10c9712 100644 --- a/data/assets/scene/digitaluniverse/voids.asset +++ b/data/assets/scene/digitaluniverse/voids.asset @@ -18,7 +18,7 @@ local object = { DrawLabels = true, Color = { 1.0, 1.0, 1.0 }, Opacity = 0.65, - LabelFile = speck .. "/voids.label", + LabelFile = speck .. "voids.label", Unit = "Mpc", TextColor = { 0.296, 0.629, 1.0 }, TextSize = 20.9, diff --git a/data/assets/scene/milkyway/constellations/constellation_art.asset b/data/assets/scene/milkyway/constellations/constellation_art.asset index 1217742e88..919e64e763 100644 --- a/data/assets/scene/milkyway/constellations/constellation_art.asset +++ b/data/assets/scene/milkyway/constellations/constellation_art.asset @@ -58,7 +58,7 @@ local createConstellations = function (baseIdentifier, guiPath, constellationfil Origin = "Center", Billboard = false, LazyLoading = true, - Texture = images .. "/" .. imageName, + Texture = images .. imageName, BlendMode = "Additive", Opacity = 0.1 }, diff --git a/data/assets/scene/milkyway/exoplanets/exoplanets_data.asset b/data/assets/scene/milkyway/exoplanets/exoplanets_data.asset index 45597c4302..3cd5fc9e78 100644 --- a/data/assets/scene/milkyway/exoplanets/exoplanets_data.asset +++ b/data/assets/scene/milkyway/exoplanets/exoplanets_data.asset @@ -15,7 +15,7 @@ asset.onInitialize(function () p = "Modules.Exoplanets.BvColormap"; if (openspace.getPropertyValue(p) == "") then - openspace.setPropertyValueSingle(p, colormaps .. "/colorbv.cmap") + openspace.setPropertyValueSingle(p, colormaps .. "colorbv.cmap") end end) diff --git a/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset b/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset index 2aaf885944..eb5804687e 100644 --- a/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset +++ b/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset @@ -16,13 +16,13 @@ local TexturesPath = asset.syncedResource({ }) asset.onInitialize(function () - local starTexture = TexturesPath .. "/sun.jpg" - local noDataTexture = TexturesPath .. "/grid-32.png" - local discTexture = TexturesPath .. "/disc_bw_texture.png" + local starTexture = TexturesPath .. "sun.jpg" + local noDataTexture = TexturesPath .. "grid-32.png" + local discTexture = TexturesPath .. "disc_bw_texture.png" - local starGlareTexture = sunTextures .. "/halo.png" + local starGlareTexture = sunTextures .. "halo.png" - local hzTexture = habitableZoneTextures .. "/hot_to_cold_faded.png" + local hzTexture = habitableZoneTextures .. "hot_to_cold_faded.png" -- Set the default textures used for the exoplanet system creation -- (Check if already set, to not override value in config file) diff --git a/data/assets/scene/milkyway/gaia/apogee.asset b/data/assets/scene/milkyway/gaia/apogee.asset index b6abe3159a..19b4806a41 100644 --- a/data/assets/scene/milkyway/gaia/apogee.asset +++ b/data/assets/scene/milkyway/gaia/apogee.asset @@ -16,16 +16,16 @@ local gaia_abundance_apogee = { Renderable = { Type = "RenderableStars", Enabled = false, - File = speck .. "/GaiaAbundApogee.speck", + File = speck .. "GaiaAbundApogee.speck", ColorOption = "Other Data", OtherData = "FeH", 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", + Texture = textures .. "halo.png", + -- ShapeTexture = textures .. "disc.png", + ColorMap = colorLUT .. "colorbv.cmap", + OtherDataColorMap = colorLUT .. "viridis.cmap", StaticFilter = -9999, StaticFilterReplacement = 0.0, DataMapping = { diff --git a/data/assets/scene/milkyway/gaia/gaia_dr2_download_stars.asset b/data/assets/scene/milkyway/gaia/gaia_dr2_download_stars.asset index 410a6b42b8..7e4df4068c 100644 --- a/data/assets/scene/milkyway/gaia/gaia_dr2_download_stars.asset +++ b/data/assets/scene/milkyway/gaia/gaia_dr2_download_stars.asset @@ -22,7 +22,7 @@ local gaiaFull = asset.syncedResource({ asset.onInitialize(function() if not openspace.directoryExists(gaia618DestinationExtracted) then openspace.printInfo("Extracted Gaia dataset") - openspace.unzipFile(gaia618Destination .. '/DR2_full_Octree[50kSPN,500dist]_50,50.zip', gaia618DestinationExtracted, true) + openspace.unzipFile(gaia618Destination .. 'DR2_full_Octree[50kSPN,500dist]_50,50.zip', gaia618DestinationExtracted, true) end end) diff --git a/data/assets/scene/milkyway/gaia/gaiastars.asset b/data/assets/scene/milkyway/gaia/gaiastars.asset index 5eeeb15162..624a511734 100644 --- a/data/assets/scene/milkyway/gaia/gaiastars.asset +++ b/data/assets/scene/milkyway/gaia/gaiastars.asset @@ -15,12 +15,12 @@ local GaiaStars = { Identifier = "GaiaStars", Renderable = { Type = "RenderableGaiaStars", - File = starsFolder .. "/", + File = starsFolder, FileReaderOption = "StreamOctree", RenderOption = "Motion", ShaderOption = "Point_SSBO", - Texture = textures .. "/halo.png", - ColorMap = colorLUT .. "/colorbv.cmap", + Texture = textures .. "halo.png", + ColorMap = colorLUT .. "colorbv.cmap", LuminosityMultiplier = 35, MagnitudeBoost = 25, CutOffThreshold = 38, @@ -32,13 +32,13 @@ local GaiaStars = { MaxCpuMemoryPercent = 0.4, FilterSize = 5, Sigma = 0.5, - AdditionalNodes = {3.0, 2.0}, - FilterPosX = {0.0, 0.0}, - FilterPosY = {0.0, 0.0}, - FilterPosZ = {0.0, 0.0}, - FilterGMag = {20.0, 20.0}, - FilterBpRp = {0.0, 0.0}, - FilterDist = {9.0, 9.0}, + AdditionalNodes = { 3.0, 2.0 }, + FilterPosX = { 0.0, 0.0 }, + FilterPosY = { 0.0, 0.0 }, + FilterPosZ = { 0.0, 0.0 }, + FilterGMag = { 20.0, 20.0 }, + FilterBpRp = { 0.0, 0.0 }, + FilterDist = { 9.0, 9.0 }, }, GUI = { Name = "Gaia Stars", diff --git a/data/assets/scene/milkyway/gaia/galah.asset b/data/assets/scene/milkyway/gaia/galah.asset index f4c814c20a..36da26f090 100644 --- a/data/assets/scene/milkyway/gaia/galah.asset +++ b/data/assets/scene/milkyway/gaia/galah.asset @@ -16,16 +16,16 @@ local gaia_abundance_galah = { Renderable = { Type = "RenderableStars", Enabled = false, - File = speck .. "/GaiaAbundGalah.speck", - Texture = textures .. "/halo.png", - -- ShapeTexture = textures .. "/disc.png", + 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", - ColorMap = colorLUT .. "/colorbv.cmap", - OtherDataColorMap = colorLUT .. "/viridis.cmap", + ColorMap = colorLUT .. "colorbv.cmap", + OtherDataColorMap = colorLUT .. "viridis.cmap", StaticFilter = -9999, StaticFilterReplacement = 0.0, DataMapping = { diff --git a/data/assets/scene/milkyway/milkyway/eso.asset b/data/assets/scene/milkyway/milkyway/eso.asset index 887c9a0023..f6abfcc9e5 100644 --- a/data/assets/scene/milkyway/milkyway/eso.asset +++ b/data/assets/scene/milkyway/milkyway/eso.asset @@ -22,7 +22,7 @@ local object = { Size = 9.2E20, Segments = 40, Opacity = 0.4, - Texture = textures .. "/eso0932a_blend.png", + Texture = textures .. "eso0932a_blend.png", UseAdditiveBlending = true, Orientation = "Inside", MirrorTexture = true, diff --git a/data/assets/scene/milkyway/milkyway/volume.asset b/data/assets/scene/milkyway/milkyway/volume.asset index 0e54bd1535..249e945d17 100644 --- a/data/assets/scene/milkyway/milkyway/volume.asset +++ b/data/assets/scene/milkyway/milkyway/volume.asset @@ -32,16 +32,16 @@ local MilkyWayVolumeGalaxy = { Rotation = { 3.1415926, 3.1248, 4.45741 }, Volume = { Type = "Volume", - Filename = openspace.absPath(data .. "/MilkyWayRGBAVolume1024x1024x128.raw"), + Filename = openspace.absPath(data .. "MilkyWayRGBAVolume1024x1024x128.raw"), Dimensions = { 1024, 1024, 128 }, Size = { 1.2E21, 1.2E21, 0.15E21 }, Downscale = 0.4, }, Points = { Type = "Points", - Filename = openspace.absPath(data .. "/MilkyWayPoints.off"), + Filename = openspace.absPath(data .. "MilkyWayPoints.off"), EnabledPointsRatio = 0.3, - Texture = openspace.absPath(data .. "/halo.png") + Texture = openspace.absPath(data .. "halo.png") } }, GUI = { diff --git a/data/assets/scene/milkyway/objects/orionnebula/cluster.asset b/data/assets/scene/milkyway/objects/orionnebula/cluster.asset index 0abd320818..7c8f9a7b96 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/cluster.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/cluster.asset @@ -14,9 +14,9 @@ local OrionClusterStars = { Parent = transforms.NebulaPosition.Identifier, Renderable = { Type = "RenderableStars", - File = sync .. "/oricluster.speck", - Texture = sync .. "/halo.png", - ColorMap = sync .. "/colorbv.cmap", + File = sync .. "oricluster.speck", + Texture = sync .. "halo.png", + ColorMap = sync .. "colorbv.cmap", MagnitudeExponent = 5.02, SizeComposition = "Distance Modulus", RenderMethod = "Texture Based", diff --git a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset index cf02ee733e..964f211ebb 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset @@ -59,7 +59,7 @@ local OrionNebulaModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = sync .. "/orion_nebula.obj", + GeometryFile = sync .. "orion_nebula.obj", Opacity = 1.0, DisableFaceCulling = false, SpecularIntensity = 0.0, @@ -88,7 +88,7 @@ local OrionNebulaShocksModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = sync .. "/orishocks.obj", + GeometryFile = sync .. "orishocks.obj", Opacity = 1.0, DisableFaceCulling = false, SpecularIntensity = 0.0, @@ -117,7 +117,7 @@ local OrionNebulaProplydsModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = sync .. "/proplyds.obj", + GeometryFile = sync .. "proplyds.obj", Opacity = 1.0, DisableFaceCulling = false, SpecularIntensity = 0.0, diff --git a/data/assets/scene/milkyway/stars/denver.asset b/data/assets/scene/milkyway/stars/denver.asset index 4dc1621909..cb7c620617 100644 --- a/data/assets/scene/milkyway/stars/denver.asset +++ b/data/assets/scene/milkyway/stars/denver.asset @@ -27,9 +27,9 @@ local object = { Identifier = "Stars-Denver", Renderable = { Type = "RenderableStars", - File = speck .. "/denver_stars.speck", - Texture = textures .. "/halo.png", - ColorMap = colorLUT .. "/denver_colorbv.cmap", + File = speck .. "denver_stars.speck", + Texture = textures .. "halo.png", + ColorMap = colorLUT .. "denver_colorbv.cmap", MagnitudeExponent = 6.2, SizeComposition = "Distance Modulus", RenderMethod = "Texture Based", -- or PSF diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset index 01ba4be29a..16ecabfa64 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset @@ -34,7 +34,7 @@ local Charon = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/charon.labels", + FileName = labelsPath .. "charon.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 9.0, diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/kernels.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/kernels.asset index 09f2f6debb..69e1716b00 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/kernels.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/kernels.asset @@ -6,9 +6,9 @@ local Kernels = asset.syncedResource({ }) local PlutoKernels = { - Kernels .. "/NavPE_de433_od122.bsp", - Kernels .. "/NavSE_plu047_od122.bsp", - Kernels .. "/ssd_jpl_nasa_gov_plu043.bsp" + Kernels .. "NavPE_de433_od122.bsp", + Kernels .. "NavSE_plu047_od122.bsp", + Kernels .. "ssd_jpl_nasa_gov_plu043.bsp" } asset.export("PlutoKernels", PlutoKernels) diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index 2a80986180..3abde38140 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -33,7 +33,7 @@ local Pluto = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/pluto.labels", + FileName = labelsPath .. "pluto.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 8.5, diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane.asset index 52ec32efe8..e7a85a7f19 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane.asset @@ -3,7 +3,7 @@ local propertyHelper = asset.require("util/property_helper") local transforms = asset.require('scene/solarsystem/sun/transforms_heliosphere') local rot = asset.require('./carringtonToHEEQRotation.asset') -local TexturesPathEquitorial = asset.syncedResource({ +local TexturesPathEquatorial = asset.syncedResource({ Type = "HttpSynchronization", Name = "cutplanes_textures", Identifier = "cutplanes_textures", @@ -27,7 +27,7 @@ local EquatorialCutplane = { Type = "RenderablePlaneTimeVaryingImage", Size = 1.57E11, Enabled = true, - SourceFolder = TexturesPathEquitorial, + SourceFolder = TexturesPathEquatorial, BlendMode = "Normal", MirrorBackside = false, Opacity = 0.7 diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset index 7f574ab978..4c7c83afc8 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset @@ -11,7 +11,7 @@ local TexturesPath = asset.syncedResource({ local legend = { Identifier = "LegendFluxNodes-bastille-day-2000", Type = "ScreenSpaceImageLocal", - TexturePath = TexturesPath .. "/CMR_transparent_white_text.png", + TexturePath = TexturesPath .. "CMR_transparent_white_text.png", Scale = 0.15, CartesianPosition = { 0.677970, 0.0, -1.049180 } } diff --git a/data/assets/scene/solarsystem/interstellar/c-2019_q4_borisov.asset b/data/assets/scene/solarsystem/interstellar/c-2019_q4_borisov.asset index 0413de7199..06e06d5a08 100644 --- a/data/assets/scene/solarsystem/interstellar/c-2019_q4_borisov.asset +++ b/data/assets/scene/solarsystem/interstellar/c-2019_q4_borisov.asset @@ -15,7 +15,7 @@ local C2019Q4BorisovTrail = { Type = "RenderableTrailTrajectory", Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trajectory .. "/horizons_c2019q4borisov.dat" + HorizonsTextFile = trajectory .. "horizons_c2019q4borisov.dat" }, Color = { 0.9, 0.9, 0.0 }, StartTime = "2015 JAN 01 00:00:00", @@ -34,7 +34,7 @@ local C2019Q4BorisovPosition = { Transform = { Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trajectory .. "/horizons_c2019q4borisov.dat" + HorizonsTextFile = trajectory .. "horizons_c2019q4borisov.dat" } }, GUI = { diff --git a/data/assets/scene/solarsystem/interstellar/oumuamua.asset b/data/assets/scene/solarsystem/interstellar/oumuamua.asset index 972d7cd3da..bb1714c64f 100644 --- a/data/assets/scene/solarsystem/interstellar/oumuamua.asset +++ b/data/assets/scene/solarsystem/interstellar/oumuamua.asset @@ -15,7 +15,7 @@ local OumuamuaTrail = { Type = "RenderableTrailTrajectory", Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trajectory .. "/horizons_oumuamua.dat" + HorizonsTextFile = trajectory .. "horizons_oumuamua.dat" }, Color = { 0.9, 0.9, 0.0 }, StartTime = "2014 JAN 01 00:00:00", @@ -35,7 +35,7 @@ local OumuamuaPosition = { Transform = { Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trajectory .. "/horizons_oumuamua.dat" + HorizonsTextFile = trajectory .. "horizons_oumuamua.dat" }, }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset b/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset index b353169587..cf1ef5f56e 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset @@ -67,7 +67,7 @@ local Apollo11Model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/Apollo_CSM_shrunk_rotated_xy_double_size.obj", + GeometryFile = models .. "Apollo_CSM_shrunk_rotated_xy_double_size.obj", LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) }, GUI = { @@ -182,7 +182,7 @@ local Apollo11LemDescentModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = lem_model .. "/lmremoved.obj", + GeometryFile = lem_model .. "lmremoved.obj", SpecularIntensity = 0.0, RotationVector = { 273.750,28.0,309.85 }, LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) @@ -208,7 +208,7 @@ local Apollo11LemLandedModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = lem_model .. "/LM-2_ver2clean.obj", + GeometryFile = lem_model .. "LM-2_ver2clean.obj", SpecularIntensity = 0.0, RotationVector = { 273.750,28.0,309.85 }, LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) diff --git a/data/assets/scene/solarsystem/missions/apollo/11/kernels.asset b/data/assets/scene/solarsystem/missions/apollo/11/kernels.asset index d6fdbf3dbd..94bfb09c7c 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/kernels.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/kernels.asset @@ -6,11 +6,11 @@ local kernelsFolder = asset.syncedResource({ }) local kernels = { - kernelsFolder .. "/moon_080317.tf", - kernelsFolder .. "/apollo_naif_ids.tf", - kernelsFolder .. "/moon_pa_de421_1900-2050.bpc", - kernelsFolder .. '/apollo11_orbits_full9km.bsp', - kernelsFolder .. '/apollo11_orbits_lm9km.bsp', + kernelsFolder .. "moon_080317.tf", + kernelsFolder .. "apollo_naif_ids.tf", + kernelsFolder .. "moon_pa_de421_1900-2050.bpc", + kernelsFolder .. "apollo11_orbits_full9km.bsp", + kernelsFolder .. "apollo11_orbits_lm9km.bsp" } asset.export('kernels', kernels) diff --git a/data/assets/scene/solarsystem/missions/apollo/11/lem.asset b/data/assets/scene/solarsystem/missions/apollo/11/lem.asset index 3739de848d..85ae896a16 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/lem.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/lem.asset @@ -41,8 +41,8 @@ local Apollo11LemModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = lem_model .. "/LM-2_ver2clean.obj", - RotationVector = { 91.044090,171.229706,111.666664 }, + GeometryFile = lem_model .. "LM-2_ver2clean.obj", + RotationVector = { 91.044090, 171.229706, 111.666664 }, LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset index 4cf0e06419..2db01fb2e5 100644 --- a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset +++ b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset @@ -55,7 +55,7 @@ local Apollo15 = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/ApolloCSM.osmodel", + GeometryFile = models .. "ApolloCSM.osmodel", ModelScale = 0.0001, LightSources = { { diff --git a/data/assets/scene/solarsystem/missions/apollo/15/kernels.asset b/data/assets/scene/solarsystem/missions/apollo/15/kernels.asset index 385565429b..841c3a5589 100644 --- a/data/assets/scene/solarsystem/missions/apollo/15/kernels.asset +++ b/data/assets/scene/solarsystem/missions/apollo/15/kernels.asset @@ -6,17 +6,17 @@ local folder = asset.syncedResource({ }) local kernels = { - folder .. "/apollo15.0001.tsc", + folder .. "apollo15.0001.tsc", - -- folder .. '/AS15-P_v01.bc', - folder .. '/apollo15.0001.tf', - folder .. '/apollo15MetricAddendum002.ti', - -- folder .. '/apollo15PanoramicAddendum001.ti', - folder .. '/apollo15_metric.0002.ti', - -- folder .. '/apollo15_panoramic.0001.ti', - folder .. '/apollo15-1.bsp', - folder .. '/AS15-M_v01.bc', - -- folder .. '/AS15-M_v01.bsp', + -- folder .. 'AS15-P_v01.bc', + folder .. 'apollo15.0001.tf', + folder .. 'apollo15MetricAddendum002.ti', + -- folder .. 'apollo15PanoramicAddendum001.ti', + folder .. 'apollo15_metric.0002.ti', + -- folder .. 'apollo15_panoramic.0001.ti', + folder .. 'apollo15-1.bsp', + folder .. 'AS15-M_v01.bc', + -- folder .. 'AS15-M_v01.bsp', } -- local kernels = { diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset index 715cda0ffe..2e561f2980 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset @@ -53,7 +53,7 @@ local Station2Boulder1Model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/b1-v2.obj", + GeometryFile = models .. "b1-v2.obj", RotationVector = { 243.243256 ,206.270264, 309.677429 }, LightSources = LightSources, PerformShading = false, @@ -95,7 +95,7 @@ local Station2Boulder2Model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/b2model.obj", + GeometryFile = models .. "b2model.obj", RotationVector = { 66.162155, 7.783780, 114.193550 }, LightSources = LightSources, PerformShading = false, @@ -137,7 +137,7 @@ local Station2Boulder3Model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/b3model.obj", + GeometryFile = models .. "b3model.obj", RotationVector = { 161.513519 ,243.243256, 65.806450 }, LightSources = LightSources, PerformShading = false, diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset index ced25ff21e..48de6a578f 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset @@ -64,7 +64,7 @@ local Station6Frag1Model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/A17-S6-frag1.obj", + GeometryFile = models .. "A17-S6-frag1.obj", RotationVector = { 235.909088,165.000000,286.299194 }, LightSources = LightSources, PerformShading = false, @@ -107,7 +107,7 @@ local Station6Frag2Model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/station6_boulder_frag2.obj", + GeometryFile = models .. "station6_boulder_frag2.obj", RotationVector = { 336.959991,210.239990,325.984253 }, LightSources = LightSources, PerformShading = false, @@ -138,7 +138,7 @@ local Station6Frag3Model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/station6_boulder_frag3.obj", + GeometryFile = models .. "station6_boulder_frag3.obj", RotationVector = { 293.181824,255.000000,4.090910 }, LightSources = LightSources, PerformShading = false, diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset index ab596e44f8..4ae286344b 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset @@ -53,7 +53,7 @@ local Station7BoulderModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/b7model.obj", + GeometryFile = models .. "b7model.obj", RotationVector = { 1.945950,274.378387,212.903214 }, LightSources = LightSources, PerformShading = false, diff --git a/data/assets/scene/solarsystem/missions/apollo/17/lem.asset b/data/assets/scene/solarsystem/missions/apollo/17/lem.asset index 95339b0979..59a7306d61 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/lem.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/lem.asset @@ -39,7 +39,7 @@ local Apollo17LemModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/LM-2_ver2clean.obj", + GeometryFile = model .. "LM-2_ver2clean.obj", SpecularIntensity = 0.0, RotationVector = { 110.255219,171.229706,126.666664 }, LightSources = asset_helper.getDefaultLightSources(sun_transforms.SolarSystemBarycenter.Identifier) diff --git a/data/assets/scene/solarsystem/missions/apollo/8/kernels.asset b/data/assets/scene/solarsystem/missions/apollo/8/kernels.asset index 7b2e464bf7..82fb855db5 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/kernels.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/kernels.asset @@ -6,12 +6,12 @@ local kernelsFolder = asset.syncedResource({ }) local kernels = { - kernelsFolder .. "/moon_080317.tf", - kernelsFolder .. "/apollo8.tf", - kernelsFolder .. "/moon_pa_de421_1900-2050.bpc", - kernelsFolder .. '/apollo8.tsc', - kernelsFolder .. '/apollo8.bsp', - kernelsFolder .. '/apollo8_earthrise.bc', + kernelsFolder .. "moon_080317.tf", + kernelsFolder .. "apollo8.tf", + kernelsFolder .. "moon_pa_de421_1900-2050.bpc", + kernelsFolder .. 'apollo8.tsc', + kernelsFolder .. 'apollo8.bsp', + kernelsFolder .. 'apollo8_earthrise.bc' } asset.export('kernels', kernels) diff --git a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset index c5f39164b5..aafb1edfc3 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset @@ -51,7 +51,7 @@ local Apollo8LaunchModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/ApolloCSM.osmodel", + GeometryFile = models .. "ApolloCSM.osmodel", ModelScale = 0.0001, LightSources = { { diff --git a/data/assets/scene/solarsystem/missions/apollo/8/model.asset b/data/assets/scene/solarsystem/missions/apollo/8/model.asset index a110a45646..714285b568 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/model.asset @@ -63,7 +63,7 @@ local Apollo8Model = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/ApolloCSM.osmodel", + GeometryFile = models .. "ApolloCSM.osmodel", ModelScale = 0.0001, LightSources = { { diff --git a/data/assets/scene/solarsystem/missions/apollo/insignias_map.asset b/data/assets/scene/solarsystem/missions/apollo/insignias_map.asset index b79b609c3c..f7ec75bb7c 100644 --- a/data/assets/scene/solarsystem/missions/apollo/insignias_map.asset +++ b/data/assets/scene/solarsystem/missions/apollo/insignias_map.asset @@ -75,7 +75,7 @@ for i = 1, #landingData do Size = size, Origin = "Center", Billboard = true, - Texture = insigniasPath .. "/" .. entry.Texture, + Texture = insigniasPath .. entry.Texture, Opacity = 0.0 }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/dawn/ceres.asset b/data/assets/scene/solarsystem/missions/dawn/ceres.asset index ec16cb3d4c..08f9cbec17 100644 --- a/data/assets/scene/solarsystem/missions/dawn/ceres.asset +++ b/data/assets/scene/solarsystem/missions/dawn/ceres.asset @@ -26,9 +26,9 @@ local Ceres = { SourceFrame = "IAU_CERES", DestinationFrame = "GALACTIC", Kernels = { - kernels .. "/dawn_ceres_v01.tpc", - kernels .. "/sb_ceres_140724.bsp", - kernels .. "/sb_ceres_110211.bsp" + kernels .. "dawn_ceres_v01.tpc", + kernels .. "sb_ceres_140724.bsp", + kernels .. "sb_ceres_110211.bsp" } }, Translation = { @@ -36,9 +36,9 @@ local Ceres = { Target = "CERES", Observer = "SSB", Kernels = { - kernels .. "/dawn_ceres_v01.tpc", - kernels .. "/sb_ceres_140724.bsp", - kernels .. "/sb_ceres_110211.bsp" + kernels .. "dawn_ceres_v01.tpc", + kernels .. "sb_ceres_140724.bsp", + kernels .. "sb_ceres_110211.bsp" } } }, @@ -50,7 +50,7 @@ local Ceres = { ColorLayers = { { Identifier = "Texture", - FilePath = textures .. "/gray.png", + FilePath = textures .. "gray.png", Enabled = true } } diff --git a/data/assets/scene/solarsystem/missions/dawn/dawn.asset b/data/assets/scene/solarsystem/missions/dawn/dawn.asset index 6b9db76edd..40d97c409d 100644 --- a/data/assets/scene/solarsystem/missions/dawn/dawn.asset +++ b/data/assets/scene/solarsystem/missions/dawn/dawn.asset @@ -25,601 +25,601 @@ local models = asset.syncedResource({ }) local KernelFiles = { - kernels .. "/dawn_ref_070926-150201_070829.bsp", + kernels .. "dawn_ref_070926-150201_070829.bsp", --ik - kernels .. "/dawn_fc_v10.ti", + kernels .. "dawn_fc_v10.ti", -- SPK - kernels .. "/sb_ceres_110211.bsp", - kernels .. "/sb_ceres_140724.bsp", - kernels .. "/sb_vesta_071107.bsp", + kernels .. "sb_ceres_110211.bsp", + kernels .. "sb_ceres_140724.bsp", + kernels .. "sb_vesta_071107.bsp", - kernels .. "/dawn_rec_070927_070930_081218_v1.bsp", - --[[kernels .. "/dawn_rec_070930_071201_081218_v1.bsp", - kernels .. "/dawn_rec_071201_080205_081218_v1.bsp", - kernels .. "/dawn_rec_080205_080325_081218_v1.bsp", - kernels .. "/dawn_rec_080325_080503_081218_v1.bsp", - kernels .. "/dawn_rec_080503_080601_081218_v1.bsp", - kernels .. "/dawn_rec_080601_080718_081218_v1.bsp", - kernels .. "/dawn_rec_080718_080910_081218_v1.bsp", - kernels .. "/dawn_rec_080910_081022_090218_v1.bsp", - kernels .. "/dawn_rec_081022_081109_090218_v1.bsp", - kernels .. "/dawn_rec_081109_090228_090306_v1.bsp", - kernels .. "/dawn_rec_090228_090501_090702_v1.bsp", - kernels .. "/dawn_rec_090501_090801_090916_v1.bsp", - kernels .. "/dawn_rec_090801_090915_090923_v1.bsp", - kernels .. "/dawn_rec_090915_091201_091202_v1.bsp", - kernels .. "/dawn_rec_091201_100208_100209_v1.bsp", - kernels .. "/dawn_rec_100208_100316_100323_v1.bsp", - kernels .. "/dawn_rec_100316_100413_100422_v1.bsp", - kernels .. "/dawn_rec_100413_100622_100830_v1.bsp", - kernels .. "/dawn_rec_100622_100824_100830_v1.bsp", - kernels .. "/dawn_rec_100824_101130_101202_v1.bsp", - kernels .. "/dawn_rec_101130_110201_110201_v1.bsp", - kernels .. "/dawn_rec_110201_110328_110328_v1.bsp", - kernels .. "/dawn_rec_110328_110419_110420_v1.bsp",--]] + kernels .. "dawn_rec_070927_070930_081218_v1.bsp", + --[[kernels .. "dawn_rec_070930_071201_081218_v1.bsp", + kernels .. "dawn_rec_071201_080205_081218_v1.bsp", + kernels .. "dawn_rec_080205_080325_081218_v1.bsp", + kernels .. "dawn_rec_080325_080503_081218_v1.bsp", + kernels .. "dawn_rec_080503_080601_081218_v1.bsp", + kernels .. "dawn_rec_080601_080718_081218_v1.bsp", + kernels .. "dawn_rec_080718_080910_081218_v1.bsp", + kernels .. "dawn_rec_080910_081022_090218_v1.bsp", + kernels .. "dawn_rec_081022_081109_090218_v1.bsp", + kernels .. "dawn_rec_081109_090228_090306_v1.bsp", + kernels .. "dawn_rec_090228_090501_090702_v1.bsp", + kernels .. "dawn_rec_090501_090801_090916_v1.bsp", + kernels .. "dawn_rec_090801_090915_090923_v1.bsp", + kernels .. "dawn_rec_090915_091201_091202_v1.bsp", + kernels .. "dawn_rec_091201_100208_100209_v1.bsp", + kernels .. "dawn_rec_100208_100316_100323_v1.bsp", + kernels .. "dawn_rec_100316_100413_100422_v1.bsp", + kernels .. "dawn_rec_100413_100622_100830_v1.bsp", + kernels .. "dawn_rec_100622_100824_100830_v1.bsp", + kernels .. "dawn_rec_100824_101130_101202_v1.bsp", + kernels .. "dawn_rec_101130_110201_110201_v1.bsp", + kernels .. "dawn_rec_110201_110328_110328_v1.bsp", + kernels .. "dawn_rec_110328_110419_110420_v1.bsp",--]] - kernels .. "/dawn_rec_110416_110802_110913_v1.bsp", - kernels .. "/dawn_rec_110802_110831_110922_v1.bsp", - --[[kernels .. "/spk/dawn_rec_110831_110928_111221_v1.bsp", - kernels .. "/dawn_rec_110928_111102_120615_v1.bsp", - kernels .. "/dawn_rec_111102_111210_120618_v1.bsp", - kernels .. "/dawn_rec_111211_120501_120620_v1.bsp", - kernels .. "/dawn_rec_120501_120611_120625_v1.bsp", - kernels .. "/dawn_rec_120611_120724_121101_v1.bsp",--]] - kernels .. "/dawn_rec_120724_120913_121213_v1.bsp", + kernels .. "dawn_rec_110416_110802_110913_v1.bsp", + kernels .. "dawn_rec_110802_110831_110922_v1.bsp", + --[[kernels .. "spk/dawn_rec_110831_110928_111221_v1.bsp", + kernels .. "dawn_rec_110928_111102_120615_v1.bsp", + kernels .. "dawn_rec_111102_111210_120618_v1.bsp", + kernels .. "dawn_rec_111211_120501_120620_v1.bsp", + kernels .. "dawn_rec_120501_120611_120625_v1.bsp", + kernels .. "dawn_rec_120611_120724_121101_v1.bsp",--]] + kernels .. "dawn_rec_120724_120913_121213_v1.bsp", --PCK - --kernels .. "/dawn_vesta_v06.tpc", - --kernels .. "/dawn_ceres_v01.tpc", - --kernels .. "/pck00008.tpc", + --kernels .. "dawn_vesta_v06.tpc", + --kernels .. "dawn_ceres_v01.tpc", + --kernels .. "pck00008.tpc", -- FK - kernels .. "/dawn_vesta_v00.tf", - kernels .. "/dawn_v12.tf", + kernels .. "dawn_vesta_v00.tf", + kernels .. "dawn_v12.tf", --SCLK - kernels .. "/dawn_203_sclkscet_00039.tsc", + kernels .. "dawn_203_sclkscet_00039.tsc", -- CK - kernels .. "/dawn_sc_070927_070930.bc", - kernels .. "/dawn_sc_110801_110807.bc", - kernels .. "/dawn_sc_110808_110814.bc", - kernels .. "/dawn_sc_120910_120916.bc", - -- kernels .. "/dawn_sc_111226_120101.bc", - -- kernels .. "/dawn_sc_120102_120108.bc", - -- kernels .. "/dawn_sc_120109_120115.bc", - -- kernels .. "/dawn_sc_120116_120122.bc", - -- kernels .. "/dawn_sc_120123_120129.bc", + kernels .. "dawn_sc_070927_070930.bc", + kernels .. "dawn_sc_110801_110807.bc", + kernels .. "dawn_sc_110808_110814.bc", + kernels .. "dawn_sc_120910_120916.bc", + -- kernels .. "dawn_sc_111226_120101.bc", + -- kernels .. "dawn_sc_120102_120108.bc", + -- kernels .. "dawn_sc_120109_120115.bc", + -- kernels .. "dawn_sc_120116_120122.bc", + -- kernels .. "dawn_sc_120123_120129.bc", -- all space craft CK files, ~10 gb - -- kernels .. "/dawn_sc_120123_120129.bc", - -- kernels .. "/dawn_sc_070927_070930.bc", - --[[kernels .. "/ck/dawn_sc_071001_071007.bc", - kernels .. "/dawn_sc_071008_071014_v2.bc", - kernels .. "/dawn_sc_071015_071021.bc", - kernels .. "/dawn_sc_071022_071028_v2.bc", - kernels .. "/dawn_sc_071029_071104.bc", - kernels .. "/dawn_sc_071105_071111.bc", - kernels .. "/dawn_sc_071112_071118.bc", - kernels .. "/dawn_sc_071119_071125.bc", - kernels .. "/dawn_sc_071126_071202.bc", - kernels .. "/dawn_sc_071203_071209.bc", - kernels .. "/dawn_sc_071210_071216.bc", - kernels .. "/dawn_sc_071217_071223.bc", - kernels .. "/dawn_sc_071224_071230.bc", - kernels .. "/dawn_sc_071231_080106.bc", - kernels .. "/dawn_sc_080107_080113.bc", - kernels .. "/dawn_sc_080114_080120.bc", - kernels .. "/dawn_sc_080121_080127.bc", - kernels .. "/dawn_sc_080128_080203.bc", - kernels .. "/dawn_sc_080204_080210.bc", - kernels .. "/dawn_sc_080211_080217.bc", - kernels .. "/dawn_sc_080218_080224.bc", - kernels .. "/dawn_sc_080225_080302.bc", - kernels .. "/dawn_sc_080303_080309.bc", - kernels .. "/dawn_sc_080310_080316.bc", - kernels .. "/dawn_sc_080317_080323.bc", - kernels .. "/dawn_sc_080324_080330.bc", - kernels .. "/dawn_sc_080331_080406.bc", - kernels .. "/dawn_sc_080407_080413.bc", - kernels .. "/dawn_sc_080414_080420.bc", - kernels .. "/dawn_sc_080421_080427.bc", - kernels .. "/dawn_sc_080428_080504.bc", - kernels .. "/dawn_sc_080505_080511.bc", - kernels .. "/dawn_sc_080512_080518.bc", - kernels .. "/dawn_sc_080519_080525.bc", - kernels .. "/dawn_sc_080526_080601.bc", - kernels .. "/dawn_sc_080602_080608.bc", - kernels .. "/dawn_sc_080609_080615.bc", - kernels .. "/dawn_sc_080616_080622.bc", - kernels .. "/dawn_sc_080623_080629.bc", - kernels .. "/dawn_sc_080630_080706.bc", - kernels .. "/dawn_sc_080707_080713.bc", - kernels .. "/dawn_sc_080714_080720.bc", - kernels .. "/dawn_sc_080721_080727.bc", - kernels .. "/dawn_sc_080728_080803.bc", - kernels .. "/dawn_sc_080804_080810.bc", - kernels .. "/dawn_sc_080811_080817.bc", - kernels .. "/dawn_sc_080818_080824.bc", - kernels .. "/dawn_sc_080825_080831.bc", - kernels .. "/dawn_sc_080901_080907.bc", - kernels .. "/dawn_sc_080908_080914.bc", - kernels .. "/dawn_sc_080915_080921.bc", - kernels .. "/dawn_sc_080922_080928.bc", - kernels .. "/dawn_sc_080929_081005.bc", - kernels .. "/dawn_sc_081006_081012.bc", - kernels .. "/dawn_sc_081013_081019.bc", - kernels .. "/dawn_sc_081020_081026.bc", - kernels .. "/dawn_sc_081027_081102.bc", - kernels .. "/dawn_sc_081103_081109.bc", - kernels .. "/dawn_sc_081110_081116.bc", - kernels .. "/dawn_sc_081117_081123.bc", - kernels .. "/dawn_sc_081124_081130.bc", - kernels .. "/dawn_sc_081201_081207.bc", - kernels .. "/dawn_sc_081208_081214.bc", - kernels .. "/dawn_sc_081215_081221.bc", - kernels .. "/dawn_sc_081222_081228.bc", - kernels .. "/dawn_sc_081229_090104.bc", - kernels .. "/dawn_sc_090105_090111.bc", - kernels .. "/dawn_sc_090112_090118.bc", - kernels .. "/dawn_sc_090119_090125.bc", - kernels .. "/dawn_sc_090126_090201.bc", - kernels .. "/dawn_sc_090202_090208.bc", - kernels .. "/dawn_sc_090209_090215.bc", - kernels .. "/dawn_sc_090216_090222.bc", - kernels .. "/dawn_sc_090223_090301.bc", - kernels .. "/dawn_sc_090302_090308.bc", - kernels .. "/dawn_sc_090309_090315.bc", - kernels .. "/dawn_sc_090316_090322.bc", - kernels .. "/dawn_sc_090323_090329.bc", - kernels .. "/dawn_sc_090330_090405.bc", - kernels .. "/dawn_sc_090406_090412.bc", - kernels .. "/dawn_sc_090413_090419.bc", - kernels .. "/dawn_sc_090420_090426.bc", - kernels .. "/dawn_sc_090427_090503.bc", - kernels .. "/dawn_sc_090504_090510.bc", - kernels .. "/dawn_sc_090511_090517.bc", - kernels .. "/dawn_sc_090518_090524.bc", - kernels .. "/dawn_sc_090525_090531.bc", - kernels .. "/dawn_sc_090601_090607.bc", - kernels .. "/dawn_sc_090608_090614.bc", - kernels .. "/dawn_sc_090615_090621.bc", - kernels .. "/dawn_sc_090622_090628.bc", - kernels .. "/dawn_sc_090629_090705.bc", - kernels .. "/dawn_sc_090706_090712.bc", - kernels .. "/dawn_sc_090713_090719.bc", - kernels .. "/dawn_sc_090720_090726.bc", - kernels .. "/dawn_sc_090727_090802.bc", - kernels .. "/dawn_sc_090803_090809.bc", - kernels .. "/dawn_sc_090810_090816.bc", - kernels .. "/dawn_sc_090817_090823.bc", - kernels .. "/dawn_sc_090824_090830.bc", - kernels .. "/dawn_sc_090831_090906.bc", - kernels .. "/dawn_sc_090907_090913.bc", - kernels .. "/dawn_sc_090914_090920.bc", - kernels .. "/dawn_sc_090921_090927.bc", - kernels .. "/dawn_sc_090928_091004.bc", - kernels .. "/dawn_sc_091005_091011.bc", - kernels .. "/dawn_sc_091012_091018.bc", - kernels .. "/dawn_sc_091019_091025.bc", - kernels .. "/dawn_sc_091026_091101.bc", - kernels .. "/dawn_sc_091102_091108.bc", - kernels .. "/dawn_sc_091109_091115.bc", - kernels .. "/dawn_sc_091116_091122.bc", - kernels .. "/dawn_sc_091123_091129.bc", - kernels .. "/dawn_sc_091130_091206.bc", - kernels .. "/dawn_sc_091207_091213.bc", - kernels .. "/dawn_sc_091214_091220.bc", - kernels .. "/dawn_sc_091221_091227.bc", - kernels .. "/dawn_sc_091228_100103.bc", - kernels .. "/dawn_sc_100104_100110_v2.bc", - kernels .. "/dawn_sc_100111_100117_v2.bc",--]] - -- kernels .. "/dawn_sc_100118_100124.bc", - -- kernels .. "/dawn_sc_100125_100131.bc", - -- kernels .. "/dawn_sc_100201_100207.bc", - -- kernels .. "/dawn_sc_100208_100214.bc", - -- kernels .. "/dawn_sc_100215_100221.bc", - -- kernels .. "/dawn_sc_100222_100228.bc", - -- kernels .. "/dawn_sc_100301_100307.bc", - -- kernels .. "/dawn_sc_100308_100314.bc", - -- kernels .. "/dawn_sc_100315_100321.bc", - -- kernels .. "/dawn_sc_100322_100328.bc", - -- kernels .. "/dawn_sc_100329_100404.bc", - -- kernels .. "/dawn_sc_100405_100411.bc", - -- kernels .. "/dawn_sc_100412_100418.bc", - -- kernels .. "/dawn_sc_100419_100425.bc", - -- kernels .. "/dawn_sc_100426_100502.bc", - -- kernels .. "/dawn_sc_100503_100509.bc", - -- kernels .. "/dawn_sc_100510_100516.bc", - -- kernels .. "/dawn_sc_100517_100523.bc", - -- kernels .. "/dawn_sc_100524_100530.bc", - -- kernels .. "/dawn_sc_100531_100606.bc", - -- kernels .. "/dawn_sc_100607_100613.bc", - -- kernels .. "/dawn_sc_100614_100620.bc", - -- kernels .. "/dawn_sc_100621_100627.bc", - -- kernels .. "/dawn_sc_100628_100704.bc", - -- kernels .. "/dawn_sc_100705_100711.bc", - -- kernels .. "/dawn_sc_100712_100718.bc", - -- kernels .. "/dawn_sc_100719_100725.bc", - -- kernels .. "/dawn_sc_100726_100801.bc", - -- kernels .. "/dawn_sc_100802_100808.bc", - -- kernels .. "/dawn_sc_100809_100815.bc", - -- kernels .. "/dawn_sc_100816_100822.bc", - -- kernels .. "/dawn_sc_100823_100829.bc", - -- kernels .. "/dawn_sc_100830_100905.bc", - -- kernels .. "/dawn_sc_100906_100912.bc", - -- kernels .. "/dawn_sc_100913_100919.bc", - -- kernels .. "/dawn_sc_100920_100926.bc", - -- kernels .. "/dawn_sc_100927_101003.bc", - -- kernels .. "/dawn_sc_101004_101010.bc", - -- kernels .. "/dawn_sc_101011_101017.bc", - -- kernels .. "/dawn_sc_101018_101024.bc", - -- kernels .. "/dawn_sc_101025_101031.bc", - -- kernels .. "/dawn_sc_101101_101107.bc", - -- kernels .. "/dawn_sc_101108_101114.bc", - -- kernels .. "/dawn_sc_101115_101121.bc", - -- kernels .. "/dawn_sc_101122_101128.bc", - -- kernels .. "/dawn_sc_101129_101205.bc", - -- kernels .. "/dawn_sc_101206_101212.bc", - -- kernels .. "/dawn_sc_101213_101219.bc", - -- kernels .. "/dawn_sc_101220_101226.bc", - -- kernels .. "/dawn_sc_101227_110102.bc", - -- kernels .. "/dawn_sc_110103_110109.bc", - -- kernels .. "/dawn_sc_110110_110116.bc", - -- kernels .. "/dawn_sc_110117_110123.bc", - -- kernels .. "/dawn_sc_110124_110130.bc", - -- kernels .. "/dawn_sc_110131_110206.bc", - -- kernels .. "/dawn_sc_110207_110213.bc", - -- kernels .. "/dawn_sc_110214_110220.bc", - -- kernels .. "/dawn_sc_110221_110227.bc", - -- kernels .. "/dawn_sc_110228_110306.bc", - -- kernels .. "/dawn_sc_110307_110313.bc", - -- kernels .. "/dawn_sc_110314_110320.bc", - -- kernels .. "/dawn_sc_110321_110327.bc", - -- kernels .. "/dawn_sc_110328_110403.bc", - -- kernels .. "/dawn_sc_110404_110410.bc", - -- kernels .. "/dawn_sc_110411_110417.bc", - -- kernels .. "/dawn_sc_110418_110424.bc", - -- kernels .. "/dawn_sc_110425_110501.bc", - -- kernels .. "/dawn_sc_110502_110508.bc", - -- kernels .. "/dawn_sc_110509_110515.bc", - -- kernels .. "/dawn_sc_110516_110522.bc", - -- kernels .. "/dawn_sc_110523_110529.bc", - -- kernels .. "/dawn_sc_110530_110605.bc", - -- kernels .. "/dawn_sc_110606_110612.bc", - -- kernels .. "/dawn_sc_110613_110619.bc", - -- kernels .. "/dawn_sc_110620_110626.bc", - -- kernels .. "/dawn_sc_110627_110703.bc", - -- kernels .. "/dawn_sc_110704_110710.bc", - -- kernels .. "/dawn_sc_110711_110717.bc", - -- kernels .. "/dawn_sc_110718_110724.bc", - -- kernels .. "/dawn_sc_110725_110731.bc", - -- kernels .. "/dawn_sc_110801_110807.bc", - -- kernels .. "/dawn_sc_110808_110814.bc", - -- kernels .. "/dawn_sc_110815_110821.bc", - -- kernels .. "/dawn_sc_110822_110828.bc", - -- kernels .. "/dawn_sc_110829_110904.bc", - -- kernels .. "/dawn_sc_110905_110911.bc", - -- kernels .. "/dawn_sc_110912_110918.bc", - -- kernels .. "/dawn_sc_110919_110925.bc", - -- kernels .. "/dawn_sc_110926_111002.bc", - -- kernels .. "/dawn_sc_111003_111009.bc", - -- kernels .. "/dawn_sc_111010_111016.bc", - -- kernels .. "/dawn_sc_111017_111023.bc", - -- kernels .. "/dawn_sc_111024_111030.bc", - -- kernels .. "/dawn_sc_111031_111106.bc", - -- kernels .. "/dawn_sc_111107_111113.bc", - -- kernels .. "/dawn_sc_111114_111120.bc", - -- kernels .. "/dawn_sc_111121_111127.bc", - -- kernels .. "/dawn_sc_111128_111204.bc", - -- kernels .. "/dawn_sc_111205_111211.bc", - -- kernels .. "/dawn_sc_111212_111218.bc", - -- kernels .. "/dawn_sc_111219_111225.bc", - -- kernels .. "/dawn_sc_111226_120101.bc", - -- kernels .. "/dawn_sc_120102_120108.bc", - -- kernels .. "/dawn_sc_120109_120115.bc", - -- kernels .. "/dawn_sc_120116_120122.bc", - -- kernels .. "/dawn_sc_120123_120129.bc", - -- kernels .. "/dawn_sc_120130_120205.bc", - -- kernels .. "/dawn_sc_120206_120212.bc", - -- kernels .. "/dawn_sc_120213_120219.bc", - -- kernels .. "/dawn_sc_120220_120226.bc", - -- kernels .. "/dawn_sc_120227_120304.bc", - -- kernels .. "/dawn_sc_120305_120311.bc", - -- kernels .. "/dawn_sc_120312_120318.bc", - -- kernels .. "/dawn_sc_120319_120325.bc", - -- kernels .. "/dawn_sc_120326_120401.bc", - -- kernels .. "/dawn_sc_120402_120408.bc", - -- kernels .. "/dawn_sc_120409_120415.bc", - -- kernels .. "/dawn_sc_120416_120422.bc", - -- kernels .. "/dawn_sc_120423_120429.bc", - -- kernels .. "/dawn_sc_120430_120506.bc", - -- kernels .. "/dawn_sc_120507_120513.bc", - -- kernels .. "/dawn_sc_120514_120520.bc", - -- kernels .. "/dawn_sc_120521_120527.bc", - -- kernels .. "/dawn_sc_120528_120603.bc", - -- kernels .. "/dawn_sc_120604_120610.bc", - -- kernels .. "/dawn_sc_120611_120617.bc", - -- kernels .. "/dawn_sc_120618_120624.bc", - -- kernels .. "/dawn_sc_120625_120701.bc", - -- kernels .. "/dawn_sc_120702_120708.bc", - -- kernels .. "/dawn_sc_120709_120715.bc", - -- kernels .. "/dawn_sc_120716_120722.bc", - -- kernels .. "/dawn_sc_120723_120729.bc", - -- kernels .. "/dawn_sc_120730_120805.bc", - -- kernels .. "/dawn_sc_120806_120812.bc", - -- kernels .. "/dawn_sc_120813_120819.bc", - -- kernels .. "/dawn_sc_120820_120826.bc", - -- kernels .. "/dawn_sc_120827_120902.bc", - -- kernels .. "/dawn_sc_120903_120909.bc", - -- kernels .. "/dawn_sc_120910_120916.bc", - -- kernels .. "/dawn_sc_f2_3942xxxxx.bc", - -- kernels .. "/dawn_sc_pred_da028b_00_eu.bc", - -- kernels .. "/dawn_sc_pred_dc041a_00.bc", + -- kernels .. "dawn_sc_120123_120129.bc", + -- kernels .. "dawn_sc_070927_070930.bc", + --[[kernels .. "ck/dawn_sc_071001_071007.bc", + kernels .. "dawn_sc_071008_071014_v2.bc", + kernels .. "dawn_sc_071015_071021.bc", + kernels .. "dawn_sc_071022_071028_v2.bc", + kernels .. "dawn_sc_071029_071104.bc", + kernels .. "dawn_sc_071105_071111.bc", + kernels .. "dawn_sc_071112_071118.bc", + kernels .. "dawn_sc_071119_071125.bc", + kernels .. "dawn_sc_071126_071202.bc", + kernels .. "dawn_sc_071203_071209.bc", + kernels .. "dawn_sc_071210_071216.bc", + kernels .. "dawn_sc_071217_071223.bc", + kernels .. "dawn_sc_071224_071230.bc", + kernels .. "dawn_sc_071231_080106.bc", + kernels .. "dawn_sc_080107_080113.bc", + kernels .. "dawn_sc_080114_080120.bc", + kernels .. "dawn_sc_080121_080127.bc", + kernels .. "dawn_sc_080128_080203.bc", + kernels .. "dawn_sc_080204_080210.bc", + kernels .. "dawn_sc_080211_080217.bc", + kernels .. "dawn_sc_080218_080224.bc", + kernels .. "dawn_sc_080225_080302.bc", + kernels .. "dawn_sc_080303_080309.bc", + kernels .. "dawn_sc_080310_080316.bc", + kernels .. "dawn_sc_080317_080323.bc", + kernels .. "dawn_sc_080324_080330.bc", + kernels .. "dawn_sc_080331_080406.bc", + kernels .. "dawn_sc_080407_080413.bc", + kernels .. "dawn_sc_080414_080420.bc", + kernels .. "dawn_sc_080421_080427.bc", + kernels .. "dawn_sc_080428_080504.bc", + kernels .. "dawn_sc_080505_080511.bc", + kernels .. "dawn_sc_080512_080518.bc", + kernels .. "dawn_sc_080519_080525.bc", + kernels .. "dawn_sc_080526_080601.bc", + kernels .. "dawn_sc_080602_080608.bc", + kernels .. "dawn_sc_080609_080615.bc", + kernels .. "dawn_sc_080616_080622.bc", + kernels .. "dawn_sc_080623_080629.bc", + kernels .. "dawn_sc_080630_080706.bc", + kernels .. "dawn_sc_080707_080713.bc", + kernels .. "dawn_sc_080714_080720.bc", + kernels .. "dawn_sc_080721_080727.bc", + kernels .. "dawn_sc_080728_080803.bc", + kernels .. "dawn_sc_080804_080810.bc", + kernels .. "dawn_sc_080811_080817.bc", + kernels .. "dawn_sc_080818_080824.bc", + kernels .. "dawn_sc_080825_080831.bc", + kernels .. "dawn_sc_080901_080907.bc", + kernels .. "dawn_sc_080908_080914.bc", + kernels .. "dawn_sc_080915_080921.bc", + kernels .. "dawn_sc_080922_080928.bc", + kernels .. "dawn_sc_080929_081005.bc", + kernels .. "dawn_sc_081006_081012.bc", + kernels .. "dawn_sc_081013_081019.bc", + kernels .. "dawn_sc_081020_081026.bc", + kernels .. "dawn_sc_081027_081102.bc", + kernels .. "dawn_sc_081103_081109.bc", + kernels .. "dawn_sc_081110_081116.bc", + kernels .. "dawn_sc_081117_081123.bc", + kernels .. "dawn_sc_081124_081130.bc", + kernels .. "dawn_sc_081201_081207.bc", + kernels .. "dawn_sc_081208_081214.bc", + kernels .. "dawn_sc_081215_081221.bc", + kernels .. "dawn_sc_081222_081228.bc", + kernels .. "dawn_sc_081229_090104.bc", + kernels .. "dawn_sc_090105_090111.bc", + kernels .. "dawn_sc_090112_090118.bc", + kernels .. "dawn_sc_090119_090125.bc", + kernels .. "dawn_sc_090126_090201.bc", + kernels .. "dawn_sc_090202_090208.bc", + kernels .. "dawn_sc_090209_090215.bc", + kernels .. "dawn_sc_090216_090222.bc", + kernels .. "dawn_sc_090223_090301.bc", + kernels .. "dawn_sc_090302_090308.bc", + kernels .. "dawn_sc_090309_090315.bc", + kernels .. "dawn_sc_090316_090322.bc", + kernels .. "dawn_sc_090323_090329.bc", + kernels .. "dawn_sc_090330_090405.bc", + kernels .. "dawn_sc_090406_090412.bc", + kernels .. "dawn_sc_090413_090419.bc", + kernels .. "dawn_sc_090420_090426.bc", + kernels .. "dawn_sc_090427_090503.bc", + kernels .. "dawn_sc_090504_090510.bc", + kernels .. "dawn_sc_090511_090517.bc", + kernels .. "dawn_sc_090518_090524.bc", + kernels .. "dawn_sc_090525_090531.bc", + kernels .. "dawn_sc_090601_090607.bc", + kernels .. "dawn_sc_090608_090614.bc", + kernels .. "dawn_sc_090615_090621.bc", + kernels .. "dawn_sc_090622_090628.bc", + kernels .. "dawn_sc_090629_090705.bc", + kernels .. "dawn_sc_090706_090712.bc", + kernels .. "dawn_sc_090713_090719.bc", + kernels .. "dawn_sc_090720_090726.bc", + kernels .. "dawn_sc_090727_090802.bc", + kernels .. "dawn_sc_090803_090809.bc", + kernels .. "dawn_sc_090810_090816.bc", + kernels .. "dawn_sc_090817_090823.bc", + kernels .. "dawn_sc_090824_090830.bc", + kernels .. "dawn_sc_090831_090906.bc", + kernels .. "dawn_sc_090907_090913.bc", + kernels .. "dawn_sc_090914_090920.bc", + kernels .. "dawn_sc_090921_090927.bc", + kernels .. "dawn_sc_090928_091004.bc", + kernels .. "dawn_sc_091005_091011.bc", + kernels .. "dawn_sc_091012_091018.bc", + kernels .. "dawn_sc_091019_091025.bc", + kernels .. "dawn_sc_091026_091101.bc", + kernels .. "dawn_sc_091102_091108.bc", + kernels .. "dawn_sc_091109_091115.bc", + kernels .. "dawn_sc_091116_091122.bc", + kernels .. "dawn_sc_091123_091129.bc", + kernels .. "dawn_sc_091130_091206.bc", + kernels .. "dawn_sc_091207_091213.bc", + kernels .. "dawn_sc_091214_091220.bc", + kernels .. "dawn_sc_091221_091227.bc", + kernels .. "dawn_sc_091228_100103.bc", + kernels .. "dawn_sc_100104_100110_v2.bc", + kernels .. "dawn_sc_100111_100117_v2.bc",--]] + -- kernels .. "dawn_sc_100118_100124.bc", + -- kernels .. "dawn_sc_100125_100131.bc", + -- kernels .. "dawn_sc_100201_100207.bc", + -- kernels .. "dawn_sc_100208_100214.bc", + -- kernels .. "dawn_sc_100215_100221.bc", + -- kernels .. "dawn_sc_100222_100228.bc", + -- kernels .. "dawn_sc_100301_100307.bc", + -- kernels .. "dawn_sc_100308_100314.bc", + -- kernels .. "dawn_sc_100315_100321.bc", + -- kernels .. "dawn_sc_100322_100328.bc", + -- kernels .. "dawn_sc_100329_100404.bc", + -- kernels .. "dawn_sc_100405_100411.bc", + -- kernels .. "dawn_sc_100412_100418.bc", + -- kernels .. "dawn_sc_100419_100425.bc", + -- kernels .. "dawn_sc_100426_100502.bc", + -- kernels .. "dawn_sc_100503_100509.bc", + -- kernels .. "dawn_sc_100510_100516.bc", + -- kernels .. "dawn_sc_100517_100523.bc", + -- kernels .. "dawn_sc_100524_100530.bc", + -- kernels .. "dawn_sc_100531_100606.bc", + -- kernels .. "dawn_sc_100607_100613.bc", + -- kernels .. "dawn_sc_100614_100620.bc", + -- kernels .. "dawn_sc_100621_100627.bc", + -- kernels .. "dawn_sc_100628_100704.bc", + -- kernels .. "dawn_sc_100705_100711.bc", + -- kernels .. "dawn_sc_100712_100718.bc", + -- kernels .. "dawn_sc_100719_100725.bc", + -- kernels .. "dawn_sc_100726_100801.bc", + -- kernels .. "dawn_sc_100802_100808.bc", + -- kernels .. "dawn_sc_100809_100815.bc", + -- kernels .. "dawn_sc_100816_100822.bc", + -- kernels .. "dawn_sc_100823_100829.bc", + -- kernels .. "dawn_sc_100830_100905.bc", + -- kernels .. "dawn_sc_100906_100912.bc", + -- kernels .. "dawn_sc_100913_100919.bc", + -- kernels .. "dawn_sc_100920_100926.bc", + -- kernels .. "dawn_sc_100927_101003.bc", + -- kernels .. "dawn_sc_101004_101010.bc", + -- kernels .. "dawn_sc_101011_101017.bc", + -- kernels .. "dawn_sc_101018_101024.bc", + -- kernels .. "dawn_sc_101025_101031.bc", + -- kernels .. "dawn_sc_101101_101107.bc", + -- kernels .. "dawn_sc_101108_101114.bc", + -- kernels .. "dawn_sc_101115_101121.bc", + -- kernels .. "dawn_sc_101122_101128.bc", + -- kernels .. "dawn_sc_101129_101205.bc", + -- kernels .. "dawn_sc_101206_101212.bc", + -- kernels .. "dawn_sc_101213_101219.bc", + -- kernels .. "dawn_sc_101220_101226.bc", + -- kernels .. "dawn_sc_101227_110102.bc", + -- kernels .. "dawn_sc_110103_110109.bc", + -- kernels .. "dawn_sc_110110_110116.bc", + -- kernels .. "dawn_sc_110117_110123.bc", + -- kernels .. "dawn_sc_110124_110130.bc", + -- kernels .. "dawn_sc_110131_110206.bc", + -- kernels .. "dawn_sc_110207_110213.bc", + -- kernels .. "dawn_sc_110214_110220.bc", + -- kernels .. "dawn_sc_110221_110227.bc", + -- kernels .. "dawn_sc_110228_110306.bc", + -- kernels .. "dawn_sc_110307_110313.bc", + -- kernels .. "dawn_sc_110314_110320.bc", + -- kernels .. "dawn_sc_110321_110327.bc", + -- kernels .. "dawn_sc_110328_110403.bc", + -- kernels .. "dawn_sc_110404_110410.bc", + -- kernels .. "dawn_sc_110411_110417.bc", + -- kernels .. "dawn_sc_110418_110424.bc", + -- kernels .. "dawn_sc_110425_110501.bc", + -- kernels .. "dawn_sc_110502_110508.bc", + -- kernels .. "dawn_sc_110509_110515.bc", + -- kernels .. "dawn_sc_110516_110522.bc", + -- kernels .. "dawn_sc_110523_110529.bc", + -- kernels .. "dawn_sc_110530_110605.bc", + -- kernels .. "dawn_sc_110606_110612.bc", + -- kernels .. "dawn_sc_110613_110619.bc", + -- kernels .. "dawn_sc_110620_110626.bc", + -- kernels .. "dawn_sc_110627_110703.bc", + -- kernels .. "dawn_sc_110704_110710.bc", + -- kernels .. "dawn_sc_110711_110717.bc", + -- kernels .. "dawn_sc_110718_110724.bc", + -- kernels .. "dawn_sc_110725_110731.bc", + -- kernels .. "dawn_sc_110801_110807.bc", + -- kernels .. "dawn_sc_110808_110814.bc", + -- kernels .. "dawn_sc_110815_110821.bc", + -- kernels .. "dawn_sc_110822_110828.bc", + -- kernels .. "dawn_sc_110829_110904.bc", + -- kernels .. "dawn_sc_110905_110911.bc", + -- kernels .. "dawn_sc_110912_110918.bc", + -- kernels .. "dawn_sc_110919_110925.bc", + -- kernels .. "dawn_sc_110926_111002.bc", + -- kernels .. "dawn_sc_111003_111009.bc", + -- kernels .. "dawn_sc_111010_111016.bc", + -- kernels .. "dawn_sc_111017_111023.bc", + -- kernels .. "dawn_sc_111024_111030.bc", + -- kernels .. "dawn_sc_111031_111106.bc", + -- kernels .. "dawn_sc_111107_111113.bc", + -- kernels .. "dawn_sc_111114_111120.bc", + -- kernels .. "dawn_sc_111121_111127.bc", + -- kernels .. "dawn_sc_111128_111204.bc", + -- kernels .. "dawn_sc_111205_111211.bc", + -- kernels .. "dawn_sc_111212_111218.bc", + -- kernels .. "dawn_sc_111219_111225.bc", + -- kernels .. "dawn_sc_111226_120101.bc", + -- kernels .. "dawn_sc_120102_120108.bc", + -- kernels .. "dawn_sc_120109_120115.bc", + -- kernels .. "dawn_sc_120116_120122.bc", + -- kernels .. "dawn_sc_120123_120129.bc", + -- kernels .. "dawn_sc_120130_120205.bc", + -- kernels .. "dawn_sc_120206_120212.bc", + -- kernels .. "dawn_sc_120213_120219.bc", + -- kernels .. "dawn_sc_120220_120226.bc", + -- kernels .. "dawn_sc_120227_120304.bc", + -- kernels .. "dawn_sc_120305_120311.bc", + -- kernels .. "dawn_sc_120312_120318.bc", + -- kernels .. "dawn_sc_120319_120325.bc", + -- kernels .. "dawn_sc_120326_120401.bc", + -- kernels .. "dawn_sc_120402_120408.bc", + -- kernels .. "dawn_sc_120409_120415.bc", + -- kernels .. "dawn_sc_120416_120422.bc", + -- kernels .. "dawn_sc_120423_120429.bc", + -- kernels .. "dawn_sc_120430_120506.bc", + -- kernels .. "dawn_sc_120507_120513.bc", + -- kernels .. "dawn_sc_120514_120520.bc", + -- kernels .. "dawn_sc_120521_120527.bc", + -- kernels .. "dawn_sc_120528_120603.bc", + -- kernels .. "dawn_sc_120604_120610.bc", + -- kernels .. "dawn_sc_120611_120617.bc", + -- kernels .. "dawn_sc_120618_120624.bc", + -- kernels .. "dawn_sc_120625_120701.bc", + -- kernels .. "dawn_sc_120702_120708.bc", + -- kernels .. "dawn_sc_120709_120715.bc", + -- kernels .. "dawn_sc_120716_120722.bc", + -- kernels .. "dawn_sc_120723_120729.bc", + -- kernels .. "dawn_sc_120730_120805.bc", + -- kernels .. "dawn_sc_120806_120812.bc", + -- kernels .. "dawn_sc_120813_120819.bc", + -- kernels .. "dawn_sc_120820_120826.bc", + -- kernels .. "dawn_sc_120827_120902.bc", + -- kernels .. "dawn_sc_120903_120909.bc", + -- kernels .. "dawn_sc_120910_120916.bc", + -- kernels .. "dawn_sc_f2_3942xxxxx.bc", + -- kernels .. "dawn_sc_pred_da028b_00_eu.bc", + -- kernels .. "dawn_sc_pred_dc041a_00.bc", -- Solar array rotation kernels ~ 2gb - kernels .. "/dawn_sa_070927_070930.bc", - --[[kernels .. "/ck/dawn_sa_071001_071007.bc", - kernels .. "/dawn_sa_071008_071014.bc", - kernels .. "/dawn_sa_071015_071021.bc", - kernels .. "/dawn_sa_071022_071028_v2.bc", - kernels .. "/dawn_sa_071029_071104.bc", - kernels .. "/dawn_sa_071105_071111.bc", - kernels .. "/dawn_sa_071112_071118.bc", - kernels .. "/dawn_sa_071119_071125.bc", - kernels .. "/dawn_sa_071126_071202.bc", - kernels .. "/dawn_sa_071203_071209.bc", - kernels .. "/dawn_sa_071210_071216.bc", - kernels .. "/dawn_sa_071217_071223.bc", - kernels .. "/dawn_sa_071224_071230.bc", - kernels .. "/dawn_sa_071231_080106.bc", - kernels .. "/dawn_sa_080107_080113.bc", - kernels .. "/dawn_sa_080114_080120.bc", - kernels .. "/dawn_sa_080121_080127.bc", - kernels .. "/dawn_sa_080128_080203.bc", - kernels .. "/dawn_sa_080204_080210.bc", - kernels .. "/dawn_sa_080211_080217.bc", - kernels .. "/dawn_sa_080218_080224.bc", - kernels .. "/dawn_sa_080225_080302.bc", - kernels .. "/dawn_sa_080303_080309.bc", - kernels .. "/dawn_sa_080310_080316.bc", - kernels .. "/dawn_sa_080317_080323.bc", - kernels .. "/dawn_sa_080324_080330.bc", - kernels .. "/dawn_sa_080331_080406.bc", - kernels .. "/dawn_sa_080407_080413.bc", - kernels .. "/dawn_sa_080414_080420.bc", - kernels .. "/dawn_sa_080421_080427.bc", - kernels .. "/dawn_sa_080428_080504.bc", - kernels .. "/dawn_sa_080505_080511.bc", - kernels .. "/dawn_sa_080512_080518.bc", - kernels .. "/dawn_sa_080519_080525.bc", - kernels .. "/dawn_sa_080526_080601.bc", - kernels .. "/dawn_sa_080602_080608.bc", - kernels .. "/dawn_sa_080609_080615.bc", - kernels .. "/dawn_sa_080616_080622.bc", - kernels .. "/dawn_sa_080623_080629.bc", - kernels .. "/dawn_sa_080630_080706.bc", - kernels .. "/dawn_sa_080707_080713.bc", - kernels .. "/dawn_sa_080714_080720.bc", - kernels .. "/dawn_sa_080721_080727.bc", - kernels .. "/dawn_sa_080728_080803.bc", - kernels .. "/dawn_sa_080804_080810.bc", - kernels .. "/dawn_sa_080811_080817.bc", - kernels .. "/dawn_sa_080818_080824.bc", - kernels .. "/dawn_sa_080825_080831.bc", - kernels .. "/dawn_sa_080901_080907.bc", - kernels .. "/dawn_sa_080908_080914.bc", - kernels .. "/dawn_sa_080915_080921.bc", - kernels .. "/dawn_sa_080922_080928.bc", - kernels .. "/dawn_sa_080929_081005.bc", - kernels .. "/dawn_sa_081006_081012.bc", - kernels .. "/dawn_sa_081013_081019.bc", - kernels .. "/dawn_sa_081020_081026.bc", - kernels .. "/dawn_sa_081027_081102.bc", - kernels .. "/dawn_sa_081103_081109.bc", - kernels .. "/dawn_sa_081110_081116.bc", - kernels .. "/dawn_sa_081117_081123.bc", - kernels .. "/dawn_sa_081124_081130.bc", - kernels .. "/dawn_sa_081201_081207.bc", - kernels .. "/dawn_sa_081208_081214.bc", - kernels .. "/dawn_sa_081215_081221.bc", - kernels .. "/dawn_sa_081222_081228.bc", - kernels .. "/dawn_sa_081229_090104.bc", - kernels .. "/dawn_sa_090105_090111.bc", - kernels .. "/dawn_sa_090112_090118.bc", - kernels .. "/dawn_sa_090119_090125.bc", - kernels .. "/dawn_sa_090126_090201.bc", - kernels .. "/dawn_sa_090202_090208.bc", - kernels .. "/dawn_sa_090209_090215.bc", - kernels .. "/dawn_sa_090216_090222.bc", - kernels .. "/dawn_sa_090223_090301.bc", - kernels .. "/dawn_sa_090302_090308.bc", - kernels .. "/dawn_sa_090309_090315.bc", - kernels .. "/dawn_sa_090316_090322.bc", - kernels .. "/dawn_sa_090323_090329.bc", - kernels .. "/dawn_sa_090330_090405.bc", - kernels .. "/dawn_sa_090406_090412.bc", - kernels .. "/dawn_sa_090413_090419.bc", - kernels .. "/dawn_sa_090420_090426.bc", - kernels .. "/dawn_sa_090427_090503.bc", - kernels .. "/dawn_sa_090504_090510.bc", - kernels .. "/dawn_sa_090511_090517.bc", - kernels .. "/dawn_sa_090518_090524.bc", - kernels .. "/dawn_sa_090525_090531.bc", - kernels .. "/dawn_sa_090601_090607.bc", - kernels .. "/dawn_sa_090608_090614.bc", - kernels .. "/dawn_sa_090615_090621.bc", - kernels .. "/dawn_sa_090622_090628.bc", - kernels .. "/dawn_sa_090629_090705.bc", - kernels .. "/dawn_sa_090706_090712.bc", - kernels .. "/dawn_sa_090713_090719.bc", - kernels .. "/dawn_sa_090720_090726.bc", - kernels .. "/dawn_sa_090727_090802.bc", - kernels .. "/dawn_sa_090803_090809.bc", - kernels .. "/dawn_sa_090810_090816.bc", - kernels .. "/dawn_sa_090817_090823.bc", - kernels .. "/dawn_sa_090824_090830.bc", - kernels .. "/dawn_sa_090831_090906.bc", - kernels .. "/dawn_sa_090907_090913.bc", - kernels .. "/dawn_sa_090914_090920.bc", - kernels .. "/dawn_sa_090921_090927.bc", - kernels .. "/dawn_sa_090928_091004.bc", - kernels .. "/dawn_sa_091005_091011.bc", - kernels .. "/dawn_sa_091012_091018.bc", - kernels .. "/dawn_sa_091019_091025.bc", - kernels .. "/dawn_sa_091026_091101.bc", - kernels .. "/dawn_sa_091102_091108.bc", - kernels .. "/dawn_sa_091109_091115.bc", - kernels .. "/dawn_sa_091116_091122.bc", - kernels .. "/dawn_sa_091123_091129.bc", - kernels .. "/dawn_sa_091130_091206.bc", - kernels .. "/dawn_sa_091207_091213.bc", - kernels .. "/dawn_sa_091214_091220.bc", - kernels .. "/dawn_sa_091221_091227.bc", - kernels .. "/dawn_sa_091228_100103.bc", - kernels .. "/dawn_sa_100104_100110_v2.bc", - kernels .. "/dawn_sa_100111_100117_v2.bc", - kernels .. "/dawn_sa_100118_100124.bc", - kernels .. "/dawn_sa_100125_100131.bc", - kernels .. "/dawn_sa_100201_100207.bc", - kernels .. "/dawn_sa_100208_100214.bc", - kernels .. "/dawn_sa_100215_100221.bc", - kernels .. "/dawn_sa_100222_100228.bc", - kernels .. "/dawn_sa_100301_100307.bc", - kernels .. "/dawn_sa_100308_100314.bc", - kernels .. "/dawn_sa_100315_100321.bc", - kernels .. "/dawn_sa_100322_100328.bc", - kernels .. "/dawn_sa_100329_100404.bc", - kernels .. "/dawn_sa_100405_100411.bc", - kernels .. "/dawn_sa_100412_100418.bc", - kernels .. "/dawn_sa_100419_100425.bc", - kernels .. "/dawn_sa_100426_100502.bc", - kernels .. "/dawn_sa_100503_100509.bc", - kernels .. "/dawn_sa_100510_100516.bc", - kernels .. "/dawn_sa_100517_100523.bc", - kernels .. "/dawn_sa_100524_100530.bc", - kernels .. "/dawn_sa_100531_100606.bc", - kernels .. "/dawn_sa_100607_100613.bc", - kernels .. "/dawn_sa_100614_100620.bc", - kernels .. "/dawn_sa_100621_100627.bc", - kernels .. "/dawn_sa_100628_100704.bc", - kernels .. "/dawn_sa_100705_100711.bc", - kernels .. "/dawn_sa_100712_100718.bc", - kernels .. "/dawn_sa_100719_100725.bc", - kernels .. "/dawn_sa_100726_100801.bc", - kernels .. "/dawn_sa_100802_100808.bc", - kernels .. "/dawn_sa_100809_100815.bc", - kernels .. "/dawn_sa_100816_100822.bc", - kernels .. "/dawn_sa_100823_100829.bc", - kernels .. "/dawn_sa_100830_100905.bc", - kernels .. "/dawn_sa_100906_100912.bc", - kernels .. "/dawn_sa_100913_100919.bc", - kernels .. "/dawn_sa_100920_100926.bc", - kernels .. "/dawn_sa_100927_101003.bc", - kernels .. "/dawn_sa_101004_101010.bc", - kernels .. "/dawn_sa_101011_101017.bc", --]] - -- kernels .. "/dawn_sa_101018_101024.bc", - -- kernels .. "/dawn_sa_101025_101031.bc", - -- kernels .. "/dawn_sa_101101_101107.bc", - -- kernels .. "/dawn_sa_101108_101114.bc", - -- kernels .. "/dawn_sa_101115_101121.bc", - -- kernels .. "/dawn_sa_101122_101128.bc", - -- kernels .. "/dawn_sa_101129_101205.bc", - -- kernels .. "/dawn_sa_101206_101212.bc", - -- kernels .. "/dawn_sa_101213_101219.bc", - -- kernels .. "/dawn_sa_101220_101226.bc", - -- kernels .. "/dawn_sa_101227_110102.bc", - -- kernels .. "/dawn_sa_110103_110109.bc", - -- kernels .. "/dawn_sa_110110_110116.bc", - -- kernels .. "/dawn_sa_110117_110123.bc", - -- kernels .. "/dawn_sa_110124_110130.bc", - -- kernels .. "/dawn_sa_110131_110206.bc", - -- kernels .. "/dawn_sa_110207_110213.bc", - -- kernels .. "/dawn_sa_110214_110220.bc", - -- kernels .. "/dawn_sa_110221_110227.bc", - -- kernels .. "/dawn_sa_110228_110306.bc", - -- kernels .. "/dawn_sa_110307_110313.bc", - -- kernels .. "/dawn_sa_110314_110320.bc", - -- kernels .. "/dawn_sa_110321_110327.bc", - -- kernels .. "/dawn_sa_110328_110403.bc", - -- kernels .. "/dawn_sa_110404_110410.bc", - -- kernels .. "/dawn_sa_110411_110417.bc", - -- kernels .. "/dawn_sa_110418_110424.bc", - -- kernels .. "/dawn_sa_110425_110501.bc", - -- kernels .. "/dawn_sa_110502_110508.bc", - -- kernels .. "/dawn_sa_110509_110515.bc", - -- kernels .. "/dawn_sa_110516_110522.bc", - -- kernels .. "/dawn_sa_110523_110529.bc", - -- kernels .. "/dawn_sa_110530_110605.bc", - -- kernels .. "/dawn_sa_110606_110612.bc", - -- kernels .. "/dawn_sa_110613_110619.bc", - -- kernels .. "/dawn_sa_110620_110626.bc", - -- kernels .. "/dawn_sa_110627_110703.bc", - -- kernels .. "/dawn_sa_110704_110710.bc", - -- kernels .. "/dawn_sa_110711_110717.bc", - -- kernels .. "/dawn_sa_110718_110724.bc", - -- kernels .. "/dawn_sa_110725_110731.bc", - -- kernels .. "/dawn_sa_110801_110807.bc", - -- kernels .. "/dawn_sa_110808_110814.bc", - -- kernels .. "/dawn_sa_110815_110821.bc", - -- kernels .. "/dawn_sa_110822_110828.bc", - -- kernels .. "/dawn_sa_110829_110904.bc", - -- kernels .. "/dawn_sa_110905_110911.bc", - -- kernels .. "/dawn_sa_110912_110918.bc", - -- kernels .. "/dawn_sa_110919_110925.bc", - -- kernels .. "/dawn_sa_110926_111002.bc", - -- kernels .. "/dawn_sa_111003_111009.bc", - -- kernels .. "/dawn_sa_111010_111016.bc", - -- kernels .. "/dawn_sa_111017_111023.bc", - -- kernels .. "/dawn_sa_111024_111030.bc", - -- kernels .. "/dawn_sa_111031_111106.bc", - -- kernels .. "/dawn_sa_111107_111113.bc", - -- kernels .. "/dawn_sa_111114_111120.bc", - -- kernels .. "/dawn_sa_111121_111127.bc", - -- kernels .. "/dawn_sa_111128_111204.bc", - -- kernels .. "/dawn_sa_111205_111211.bc", - -- kernels .. "/dawn_sa_111212_111218.bc", - -- kernels .. "/dawn_sa_111219_111225.bc", - -- kernels .. "/dawn_sa_111226_120101.bc", - -- kernels .. "/dawn_sa_120102_120108.bc", - -- kernels .. "/dawn_sa_120109_120115.bc", - -- kernels .. "/dawn_sa_120116_120122.bc", - -- kernels .. "/dawn_sa_120123_120129.bc", - -- kernels .. "/dawn_sa_120130_120205.bc", - -- kernels .. "/dawn_sa_120206_120212.bc", - -- kernels .. "/dawn_sa_120213_120219.bc", - -- kernels .. "/dawn_sa_120220_120226.bc", - -- kernels .. "/dawn_sa_120227_120304.bc", - -- kernels .. "/dawn_sa_120305_120311.bc", - -- kernels .. "/dawn_sa_120312_120318.bc", - -- kernels .. "/dawn_sa_120319_120325.bc", - -- kernels .. "/dawn_sa_120326_120401.bc", - -- kernels .. "/dawn_sa_120402_120408.bc", - -- kernels .. "/dawn_sa_120409_120415.bc", - -- kernels .. "/dawn_sa_120416_120422.bc", - -- kernels .. "/dawn_sa_120423_120429.bc", - -- kernels .. "/dawn_sa_120430_120506.bc", - -- kernels .. "/dawn_sa_120507_120513.bc", - -- kernels .. "/dawn_sa_120514_120520.bc", - -- kernels .. "/dawn_sa_120521_120527.bc", - -- kernels .. "/dawn_sa_120528_120603.bc", - -- kernels .. "/dawn_sa_120604_120610.bc", - -- kernels .. "/dawn_sa_120611_120617.bc", - -- kernels .. "/dawn_sa_120618_120624.bc", - -- kernels .. "/dawn_sa_120625_120701.bc", - -- kernels .. "/dawn_sa_120702_120708.bc", - -- kernels .. "/dawn_sa_120709_120715.bc", - -- kernels .. "/dawn_sa_120716_120722.bc", - -- kernels .. "/dawn_sa_120723_120729.bc", - -- kernels .. "/dawn_sa_120730_120805.bc", - -- kernels .. "/dawn_sa_120806_120812.bc", - -- kernels .. "/dawn_sa_120813_120819.bc", - -- kernels .. "/dawn_sa_120820_120826.bc", - -- kernels .. "/dawn_sa_120827_120902.bc", - -- kernels .. "/dawn_sa_120903_120909.bc", - -- kernels .. "/dawn_sa_120910_120916.bc", + kernels .. "dawn_sa_070927_070930.bc", + --[[kernels .. "ck/dawn_sa_071001_071007.bc", + kernels .. "dawn_sa_071008_071014.bc", + kernels .. "dawn_sa_071015_071021.bc", + kernels .. "dawn_sa_071022_071028_v2.bc", + kernels .. "dawn_sa_071029_071104.bc", + kernels .. "dawn_sa_071105_071111.bc", + kernels .. "dawn_sa_071112_071118.bc", + kernels .. "dawn_sa_071119_071125.bc", + kernels .. "dawn_sa_071126_071202.bc", + kernels .. "dawn_sa_071203_071209.bc", + kernels .. "dawn_sa_071210_071216.bc", + kernels .. "dawn_sa_071217_071223.bc", + kernels .. "dawn_sa_071224_071230.bc", + kernels .. "dawn_sa_071231_080106.bc", + kernels .. "dawn_sa_080107_080113.bc", + kernels .. "dawn_sa_080114_080120.bc", + kernels .. "dawn_sa_080121_080127.bc", + kernels .. "dawn_sa_080128_080203.bc", + kernels .. "dawn_sa_080204_080210.bc", + kernels .. "dawn_sa_080211_080217.bc", + kernels .. "dawn_sa_080218_080224.bc", + kernels .. "dawn_sa_080225_080302.bc", + kernels .. "dawn_sa_080303_080309.bc", + kernels .. "dawn_sa_080310_080316.bc", + kernels .. "dawn_sa_080317_080323.bc", + kernels .. "dawn_sa_080324_080330.bc", + kernels .. "dawn_sa_080331_080406.bc", + kernels .. "dawn_sa_080407_080413.bc", + kernels .. "dawn_sa_080414_080420.bc", + kernels .. "dawn_sa_080421_080427.bc", + kernels .. "dawn_sa_080428_080504.bc", + kernels .. "dawn_sa_080505_080511.bc", + kernels .. "dawn_sa_080512_080518.bc", + kernels .. "dawn_sa_080519_080525.bc", + kernels .. "dawn_sa_080526_080601.bc", + kernels .. "dawn_sa_080602_080608.bc", + kernels .. "dawn_sa_080609_080615.bc", + kernels .. "dawn_sa_080616_080622.bc", + kernels .. "dawn_sa_080623_080629.bc", + kernels .. "dawn_sa_080630_080706.bc", + kernels .. "dawn_sa_080707_080713.bc", + kernels .. "dawn_sa_080714_080720.bc", + kernels .. "dawn_sa_080721_080727.bc", + kernels .. "dawn_sa_080728_080803.bc", + kernels .. "dawn_sa_080804_080810.bc", + kernels .. "dawn_sa_080811_080817.bc", + kernels .. "dawn_sa_080818_080824.bc", + kernels .. "dawn_sa_080825_080831.bc", + kernels .. "dawn_sa_080901_080907.bc", + kernels .. "dawn_sa_080908_080914.bc", + kernels .. "dawn_sa_080915_080921.bc", + kernels .. "dawn_sa_080922_080928.bc", + kernels .. "dawn_sa_080929_081005.bc", + kernels .. "dawn_sa_081006_081012.bc", + kernels .. "dawn_sa_081013_081019.bc", + kernels .. "dawn_sa_081020_081026.bc", + kernels .. "dawn_sa_081027_081102.bc", + kernels .. "dawn_sa_081103_081109.bc", + kernels .. "dawn_sa_081110_081116.bc", + kernels .. "dawn_sa_081117_081123.bc", + kernels .. "dawn_sa_081124_081130.bc", + kernels .. "dawn_sa_081201_081207.bc", + kernels .. "dawn_sa_081208_081214.bc", + kernels .. "dawn_sa_081215_081221.bc", + kernels .. "dawn_sa_081222_081228.bc", + kernels .. "dawn_sa_081229_090104.bc", + kernels .. "dawn_sa_090105_090111.bc", + kernels .. "dawn_sa_090112_090118.bc", + kernels .. "dawn_sa_090119_090125.bc", + kernels .. "dawn_sa_090126_090201.bc", + kernels .. "dawn_sa_090202_090208.bc", + kernels .. "dawn_sa_090209_090215.bc", + kernels .. "dawn_sa_090216_090222.bc", + kernels .. "dawn_sa_090223_090301.bc", + kernels .. "dawn_sa_090302_090308.bc", + kernels .. "dawn_sa_090309_090315.bc", + kernels .. "dawn_sa_090316_090322.bc", + kernels .. "dawn_sa_090323_090329.bc", + kernels .. "dawn_sa_090330_090405.bc", + kernels .. "dawn_sa_090406_090412.bc", + kernels .. "dawn_sa_090413_090419.bc", + kernels .. "dawn_sa_090420_090426.bc", + kernels .. "dawn_sa_090427_090503.bc", + kernels .. "dawn_sa_090504_090510.bc", + kernels .. "dawn_sa_090511_090517.bc", + kernels .. "dawn_sa_090518_090524.bc", + kernels .. "dawn_sa_090525_090531.bc", + kernels .. "dawn_sa_090601_090607.bc", + kernels .. "dawn_sa_090608_090614.bc", + kernels .. "dawn_sa_090615_090621.bc", + kernels .. "dawn_sa_090622_090628.bc", + kernels .. "dawn_sa_090629_090705.bc", + kernels .. "dawn_sa_090706_090712.bc", + kernels .. "dawn_sa_090713_090719.bc", + kernels .. "dawn_sa_090720_090726.bc", + kernels .. "dawn_sa_090727_090802.bc", + kernels .. "dawn_sa_090803_090809.bc", + kernels .. "dawn_sa_090810_090816.bc", + kernels .. "dawn_sa_090817_090823.bc", + kernels .. "dawn_sa_090824_090830.bc", + kernels .. "dawn_sa_090831_090906.bc", + kernels .. "dawn_sa_090907_090913.bc", + kernels .. "dawn_sa_090914_090920.bc", + kernels .. "dawn_sa_090921_090927.bc", + kernels .. "dawn_sa_090928_091004.bc", + kernels .. "dawn_sa_091005_091011.bc", + kernels .. "dawn_sa_091012_091018.bc", + kernels .. "dawn_sa_091019_091025.bc", + kernels .. "dawn_sa_091026_091101.bc", + kernels .. "dawn_sa_091102_091108.bc", + kernels .. "dawn_sa_091109_091115.bc", + kernels .. "dawn_sa_091116_091122.bc", + kernels .. "dawn_sa_091123_091129.bc", + kernels .. "dawn_sa_091130_091206.bc", + kernels .. "dawn_sa_091207_091213.bc", + kernels .. "dawn_sa_091214_091220.bc", + kernels .. "dawn_sa_091221_091227.bc", + kernels .. "dawn_sa_091228_100103.bc", + kernels .. "dawn_sa_100104_100110_v2.bc", + kernels .. "dawn_sa_100111_100117_v2.bc", + kernels .. "dawn_sa_100118_100124.bc", + kernels .. "dawn_sa_100125_100131.bc", + kernels .. "dawn_sa_100201_100207.bc", + kernels .. "dawn_sa_100208_100214.bc", + kernels .. "dawn_sa_100215_100221.bc", + kernels .. "dawn_sa_100222_100228.bc", + kernels .. "dawn_sa_100301_100307.bc", + kernels .. "dawn_sa_100308_100314.bc", + kernels .. "dawn_sa_100315_100321.bc", + kernels .. "dawn_sa_100322_100328.bc", + kernels .. "dawn_sa_100329_100404.bc", + kernels .. "dawn_sa_100405_100411.bc", + kernels .. "dawn_sa_100412_100418.bc", + kernels .. "dawn_sa_100419_100425.bc", + kernels .. "dawn_sa_100426_100502.bc", + kernels .. "dawn_sa_100503_100509.bc", + kernels .. "dawn_sa_100510_100516.bc", + kernels .. "dawn_sa_100517_100523.bc", + kernels .. "dawn_sa_100524_100530.bc", + kernels .. "dawn_sa_100531_100606.bc", + kernels .. "dawn_sa_100607_100613.bc", + kernels .. "dawn_sa_100614_100620.bc", + kernels .. "dawn_sa_100621_100627.bc", + kernels .. "dawn_sa_100628_100704.bc", + kernels .. "dawn_sa_100705_100711.bc", + kernels .. "dawn_sa_100712_100718.bc", + kernels .. "dawn_sa_100719_100725.bc", + kernels .. "dawn_sa_100726_100801.bc", + kernels .. "dawn_sa_100802_100808.bc", + kernels .. "dawn_sa_100809_100815.bc", + kernels .. "dawn_sa_100816_100822.bc", + kernels .. "dawn_sa_100823_100829.bc", + kernels .. "dawn_sa_100830_100905.bc", + kernels .. "dawn_sa_100906_100912.bc", + kernels .. "dawn_sa_100913_100919.bc", + kernels .. "dawn_sa_100920_100926.bc", + kernels .. "dawn_sa_100927_101003.bc", + kernels .. "dawn_sa_101004_101010.bc", + kernels .. "dawn_sa_101011_101017.bc", --]] + -- kernels .. "dawn_sa_101018_101024.bc", + -- kernels .. "dawn_sa_101025_101031.bc", + -- kernels .. "dawn_sa_101101_101107.bc", + -- kernels .. "dawn_sa_101108_101114.bc", + -- kernels .. "dawn_sa_101115_101121.bc", + -- kernels .. "dawn_sa_101122_101128.bc", + -- kernels .. "dawn_sa_101129_101205.bc", + -- kernels .. "dawn_sa_101206_101212.bc", + -- kernels .. "dawn_sa_101213_101219.bc", + -- kernels .. "dawn_sa_101220_101226.bc", + -- kernels .. "dawn_sa_101227_110102.bc", + -- kernels .. "dawn_sa_110103_110109.bc", + -- kernels .. "dawn_sa_110110_110116.bc", + -- kernels .. "dawn_sa_110117_110123.bc", + -- kernels .. "dawn_sa_110124_110130.bc", + -- kernels .. "dawn_sa_110131_110206.bc", + -- kernels .. "dawn_sa_110207_110213.bc", + -- kernels .. "dawn_sa_110214_110220.bc", + -- kernels .. "dawn_sa_110221_110227.bc", + -- kernels .. "dawn_sa_110228_110306.bc", + -- kernels .. "dawn_sa_110307_110313.bc", + -- kernels .. "dawn_sa_110314_110320.bc", + -- kernels .. "dawn_sa_110321_110327.bc", + -- kernels .. "dawn_sa_110328_110403.bc", + -- kernels .. "dawn_sa_110404_110410.bc", + -- kernels .. "dawn_sa_110411_110417.bc", + -- kernels .. "dawn_sa_110418_110424.bc", + -- kernels .. "dawn_sa_110425_110501.bc", + -- kernels .. "dawn_sa_110502_110508.bc", + -- kernels .. "dawn_sa_110509_110515.bc", + -- kernels .. "dawn_sa_110516_110522.bc", + -- kernels .. "dawn_sa_110523_110529.bc", + -- kernels .. "dawn_sa_110530_110605.bc", + -- kernels .. "dawn_sa_110606_110612.bc", + -- kernels .. "dawn_sa_110613_110619.bc", + -- kernels .. "dawn_sa_110620_110626.bc", + -- kernels .. "dawn_sa_110627_110703.bc", + -- kernels .. "dawn_sa_110704_110710.bc", + -- kernels .. "dawn_sa_110711_110717.bc", + -- kernels .. "dawn_sa_110718_110724.bc", + -- kernels .. "dawn_sa_110725_110731.bc", + -- kernels .. "dawn_sa_110801_110807.bc", + -- kernels .. "dawn_sa_110808_110814.bc", + -- kernels .. "dawn_sa_110815_110821.bc", + -- kernels .. "dawn_sa_110822_110828.bc", + -- kernels .. "dawn_sa_110829_110904.bc", + -- kernels .. "dawn_sa_110905_110911.bc", + -- kernels .. "dawn_sa_110912_110918.bc", + -- kernels .. "dawn_sa_110919_110925.bc", + -- kernels .. "dawn_sa_110926_111002.bc", + -- kernels .. "dawn_sa_111003_111009.bc", + -- kernels .. "dawn_sa_111010_111016.bc", + -- kernels .. "dawn_sa_111017_111023.bc", + -- kernels .. "dawn_sa_111024_111030.bc", + -- kernels .. "dawn_sa_111031_111106.bc", + -- kernels .. "dawn_sa_111107_111113.bc", + -- kernels .. "dawn_sa_111114_111120.bc", + -- kernels .. "dawn_sa_111121_111127.bc", + -- kernels .. "dawn_sa_111128_111204.bc", + -- kernels .. "dawn_sa_111205_111211.bc", + -- kernels .. "dawn_sa_111212_111218.bc", + -- kernels .. "dawn_sa_111219_111225.bc", + -- kernels .. "dawn_sa_111226_120101.bc", + -- kernels .. "dawn_sa_120102_120108.bc", + -- kernels .. "dawn_sa_120109_120115.bc", + -- kernels .. "dawn_sa_120116_120122.bc", + -- kernels .. "dawn_sa_120123_120129.bc", + -- kernels .. "dawn_sa_120130_120205.bc", + -- kernels .. "dawn_sa_120206_120212.bc", + -- kernels .. "dawn_sa_120213_120219.bc", + -- kernels .. "dawn_sa_120220_120226.bc", + -- kernels .. "dawn_sa_120227_120304.bc", + -- kernels .. "dawn_sa_120305_120311.bc", + -- kernels .. "dawn_sa_120312_120318.bc", + -- kernels .. "dawn_sa_120319_120325.bc", + -- kernels .. "dawn_sa_120326_120401.bc", + -- kernels .. "dawn_sa_120402_120408.bc", + -- kernels .. "dawn_sa_120409_120415.bc", + -- kernels .. "dawn_sa_120416_120422.bc", + -- kernels .. "dawn_sa_120423_120429.bc", + -- kernels .. "dawn_sa_120430_120506.bc", + -- kernels .. "dawn_sa_120507_120513.bc", + -- kernels .. "dawn_sa_120514_120520.bc", + -- kernels .. "dawn_sa_120521_120527.bc", + -- kernels .. "dawn_sa_120528_120603.bc", + -- kernels .. "dawn_sa_120604_120610.bc", + -- kernels .. "dawn_sa_120611_120617.bc", + -- kernels .. "dawn_sa_120618_120624.bc", + -- kernels .. "dawn_sa_120625_120701.bc", + -- kernels .. "dawn_sa_120702_120708.bc", + -- kernels .. "dawn_sa_120709_120715.bc", + -- kernels .. "dawn_sa_120716_120722.bc", + -- kernels .. "dawn_sa_120723_120729.bc", + -- kernels .. "dawn_sa_120730_120805.bc", + -- kernels .. "dawn_sa_120806_120812.bc", + -- kernels .. "dawn_sa_120813_120819.bc", + -- kernels .. "dawn_sa_120820_120826.bc", + -- kernels .. "dawn_sa_120827_120902.bc", + -- kernels .. "dawn_sa_120903_120909.bc", + -- kernels .. "dawn_sa_120910_120916.bc", } local LightSources = { @@ -656,7 +656,7 @@ local Dawn = { Renderable = { Type = "RenderableModel", Body = "DAWN", - GeometryFile = models .. "/mainbodydawn.obj", + GeometryFile = models .. "mainbodydawn.obj", LightSources = LightSources }, GUI = { @@ -678,13 +678,13 @@ local DawnSolarArray1 = { -- } Rotation = { Type = "StaticRotation", - Rotation = {0.0, 4.71225, 0.0} + Rotation = { 0.0, 4.71225, 0.0 } } }, Renderable = { Type = "RenderableModel", Body = "DAWN", - GeometryFile = models .. "/solarpanelleft.obj", + GeometryFile = models .. "solarpanelleft.obj", LightSources = LightSources }, GUI = { @@ -705,13 +705,13 @@ local DawnSolarArray2 = { -- } Rotation = { Type = "StaticRotation", - Rotation = {3.1415, 1.57075, 0.0} + Rotation = { 3.1415, 1.57075, 0.0 } } }, Renderable = { Type = "RenderableModel", Body = "DAWN", - GeometryFile = models .. "/solarpanelright.obj", + GeometryFile = models .. "solarpanelright.obj", LightSources = LightSources }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/dawn/vesta.asset b/data/assets/scene/solarsystem/missions/dawn/vesta.asset index d4f79dc20f..1e2d2031db 100644 --- a/data/assets/scene/solarsystem/missions/dawn/vesta.asset +++ b/data/assets/scene/solarsystem/missions/dawn/vesta.asset @@ -39,8 +39,8 @@ local Vesta = { Target = "VESTA", Observer = "SSB", Kernels = { - --kernels .. "/dawn_vesta_v06.tpc", - kernels .. "/sb_vesta_071107.bsp" + --kernels .. "dawn_vesta_v06.tpc", + kernels .. "sb_vesta_071107.bsp" } }, Rotation = { @@ -51,7 +51,7 @@ local Vesta = { }, Renderable = { Type = "RenderableModelProjection", - GeometryFile = models .. "/VestaComet_5000.obj", + GeometryFile = models .. "VestaComet_5000.obj", BoundingSphereRadius = 10.0, Projection = { Sequence = images, diff --git a/data/assets/scene/solarsystem/missions/gaia/gaia.asset b/data/assets/scene/solarsystem/missions/gaia/gaia.asset index 638ad5833f..179ae4d995 100644 --- a/data/assets/scene/solarsystem/missions/gaia/gaia.asset +++ b/data/assets/scene/solarsystem/missions/gaia/gaia.asset @@ -31,7 +31,7 @@ local Gaia = { Renderable = { Type = "RenderableModel", Body = "GAIA", - GeometryFile = model .. "/gaia.obj", + GeometryFile = model .. "gaia.obj", LightSources = { { Type = "SceneGraphLightSource", diff --git a/data/assets/scene/solarsystem/missions/gaia/trail.asset b/data/assets/scene/solarsystem/missions/gaia/trail.asset index 64b8dfd8de..13b06318a9 100644 --- a/data/assets/scene/solarsystem/missions/gaia/trail.asset +++ b/data/assets/scene/solarsystem/missions/gaia/trail.asset @@ -16,7 +16,7 @@ local GaiaTrail = { Type = "RenderableTrailTrajectory", Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trail .. "/gaia_orbit_horizons.dat" + HorizonsTextFile = trail .. "gaia_orbit_horizons.dat" }, Color = { 0.0, 0.8, 0.7 }, ShowFullTrail = false, @@ -42,7 +42,7 @@ local GaiaTrailEclip = { Enabled = false, Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trail .. "/gaia_orbit_horizons_sun.dat" + HorizonsTextFile = trail .. "gaia_orbit_horizons_sun.dat" }, Color = { 1.0, 0.0, 0.0 }, ShowFullTrail = false, diff --git a/data/assets/scene/solarsystem/missions/gaia/transforms.asset b/data/assets/scene/solarsystem/missions/gaia/transforms.asset index 83441604d5..1cc13d306a 100644 --- a/data/assets/scene/solarsystem/missions/gaia/transforms.asset +++ b/data/assets/scene/solarsystem/missions/gaia/transforms.asset @@ -15,7 +15,7 @@ local GaiaPosition = { Transform = { Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trail .. "/gaia_orbit_horizons.dat" + HorizonsTextFile = trail .. "gaia_orbit_horizons.dat" }, }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/insight/edl.asset b/data/assets/scene/solarsystem/missions/insight/edl.asset index 8231084142..a5390a5f1f 100644 --- a/data/assets/scene/solarsystem/missions/insight/edl.asset +++ b/data/assets/scene/solarsystem/missions/insight/edl.asset @@ -17,11 +17,11 @@ local ikernels = asset.syncedResource({ }) 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', + 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 = { @@ -186,7 +186,7 @@ local Insight = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = {0.0, 0.0, -3.1415} + Rotation = { 0.0, 0.0, -3.1415 } } }, GUI = { @@ -200,7 +200,7 @@ local Insight_Entry_CapsuleA = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/cruise_insight_doubleside2_newcapsule_diffuse.obj", + GeometryFile = models .. "cruise_insight_doubleside2_newcapsule_diffuse.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -220,7 +220,7 @@ local Insight_Entry_Capsule_Ring = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_cruise_cone_ring_foil_gold.obj", + GeometryFile = models .. "insight_cruise_cone_ring_foil_gold.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -240,7 +240,7 @@ local Insight_Entry_Capsule_Plugs = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_cruise_cone_capsule_diffuse.obj", + GeometryFile = models .. "insight_cruise_cone_capsule_diffuse.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -260,7 +260,7 @@ local Insight_Entry_Heatshield = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_cruise_heatshield_foil_gold.obj", + GeometryFile = models .. "insight_cruise_heatshield_foil_gold.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -280,7 +280,7 @@ local Insight_Parachute_0 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_chute_frame01_diff1.obj", + GeometryFile = models .. "insight_chute_frame01_diff1.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -301,7 +301,7 @@ local Insight_Parachute_Cords_0 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_chute_frame01_cords1.obj", + GeometryFile = models .. "insight_chute_frame01_cords1.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -322,7 +322,7 @@ local Insight_Parachute_20 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_chute_frame20_diff1.obj", + GeometryFile = models .. "insight_chute_frame20_diff1.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -343,7 +343,7 @@ local Insight_Parachute_Cords_20 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_chute_frame20_cords1.obj", + GeometryFile = models .. "insight_chute_frame20_cords1.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -364,7 +364,7 @@ local Insight_Parachute_40 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/chute_doubleside_frame40_diff.obj", + GeometryFile = models .. "chute_doubleside_frame40_diff.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -385,7 +385,7 @@ local Insight_Parachute_Cords_40 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_chute_frame40_cords1.obj", + GeometryFile = models .. "insight_chute_frame40_cords1.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -406,7 +406,7 @@ local Insight_Lander_A001 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_AO01.obj", + GeometryFile = models .. "insight_lander_deck_AO01.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -422,7 +422,7 @@ local Insight_Lander_A002 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_AO02.obj", + GeometryFile = models .. "insight_lander_deck_AO02.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -438,7 +438,7 @@ local Insight_Lander_A003 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_AO03.obj", + GeometryFile = models .. "insight_lander_deck_AO03.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -454,7 +454,7 @@ local Insight_Lander_A004 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_AO04.obj", + GeometryFile = models .. "insight_lander_deck_AO04.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -470,7 +470,7 @@ local Insight_Lander_A005 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_AO05.obj", + GeometryFile = models .. "insight_lander_deck_AO05.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -486,7 +486,7 @@ local Insight_Lander_A006 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_AO06.obj", + GeometryFile = models .. "insight_lander_deck_AO06.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -502,7 +502,7 @@ local Insight_Lander_A007 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_AO07.obj", + GeometryFile = models .. "insight_lander_deck_AO07.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -518,7 +518,7 @@ local Insight_Lander_A008 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_AO08.obj", + GeometryFile = models .. "insight_lander_deck_AO08.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -534,7 +534,7 @@ local Insight_Lander_foil1 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_foil1.obj", + GeometryFile = models .. "insight_lander_deck_foil1.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -550,7 +550,7 @@ local Insight_Lander_Tex01 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_tex01.obj", + GeometryFile = models .. "insight_lander_deck_tex01.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -566,7 +566,7 @@ local Insight_Lander_Tex02 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_deck_tex02.obj", + GeometryFile = models .. "insight_lander_deck_tex02.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -582,7 +582,7 @@ local Insight_Legs_Stowed_tex = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_legs_stow_tex01.obj", + GeometryFile = models .. "insight_lander_legs_stow_tex01.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -603,7 +603,7 @@ local Insight_Legs_Stowed_AO06 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_legs_stow_AO06.obj", + GeometryFile = models .. "insight_lander_legs_stow_AO06.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -624,7 +624,7 @@ local Insight_Legs_Deployed_tex = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_legs_deploy_tex01.obj", + GeometryFile = models .. "insight_lander_legs_deploy_tex01.obj", ModelTransform = RotationMatrix, LightSources = LightSources, }, @@ -644,7 +644,7 @@ local Insight_Legs_Deployed_AO06 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_legs_deploy_AO06.obj", + GeometryFile = models .. "insight_lander_legs_deploy_AO06.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -664,7 +664,7 @@ local Insight_Panels_Stowed_tex = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_panels_stow_tex01.obj", + GeometryFile = models .. "insight_lander_panels_stow_tex01.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -680,7 +680,7 @@ local Insight_Panels_Stowed_tex2 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_panels_stow_tex02.obj", + GeometryFile = models .. "insight_lander_panels_stow_tex02.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -696,7 +696,7 @@ local Insight_Panels_Stowed_AO01 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_panels_stow_AO01.obj", + GeometryFile = models .. "insight_lander_panels_stow_AO01.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -712,7 +712,7 @@ local Insight_Panels_Deployed_tex = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_panels_deploy_tex01.obj", + GeometryFile = models .. "insight_lander_panels_deploy_tex01.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -732,7 +732,7 @@ local Insight_Panels_Deployed_tex2 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_panels_deploy_tex02.obj", + GeometryFile = models .. "insight_lander_panels_deploy_tex02.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -752,7 +752,7 @@ local Insight_Panels_Deployed_AO06 = { Parent = Insight.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/insight_lander_panels_deploy_AO01.obj", + GeometryFile = models .. "insight_lander_panels_deploy_AO01.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, diff --git a/data/assets/scene/solarsystem/missions/juno/juno.asset b/data/assets/scene/solarsystem/missions/juno/juno.asset index dfa44f584f..16ef39a3e3 100644 --- a/data/assets/scene/solarsystem/missions/juno/juno.asset +++ b/data/assets/scene/solarsystem/missions/juno/juno.asset @@ -19,110 +19,110 @@ local kernels = asset.syncedResource({ }) local JunoKernels = { - kernels .. "/juno_v12.tf", - kernels .. "/JNO_SCLKSCET.00039.tsc", - kernels .. "/juno_jade_v00.ti", - kernels .. "/juno_jedi_v00.ti", - kernels .. "/juno_jiram_v01.ti", - kernels .. "/juno_junocam_v00.ti", - kernels .. "/juno_mag_v00.ti", - kernels .. "/juno_mwr_v01.ti", - kernels .. "/juno_struct_v01.ti", - kernels .. "/juno_uvs_v00.ti", - 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", - kernels .. "/juno_sc_prl_111223_120127_jc006a02_v01.bc", - kernels .. "/juno_sc_prl_120127_120217_jc007a00_v01.bc", - kernels .. "/juno_sc_prl_120217_120316_jc008b00_v02.bc", - kernels .. "/juno_sc_prl_120316_120413_jc009a00_v01.bc", - kernels .. "/juno_sc_prl_120413_120511_jc010a04_v01.bc", - kernels .. "/juno_sc_prl_120511_120608_jc011a01_v02.bc", - kernels .. "/juno_sc_prl_120608_120706_jc012b01_v01.bc", - kernels .. "/juno_sc_prl_120706_120802_jc013a01_v01.bc", - kernels .. "/juno_sc_prl_120802_120824_jc014b01_v01.bc", - kernels .. "/juno_sc_prl_120824_120928_jc015m00_v01.bc", - kernels .. "/juno_sc_prl_120919_120928_jc015o00_v01.bc", - kernels .. "/juno_sc_prl_120928_121026_jc016c03_v01.bc", - kernels .. "/juno_sc_prl_121026_121123_jc017a01_v01.bc", - kernels .. "/juno_sc_prl_121123_121221_jc018b01_v01.bc", - kernels .. "/juno_sc_prl_121221_130118_jc019a01_v01.bc", - kernels .. "/juno_sc_prl_130118_130215_jc020b01_v01.bc", - kernels .. "/juno_sc_prl_130315_130412_jc022b01_v01.bc", - kernels .. "/juno_sc_prl_130412_130510_jc023b03_v01.bc", - kernels .. "/juno_sc_prl_130510_130607_jc024a01_v01.bc", - kernels .. "/juno_sc_prl_130607_130705_jc025a00_v01.bc", - kernels .. "/juno_sc_prl_130705_130802_jc026a01_v01.bc", - kernels .. "/juno_sc_prl_130726_131020_jx024a02_EFB_v03.bc", - kernels .. "/juno_sc_prl_130802_130830_jc027a02_v01.bc", - kernels .. "/juno_sc_prl_130830_130927_jc028a01_v01.bc", - kernels .. "/juno_sc_prl_130926_131025_jc029a00_v01.bc", - kernels .. "/juno_sc_prl_130927_131025_jc029c01_v01.bc", - kernels .. "/juno_sc_prl_131022_131025_jc029f00_v01.bc", - kernels .. "/juno_sc_prl_131025_131122_jc030b04_v01.bc", - kernels .. "/juno_sc_prl_131122_131220_jc031b01_v01.bc", - kernels .. "/juno_sc_prl_131220_140124_jc032a01_v01.bc", - kernels .. "/juno_sc_prl_140124_140214_jc033a01_v01.bc", - kernels .. "/juno_sc_prl_140214_140314_jc034b01_v01.bc", - kernels .. "/juno_sc_prl_140314_140411_jc035a01_v01.bc", - kernels .. "/juno_sc_prl_140411_140509_jc036b01_v01.bc", - kernels .. "/juno_sc_prl_140509_140606_jc037b02_v01.bc", - kernels .. "/juno_sc_prl_140606_140704_jc038a01_v01.bc", - kernels .. "/juno_sc_prl_140704_140801_jc039b01_v01.bc", - kernels .. "/juno_sc_prl_140801_140829_jc040a01_v01.bc", - kernels .. "/juno_sc_prl_140829_140926_jc041a01_v01.bc", - kernels .. "/juno_sc_prl_140926_141024_jc042a01_v01.bc", - kernels .. "/juno_sc_prl_141024_141121_jc043a01_v01.bc", - kernels .. "/juno_sc_prl_141105_141121_jc043m01_v01.bc", - kernels .. "/juno_sc_prl_141107_141121_jc043s01_v01.bc", - kernels .. "/juno_sc_prl_141121_141219_jc044a01_v01.bc", - kernels .. "/juno_sc_prl_141219_150123_jc045a01_v01.bc", - kernels .. "/juno_sc_prl_150123_150213_jc046a01_v01.bc", - kernels .. "/juno_sc_prl_150213_150313_jc047a01_v01.bc", - kernels .. "/juno_sc_prl_150312_150409_jc048a01_v01.bc", - kernels .. "/juno_sc_prl_150410_150508_jc049a01_v01.bc", - kernels .. "/juno_sc_prl_150508_150605_jc050a01_v01.bc", - kernels .. "/juno_sc_prl_150605_150703_jc051a01_v01.bc", - kernels .. "/juno_sc_prl_150703_150731_jc052a01_v01.bc", - kernels .. "/juno_sc_prl_150731_150828_jc053a01_v01.bc", - kernels .. "/juno_sc_prl_150805_150828_jc053m00_v01.bc", - kernels .. "/juno_sc_prl_150807_150828_jc053s00_v01.bc", - kernels .. "/juno_sc_prl_150828_150924_jc054a00_v01.bc", - kernels .. "/juno_sc_prl_150924_151023_jc055a00_v01.bc", - kernels .. "/juno_sc_prl_151023_151120_jc056a00_v01.bc", - kernels .. "/juno_sc_prl_151120_151218_jc057a00_v01.bc", - kernels .. "/juno_sc_prl_151218_160115_jc058a00_v01.bc", - kernels .. "/juno_sc_prl_160115_160212_jc059a00_v01.bc", - kernels .. "/juno_sc_prl_160212_160311_jc060a00_v01.bc", - kernels .. "/juno_sc_prl_160311_160408_jc061a00_v01.bc", - kernels .. "/juno_sc_prl_160408_160506_jc062a00_v01.bc", - kernels .. "/juno_sc_prl_160506_160603_jc063a00_v01.bc", - kernels .. "/juno_sc_prl_160603_160630_jc064a00_v01.bc", - kernels .. "/juno_sc_prl_160708_160729_jm0001rp_v02.bc", - kernels .. "/juno_sc_prl_160729_160826_jm0002rp_v01.bc", - kernels .. "/juno_sc_prl_160827_160920_jm0003a00_v01.bc", - kernels .. "/juno_sc_prl_160924_161019_jm0004a00_v01.bc", - kernels .. "/juno_sc_prl_161014_161115_jm0005a00_v01.bc", - kernels .. "/juno_sc_prl_161022_161115_jm0005b00_v01.bc", - kernels .. "/juno_sc_prl_161115_161213_jx0405rp_v01.bc", - kernels .. "/juno_sc_prl_161210_170115_jm0031a00_v01.bc", - kernels .. "/juno_sc_prl_170115_170201_jm0032a00_v01.bc", - kernels .. "/juno_sc_prl_170201_170309_jm0041a00_v01.bc", - kernels .. "/juno_sc_prl_170309_170326_jm0042rp_v01.bc", - kernels .. "/juno_sc_prl_170326_170427_jm0051rp_v01.bc", - kernels .. "/juno_sc_prl_170427_170518_jm0052rp_v01.bc", - kernels .. "/juno_sc_prl_170518_170615_jm0061a00_v01.bc", - kernels .. "/juno_sc_prl_170615_170710_jm0062a00_v01.bc", - kernels .. "/juno_sc_prl_170710_170805_jm0071a00_v01.bc", - kernels .. "/juno_sc_prl_170805_170831_jm0072a00_v01.bc", - kernels .. "/juno_sc_prl_170831_170927_jm0081a00_v01.bc", - kernels .. "/juno_sc_prl_170927_171023_jm0082a00_v01.bc", - kernels .. "/juno_sc_prl_171023_171030_jm0091a00_v01.bc", - kernels .. "/juno_sc_prl_171023_171030_jm0091a00_v01.bc" + kernels .. "juno_v12.tf", + kernels .. "JNO_SCLKSCET.00039.tsc", + kernels .. "juno_jade_v00.ti", + kernels .. "juno_jedi_v00.ti", + kernels .. "juno_jiram_v01.ti", + kernels .. "juno_junocam_v00.ti", + kernels .. "juno_mag_v00.ti", + kernels .. "juno_mwr_v01.ti", + kernels .. "juno_struct_v01.ti", + kernels .. "juno_uvs_v00.ti", + 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", + kernels .. "juno_sc_prl_111223_120127_jc006a02_v01.bc", + kernels .. "juno_sc_prl_120127_120217_jc007a00_v01.bc", + kernels .. "juno_sc_prl_120217_120316_jc008b00_v02.bc", + kernels .. "juno_sc_prl_120316_120413_jc009a00_v01.bc", + kernels .. "juno_sc_prl_120413_120511_jc010a04_v01.bc", + kernels .. "juno_sc_prl_120511_120608_jc011a01_v02.bc", + kernels .. "juno_sc_prl_120608_120706_jc012b01_v01.bc", + kernels .. "juno_sc_prl_120706_120802_jc013a01_v01.bc", + kernels .. "juno_sc_prl_120802_120824_jc014b01_v01.bc", + kernels .. "juno_sc_prl_120824_120928_jc015m00_v01.bc", + kernels .. "juno_sc_prl_120919_120928_jc015o00_v01.bc", + kernels .. "juno_sc_prl_120928_121026_jc016c03_v01.bc", + kernels .. "juno_sc_prl_121026_121123_jc017a01_v01.bc", + kernels .. "juno_sc_prl_121123_121221_jc018b01_v01.bc", + kernels .. "juno_sc_prl_121221_130118_jc019a01_v01.bc", + kernels .. "juno_sc_prl_130118_130215_jc020b01_v01.bc", + kernels .. "juno_sc_prl_130315_130412_jc022b01_v01.bc", + kernels .. "juno_sc_prl_130412_130510_jc023b03_v01.bc", + kernels .. "juno_sc_prl_130510_130607_jc024a01_v01.bc", + kernels .. "juno_sc_prl_130607_130705_jc025a00_v01.bc", + kernels .. "juno_sc_prl_130705_130802_jc026a01_v01.bc", + kernels .. "juno_sc_prl_130726_131020_jx024a02_EFB_v03.bc", + kernels .. "juno_sc_prl_130802_130830_jc027a02_v01.bc", + kernels .. "juno_sc_prl_130830_130927_jc028a01_v01.bc", + kernels .. "juno_sc_prl_130926_131025_jc029a00_v01.bc", + kernels .. "juno_sc_prl_130927_131025_jc029c01_v01.bc", + kernels .. "juno_sc_prl_131022_131025_jc029f00_v01.bc", + kernels .. "juno_sc_prl_131025_131122_jc030b04_v01.bc", + kernels .. "juno_sc_prl_131122_131220_jc031b01_v01.bc", + kernels .. "juno_sc_prl_131220_140124_jc032a01_v01.bc", + kernels .. "juno_sc_prl_140124_140214_jc033a01_v01.bc", + kernels .. "juno_sc_prl_140214_140314_jc034b01_v01.bc", + kernels .. "juno_sc_prl_140314_140411_jc035a01_v01.bc", + kernels .. "juno_sc_prl_140411_140509_jc036b01_v01.bc", + kernels .. "juno_sc_prl_140509_140606_jc037b02_v01.bc", + kernels .. "juno_sc_prl_140606_140704_jc038a01_v01.bc", + kernels .. "juno_sc_prl_140704_140801_jc039b01_v01.bc", + kernels .. "juno_sc_prl_140801_140829_jc040a01_v01.bc", + kernels .. "juno_sc_prl_140829_140926_jc041a01_v01.bc", + kernels .. "juno_sc_prl_140926_141024_jc042a01_v01.bc", + kernels .. "juno_sc_prl_141024_141121_jc043a01_v01.bc", + kernels .. "juno_sc_prl_141105_141121_jc043m01_v01.bc", + kernels .. "juno_sc_prl_141107_141121_jc043s01_v01.bc", + kernels .. "juno_sc_prl_141121_141219_jc044a01_v01.bc", + kernels .. "juno_sc_prl_141219_150123_jc045a01_v01.bc", + kernels .. "juno_sc_prl_150123_150213_jc046a01_v01.bc", + kernels .. "juno_sc_prl_150213_150313_jc047a01_v01.bc", + kernels .. "juno_sc_prl_150312_150409_jc048a01_v01.bc", + kernels .. "juno_sc_prl_150410_150508_jc049a01_v01.bc", + kernels .. "juno_sc_prl_150508_150605_jc050a01_v01.bc", + kernels .. "juno_sc_prl_150605_150703_jc051a01_v01.bc", + kernels .. "juno_sc_prl_150703_150731_jc052a01_v01.bc", + kernels .. "juno_sc_prl_150731_150828_jc053a01_v01.bc", + kernels .. "juno_sc_prl_150805_150828_jc053m00_v01.bc", + kernels .. "juno_sc_prl_150807_150828_jc053s00_v01.bc", + kernels .. "juno_sc_prl_150828_150924_jc054a00_v01.bc", + kernels .. "juno_sc_prl_150924_151023_jc055a00_v01.bc", + kernels .. "juno_sc_prl_151023_151120_jc056a00_v01.bc", + kernels .. "juno_sc_prl_151120_151218_jc057a00_v01.bc", + kernels .. "juno_sc_prl_151218_160115_jc058a00_v01.bc", + kernels .. "juno_sc_prl_160115_160212_jc059a00_v01.bc", + kernels .. "juno_sc_prl_160212_160311_jc060a00_v01.bc", + kernels .. "juno_sc_prl_160311_160408_jc061a00_v01.bc", + kernels .. "juno_sc_prl_160408_160506_jc062a00_v01.bc", + kernels .. "juno_sc_prl_160506_160603_jc063a00_v01.bc", + kernels .. "juno_sc_prl_160603_160630_jc064a00_v01.bc", + kernels .. "juno_sc_prl_160708_160729_jm0001rp_v02.bc", + kernels .. "juno_sc_prl_160729_160826_jm0002rp_v01.bc", + kernels .. "juno_sc_prl_160827_160920_jm0003a00_v01.bc", + kernels .. "juno_sc_prl_160924_161019_jm0004a00_v01.bc", + kernels .. "juno_sc_prl_161014_161115_jm0005a00_v01.bc", + kernels .. "juno_sc_prl_161022_161115_jm0005b00_v01.bc", + kernels .. "juno_sc_prl_161115_161213_jx0405rp_v01.bc", + kernels .. "juno_sc_prl_161210_170115_jm0031a00_v01.bc", + kernels .. "juno_sc_prl_170115_170201_jm0032a00_v01.bc", + kernels .. "juno_sc_prl_170201_170309_jm0041a00_v01.bc", + kernels .. "juno_sc_prl_170309_170326_jm0042rp_v01.bc", + kernels .. "juno_sc_prl_170326_170427_jm0051rp_v01.bc", + kernels .. "juno_sc_prl_170427_170518_jm0052rp_v01.bc", + kernels .. "juno_sc_prl_170518_170615_jm0061a00_v01.bc", + kernels .. "juno_sc_prl_170615_170710_jm0062a00_v01.bc", + kernels .. "juno_sc_prl_170710_170805_jm0071a00_v01.bc", + kernels .. "juno_sc_prl_170805_170831_jm0072a00_v01.bc", + kernels .. "juno_sc_prl_170831_170927_jm0081a00_v01.bc", + kernels .. "juno_sc_prl_170927_171023_jm0082a00_v01.bc", + kernels .. "juno_sc_prl_171023_171030_jm0091a00_v01.bc", + kernels .. "juno_sc_prl_171023_171030_jm0091a00_v01.bc" } local RotationMatrix = { @@ -150,7 +150,7 @@ local Juno = { }, Renderable = { Type = "RenderableModel", - GeometryFile = model .. "/Juno.obj", + GeometryFile = model .. "Juno.obj", ModelTransform = RotationMatrix, LightSources = assetHelper.getDefaultLightSources(sunTransforms.SolarSystemBarycenter.Identifier) }, diff --git a/data/assets/scene/solarsystem/missions/jwst/jwst.asset b/data/assets/scene/solarsystem/missions/jwst/jwst.asset index bbe6322584..3eec48f1c7 100644 --- a/data/assets/scene/solarsystem/missions/jwst/jwst.asset +++ b/data/assets/scene/solarsystem/missions/jwst/jwst.asset @@ -37,7 +37,7 @@ local JWSTBand = { Renderable = { Enabled = false, Type = "RenderableSphere", - Texture = band .. "/JWST-band.png", + Texture = band .. "JWST-band.png", Size = 9.2E15, Segments = 50, DisableFadeInOut = true, @@ -65,7 +65,7 @@ local JWSTModel = { }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/jwst_anim74_2fps_2018_nb.osmodel", + GeometryFile = models .. "jwst_anim74_2fps_2018_nb.osmodel", ModelScale = 0.0328, -- First scale down with centimeters then scale up with feet EnableAnimation = true, AnimationStartTime = "2018 10 01 14:06:03", diff --git a/data/assets/scene/solarsystem/missions/jwst/trail.asset b/data/assets/scene/solarsystem/missions/jwst/trail.asset index 9a34011434..ae404a0f1a 100644 --- a/data/assets/scene/solarsystem/missions/jwst/trail.asset +++ b/data/assets/scene/solarsystem/missions/jwst/trail.asset @@ -37,7 +37,7 @@ local JWSTTrailLaunch = { Type = "RenderableTrailTrajectory", Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = horizons .. "/horizons_jwst_launch.dat", + HorizonsTextFile = horizons .. "horizons_jwst_launch.dat", }, Color = { 0.9, 0.9, 0.0 }, StartTime = "2018 OCT 01 14:06:00", @@ -68,7 +68,7 @@ local JWSTTrailOrbit = { Type = "RenderableTrailOrbit", Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = horizons .. "/horizons_jwst_orbit.dat", + HorizonsTextFile = horizons .. "horizons_jwst_orbit.dat", }, Color = { 0.9, 0.9, 0.0 }, Period = 182.621099, -- About 6 months @@ -99,7 +99,7 @@ local JWSTSunTrail = { Type = "SpiceTranslation", Target = "JWST", Observer = "SSB", - Kernels = kernels .. "/jwst_horizons_20200101_20240101_v01.bsp" + Kernels = kernels .. "jwst_horizons_20200101_20240101_v01.bsp" }, Color = { 0.0, 0.9, 0.9 }, Period = 365.242, diff --git a/data/assets/scene/solarsystem/missions/jwst/transforms.asset b/data/assets/scene/solarsystem/missions/jwst/transforms.asset index 53b55f8132..86eb461cd7 100644 --- a/data/assets/scene/solarsystem/missions/jwst/transforms.asset +++ b/data/assets/scene/solarsystem/missions/jwst/transforms.asset @@ -20,11 +20,11 @@ local JWSTPosition = { Keyframes = { ['2018 OCT 01 14:06:03'] = { Type = "HorizonsTranslation", - HorizonsTextFile = horizons .. "/horizons_jwst_launch.dat", + HorizonsTextFile = horizons .. "horizons_jwst_launch.dat", }, ['2018 NOV 01 00:00:00'] = { Type = "HorizonsTranslation", - HorizonsTextFile = horizons .. "/horizons_jwst_orbit.dat", + HorizonsTextFile = horizons .. "horizons_jwst_orbit.dat", } } }, diff --git a/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset b/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset index 8bc88d57f2..1a5ec0123a 100644 --- a/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset +++ b/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset @@ -20,7 +20,7 @@ local Magnetosphere = { Renderable = { Type = "RenderableTimeVaryingVolume", SourceDirectory = localFolder, - TransferFunction = localFolder .. "/transferfunction.txt", + TransferFunction = localFolder .. "transferfunction.txt", Variable = "rho", StepSize = 0.003, Dimensions = {64, 64, 64}, diff --git a/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset b/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset index b5cadee6e1..42a34e51de 100644 --- a/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset +++ b/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset @@ -19,35 +19,35 @@ local kernels = asset.syncedResource({ local LocalKernels = { - kernels .. '/messenger_2548.tsc', - kernels .. '/msgr_v231.tf', + kernels .. 'messenger_2548.tsc', + kernels .. 'msgr_v231.tf', - kernels .. '/de405.bsp', - kernels .. '/msgr_040803_150430_150430_od431sc_2.bsp', - kernels .. '/msgr_antenna_v000.bsp', - kernels .. '/msgr_de405_de423s.bsp', + kernels .. 'de405.bsp', + kernels .. 'msgr_040803_150430_150430_od431sc_2.bsp', + kernels .. 'msgr_antenna_v000.bsp', + kernels .. 'msgr_de405_de423s.bsp', - kernels .. '/msgr_epps_v100.ti', - kernels .. '/msgr_grns_v110.ti', - kernels .. '/msgr_mag_v021.ti', - kernels .. '/msgr_mascs_v100.ti', - kernels .. '/msgr_mdis_v160.ti', - kernels .. '/msgr_mla_v010.ti', - kernels .. '/msgr_rs_v111.ti', - kernels .. '/msgr_xrs_v001.ti', + kernels .. 'msgr_epps_v100.ti', + kernels .. 'msgr_grns_v110.ti', + kernels .. 'msgr_mag_v021.ti', + kernels .. 'msgr_mascs_v100.ti', + kernels .. 'msgr_mdis_v160.ti', + kernels .. 'msgr_mla_v010.ti', + kernels .. 'msgr_rs_v111.ti', + kernels .. 'msgr_xrs_v001.ti', - 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 .. '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 .. '/msgr_1103_v02.bc', - kernels .. '/msgr_1104_v02.bc', - kernels .. '/msgr_1105_v02.bc', - kernels .. '/msgr_1106_v02.bc', + kernels .. 'msgr_1103_v02.bc', + kernels .. 'msgr_1104_v02.bc', + kernels .. 'msgr_1105_v02.bc', + kernels .. 'msgr_1106_v02.bc', } @@ -92,7 +92,7 @@ local MessengerProbeBlack = { Parent = Messenger.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/MessengerProbe_black.obj", + GeometryFile = models .. "MessengerProbe_black.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -107,7 +107,7 @@ local MessengerProbeFoil = { Parent = Messenger.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/MessengerProbe_foil.obj", + GeometryFile = models .. "MessengerProbe_foil.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -122,7 +122,7 @@ local MessengerProbeHeatShield = { Parent = Messenger.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/MessengerProbe_heatShield.obj", + GeometryFile = models .. "MessengerProbe_heatShield.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -137,7 +137,7 @@ local MessengerProbeMetal = { Parent = Messenger.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/MessengerProbe_metal.obj", + GeometryFile = models .. "MessengerProbe_metal.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -152,7 +152,7 @@ local MessengerProbePanels = { Parent = Messenger.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/MessengerProbe_panels.obj", + GeometryFile = models .. "MessengerProbe_panels.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, diff --git a/data/assets/scene/solarsystem/missions/newhorizons/charon.asset b/data/assets/scene/solarsystem/missions/newhorizons/charon.asset index 858edb1bc4..285cb9bded 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/charon.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/charon.asset @@ -36,12 +36,12 @@ local CharonProjection = { Segments = 350 }, ColorTexturePaths = { - textures .. "/NH_Charon_mosaic.png", - textures .. "/NH_Charon_mosaic_8192.png" + textures .. "NH_Charon_mosaic.png", + textures .. "NH_Charon_mosaic_8192.png" }, HeightTexturePaths = { - textures .. "/NH_Charon_DTM.png", - textures .. "/NH_Charon_DTM_8192.png" + textures .. "NH_Charon_DTM.png", + textures .. "NH_Charon_DTM_8192.png" }, MeridianShift = true, Projection = { @@ -78,7 +78,7 @@ local CharonText = { Transform = { Translation = { Type = "StaticTranslation", - Position = {0, -1000000.0, 0} + Position = { 0, -1000000.0, 0 } } }, Renderable = { @@ -86,7 +86,7 @@ local CharonText = { Size = 10^6.3, Origin = "Center", Billboard = true, - Texture = textures .. "/Charon-Text.png", + Texture = textures .. "Charon-Text.png", BlendMode = "Additive" }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/newhorizons/kernels.asset b/data/assets/scene/solarsystem/missions/newhorizons/kernels.asset index 081af3b699..3400b3299d 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/kernels.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/kernels.asset @@ -6,39 +6,39 @@ local Kernels = asset.syncedResource({ }) local NewHorizonsKernels = { - Kernels .. "/nh_pred_20141201_20190301_od122.bsp", - Kernels .. "/NavSE_plu047_od122.bsp", - Kernels .. "/NavPE_de433_od122.bsp", + Kernels .. "nh_pred_20141201_20190301_od122.bsp", + Kernels .. "NavSE_plu047_od122.bsp", + Kernels .. "NavPE_de433_od122.bsp", - Kernels .. "/new-horizons_1121.tsc", + Kernels .. "new-horizons_1121.tsc", - Kernels .. "/nh_scispi_2015_pred.bc", - Kernels .. "/nh_scispi_2015_recon.bc", - Kernels .. "/nh_lorri_wcs.bc", + Kernels .. "nh_scispi_2015_pred.bc", + Kernels .. "nh_scispi_2015_recon.bc", + Kernels .. "nh_lorri_wcs.bc", - Kernels .. "/PLU_LORRI_ALL_161216.bc", + Kernels .. "PLU_LORRI_ALL_161216.bc", - Kernels .. "/nh_targets_v001.tpc", - Kernels .. "/nh_pcnh_005.tpc", + Kernels .. "nh_targets_v001.tpc", + Kernels .. "nh_pcnh_005.tpc", - Kernels .. "/nh_v220.tf", - Kernels .. "/nh_allinstruments_v002.ti", - Kernels .. "/nh_alice_v200.ti", - Kernels .. "/nh_lorri_v201.ti", - Kernels .. "/nh_pepssi_v110.ti", - Kernels .. "/nh_ralph_v100.ti", - Kernels .. "/nh_rex_v100.ti", - Kernels .. "/nh_sdc_v101.ti", - Kernels .. "/nh_swap_v100.ti", - Kernels .. "/nh_astr_v000.ti", - Kernels .. "/nh_fss_v000.ti", - Kernels .. "/nh_soc_misc_v001.tf", - Kernels .. "/nh_stars.bsp", + Kernels .. "nh_v220.tf", + Kernels .. "nh_allinstruments_v002.ti", + Kernels .. "nh_alice_v200.ti", + Kernels .. "nh_lorri_v201.ti", + Kernels .. "nh_pepssi_v110.ti", + Kernels .. "nh_ralph_v100.ti", + Kernels .. "nh_rex_v100.ti", + Kernels .. "nh_sdc_v101.ti", + Kernels .. "nh_swap_v100.ti", + Kernels .. "nh_astr_v000.ti", + Kernels .. "nh_fss_v000.ti", + Kernels .. "nh_soc_misc_v001.tf", + Kernels .. "nh_stars.bsp", } local PlutoKernels = { - Kernels .. "/NavPE_de433_od122.bsp", - Kernels .. "/NavSE_plu047_od122.bsp" + Kernels .. "NavPE_de433_od122.bsp", + Kernels .. "NavSE_plu047_od122.bsp" } asset.export("Kernels", Kernels) diff --git a/data/assets/scene/solarsystem/missions/newhorizons/model.asset b/data/assets/scene/solarsystem/missions/newhorizons/model.asset index 255319f9f0..5ac619eaff 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/model.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/model.asset @@ -15,7 +15,7 @@ local NewHorizons = { Renderable = { Type = "RenderableModel", Body = "NEW HORIZONS", - GeometryFile = models .. "/NewHorizonsCleanModel.obj", + GeometryFile = models .. "NewHorizonsCleanModel.obj", AmbientIntensity = 0.2, DiffuseIntensity = 1.0, SpecularIntensity = 1.0, diff --git a/data/assets/scene/solarsystem/missions/newhorizons/othermoons.asset b/data/assets/scene/solarsystem/missions/newhorizons/othermoons.asset index 8448163a5e..0f8251822b 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/othermoons.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/othermoons.asset @@ -25,7 +25,7 @@ local HydraText = { Size = 10.0^6.3, Origin = "Center", Billboard = true, - Texture = hydraTextures .. "/Hydra-Text.png", + Texture = hydraTextures .. "Hydra-Text.png", BlendMode = "Additive" }, GUI = { @@ -55,7 +55,7 @@ local KerberosText = { Size = 10^6.3, Origin = "Center", Billboard = true, - Texture = kerberosTextures .. "/Kerberos-Text.png", + Texture = kerberosTextures .. "Kerberos-Text.png", BlendMode = "Additive" }, GUI = { @@ -79,7 +79,7 @@ local NixText = { Size = 10^6.3, Origin = "Center", Billboard = true, - Texture = nixTextures .. "/Nix-Text.png", + Texture = nixTextures .. "Nix-Text.png", BlendMode = "Additive" }, GUI = { @@ -109,7 +109,7 @@ local StyxText = { Size = 10^6.3, Origin = "Center", Billboard = true, - Texture = styxTextures .. "/Styx-Text.png", + Texture = styxTextures .. "Styx-Text.png", BlendMode = "Additive" }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset index 45f4b97830..262830e729 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset @@ -58,20 +58,20 @@ local PlutoProjection = { Segments = 400 }, ColorTexturePaths = { - textures .. "/pluto.png", - textures .. "/NH_Pluto_mosaic_16384.png", - textures .. "/NH_Pluto_mosaic_8192.png", - textures .. "/pmap_cyl_k201.jpg", - textures .. "/pmap_cyl_k201_4096.jpg" + textures .. "pluto.png", + textures .. "NH_Pluto_mosaic_16384.png", + textures .. "NH_Pluto_mosaic_8192.png", + textures .. "pmap_cyl_k201.jpg", + textures .. "pmap_cyl_k201_4096.jpg" }, HeightTexturePaths = { - textures .. "/NH_Pluto_DTM_16384.png", - textures .. "/NH_Pluto_DTM_8192.png" + textures .. "NH_Pluto_DTM_16384.png", + textures .. "NH_Pluto_DTM_8192.png" }, MeridianShift = false, Projection = { Sequence = images, - EventFile = assets .. "/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt", + EventFile = assets .. "core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt", -- SequenceType = "hybrid", SequenceType = "image-sequence", Observer = "NEW HORIZONS", @@ -192,7 +192,7 @@ local PlutoBarycenterLabel = { Type = "RenderablePlaneImageLocal", Billboard = true, Size = 5E4, - Texture = encounterTextures .. "/barycenter.png", + Texture = encounterTextures .. "barycenter.png", BlendMode = "Additive" }, GUI = { @@ -215,7 +215,7 @@ local PlutoText = { Size = 10^6.3, Origin = "Center", Billboard = true, - Texture = encounterTextures .. "/Pluto-Text.png", + Texture = encounterTextures .. "Pluto-Text.png", BlendMode = "Additive" }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset b/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset index c6f7811eec..9d1c359f70 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset @@ -34,7 +34,7 @@ local Bennu = { Enabled = false, Type = "RenderableModel", Body = BENNU_BODY, - GeometryFile = models .. "/Bennu_v20_200k_an.obj", + GeometryFile = models .. "Bennu_v20_200k_an.obj", LightSources = LightSources, SpecularIntensity = 0.0 }, diff --git a/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset b/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset index 9a81496a37..90bb81eb24 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset @@ -39,7 +39,7 @@ local BennuProjection = { Enabled = true, Type = "RenderableModelProjection", Body = BENNU_BODY, - GeometryFile = models .. "/Bennu_v20_200k_an.obj", + GeometryFile = models .. "Bennu_v20_200k_an.obj", Projection = { Sequence = { images, imagesA }, SequenceType = "image-sequence", diff --git a/data/assets/scene/solarsystem/missions/osirisrex/imageplane.asset b/data/assets/scene/solarsystem/missions/osirisrex/imageplane.asset index bb4f1ffca2..93a4a681d1 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/imageplane.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/imageplane.asset @@ -31,7 +31,7 @@ local ImagePlane = { Spacecraft = "OSIRIS-REX", Instrument = "ORX_OCAMS_POLYCAM", Moving = false, - Texture = textures .. "/defaultProj.png" + Texture = textures .. "defaultProj.png" }, GUI = { Name = "OsirisREx Image Plane", diff --git a/data/assets/scene/solarsystem/missions/osirisrex/kernels.asset b/data/assets/scene/solarsystem/missions/osirisrex/kernels.asset index 85e56d5fa1..d11e8e2f0c 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/kernels.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/kernels.asset @@ -6,86 +6,86 @@ local kernels = asset.syncedResource({ }) local OsirisRexKernels = { - kernels .. "/orx_v14.tf", - kernels .. "/orx_ocams_v07.ti", - kernels .. "/orx_rexis_v01.ti", - kernels .. "/ORX_SCLKSCET.00061.tsc", - kernels .. "/bennu_v17.tpc", - kernels .. "/orx_struct_v04.bsp", - kernels .. "/orx_sa_red_200106_v02.bc", - kernels .. "/orx_sa_red_200107_v02.bc", - kernels .. "/orx_sa_red_200108_v02.bc", - kernels .. "/orx_sa_red_200109_v02.bc", - kernels .. "/orx_sa_red_200110_v02.bc", - kernels .. "/orx_sa_rel_200106_200112_v01.bc", - kernels .. "/orx_sc_rel_160909_160911_v01.bc", - kernels .. "/orx_sc_rel_160912_160918_v01.bc", - kernels .. "/orx_sc_rel_160919_160925_v01.bc", - kernels .. "/orx_sc_rel_160926_161002_v01.bc", - kernels .. "/orx_sc_rel_181029_181104_v02.bc", - kernels .. "/orx_sc_rel_190218_190224_v02.bc", - kernels .. "/orx_sc_rel_200106_200112_v01.bc", - kernels .. "/orx_sc_rel_201019_201025_v01.bc", - kernels .. "/orx_sc_rel_201012_201018_v01.bc", - kernels .. "/orx_sc_red_200106_v02.bc", - kernels .. "/orx_sc_red_200107_v02.bc", - kernels .. "/orx_sc_red_200108_v02.bc", - kernels .. "/orx_sc_red_200109_v02.bc", - kernels .. "/orx_sc_red_201020_v02.bc", - kernels .. "/orx_sc_red_201017_v03.bc", - kernels .. "/orx_sc_red_201018_v02.bc", - kernels .. "/orx_sc_red_201019_v02.bc", - kernels .. "/orx_r_160909_160910_v01.bc", - kernels .. "/orx_r_160910_160913_v01.bc", - kernels .. "/orx_r_160913_160915_v01.bc", - kernels .. "/orx_r_160915_160919_v01.bc", - kernels .. "/orx_r_160918_160922_v01.bc", - kernels .. "/orx_r_160919_160922_v01.bc", - kernels .. "/orx_r_200105_200107_v02.bc", - kernels .. "/orx_r_200106_200108_v02.bc", - kernels .. "/orx_r_200107_200109_v02.bc", - kernels .. "/orx_r_200107_200112_v01.bc", - kernels .. "/orx_r_200108_200110_v02.bc", - kernels .. "/orx_r_200109_200111_v02.bc", - kernels .. "/orx_r_201019_201021_v06.bc", - kernels .. "/orx_r_201018_201021_v02.bc", - kernels .. "/orx_r_201018_201020_v03.bc", - kernels .. "/orx_r_201017_201019_v03.bc", - kernels .. "/orx_p_160910_161005_xc001b_v01.bc", - kernels .. "/orx_p_200106_200113_2002_od205_v01.bc", - kernels .. "/orx_p_200106_200113_2002_od209_v01.bc", - kernels .. "/orx_p_200106_200113_2002_od210_v01.bc", - kernels .. "/orx_p_201019_201026_2043tag_od293_v03.bc", - kernels .. "/orx_p_201012_201019_2042_od291_v04.bc", - kernels .. "/orx_p_210411_210510_xq006_od297_v05.bc", - kernels .. "/orx_p_210509_210513_xr001_adm_final_mod_od311_v01.bc", - kernels .. "/orx_p_210509_210607_xr001_od298_v00.bc", - kernels .. "/orx_p_230824_231008_src_release_od298_v00.bc", - kernels .. "/OREX_20160904_M45_complete.bsp", - kernels .. "/OREX_20160908_M60_complete.bsp", - kernels .. "/orx_struct_polycam_v01.bc", - kernels .. "/de424.bsp", - kernels .. "/bennu_refdrmc_v1.bsp", - kernels .. "/orx_160908_231024_pgaa2_day06m60.bsp", - kernels .. "/orx_160908_231024_pgaa3_day06m60_v1.bsp", - kernels .. "/orx_160909_161228_160919_od005_tcm1_v2.bsp", - kernels .. "/orx_160909_161228_160930_od006_tcm1_v1.bsp", - kernels .. "/orx_160909_170101_160912_od004_v1.bsp", - kernels .. "/orx_160909_170101_161010_od008_v1.bsp", - kernels .. "/spk_orx_160908_231024_pgaa2_day06m60_v3.bsp", - kernels .. "/orx_160909_231024_refod009_v2.bsp", - kernels .. "/orx_171006_231024_171005_refod027_v1.bsp", - kernels .. "/orx_180301_200101_180711_od037-R-AM1-P-M17B_v2.bsp", - kernels .. "/orx_180801_181219_181128_od066-N-M0P-L-VC1_v1.bsp", - kernels .. "/orx_191101_200407_191202_od204-R-R1P1-P-R3R_v1.bsp", - kernels .. "/orx_201020_210524_210103_od297-N-PTO1-F_v1.bsp", - kernels .. "/orx_201020_210601_201109_od295-R_v1.bsp", - kernels .. "/orx_201020_201110_201021_od293-N_v1.bsp", - kernels .. "/orx_201005_201201_200615_od258-R-T1P1-P-T1R1_v1.bsp", - kernels .. "/orx_201005_201201_200615_od258-C-T1P1-P-T1R5_v2.bsp", - kernels .. "/orx_210115_210701_210426_od310-N-ADM-P_v1.bsp", - kernels .. "/orx_210408_210701_210503_od311-N-ADM-F_v1.bsp", - kernels .. "/orx_210509_231025_210119_od298-R-ADM1-P-DB1_v1.bsp" + kernels .. "orx_v14.tf", + kernels .. "orx_ocams_v07.ti", + kernels .. "orx_rexis_v01.ti", + kernels .. "ORX_SCLKSCET.00061.tsc", + kernels .. "bennu_v17.tpc", + kernels .. "orx_struct_v04.bsp", + kernels .. "orx_sa_red_200106_v02.bc", + kernels .. "orx_sa_red_200107_v02.bc", + kernels .. "orx_sa_red_200108_v02.bc", + kernels .. "orx_sa_red_200109_v02.bc", + kernels .. "orx_sa_red_200110_v02.bc", + kernels .. "orx_sa_rel_200106_200112_v01.bc", + kernels .. "orx_sc_rel_160909_160911_v01.bc", + kernels .. "orx_sc_rel_160912_160918_v01.bc", + kernels .. "orx_sc_rel_160919_160925_v01.bc", + kernels .. "orx_sc_rel_160926_161002_v01.bc", + kernels .. "orx_sc_rel_181029_181104_v02.bc", + kernels .. "orx_sc_rel_190218_190224_v02.bc", + kernels .. "orx_sc_rel_200106_200112_v01.bc", + kernels .. "orx_sc_rel_201019_201025_v01.bc", + kernels .. "orx_sc_rel_201012_201018_v01.bc", + kernels .. "orx_sc_red_200106_v02.bc", + kernels .. "orx_sc_red_200107_v02.bc", + kernels .. "orx_sc_red_200108_v02.bc", + kernels .. "orx_sc_red_200109_v02.bc", + kernels .. "orx_sc_red_201020_v02.bc", + kernels .. "orx_sc_red_201017_v03.bc", + kernels .. "orx_sc_red_201018_v02.bc", + kernels .. "orx_sc_red_201019_v02.bc", + kernels .. "orx_r_160909_160910_v01.bc", + kernels .. "orx_r_160910_160913_v01.bc", + kernels .. "orx_r_160913_160915_v01.bc", + kernels .. "orx_r_160915_160919_v01.bc", + kernels .. "orx_r_160918_160922_v01.bc", + kernels .. "orx_r_160919_160922_v01.bc", + kernels .. "orx_r_200105_200107_v02.bc", + kernels .. "orx_r_200106_200108_v02.bc", + kernels .. "orx_r_200107_200109_v02.bc", + kernels .. "orx_r_200107_200112_v01.bc", + kernels .. "orx_r_200108_200110_v02.bc", + kernels .. "orx_r_200109_200111_v02.bc", + kernels .. "orx_r_201019_201021_v06.bc", + kernels .. "orx_r_201018_201021_v02.bc", + kernels .. "orx_r_201018_201020_v03.bc", + kernels .. "orx_r_201017_201019_v03.bc", + kernels .. "orx_p_160910_161005_xc001b_v01.bc", + kernels .. "orx_p_200106_200113_2002_od205_v01.bc", + kernels .. "orx_p_200106_200113_2002_od209_v01.bc", + kernels .. "orx_p_200106_200113_2002_od210_v01.bc", + kernels .. "orx_p_201019_201026_2043tag_od293_v03.bc", + kernels .. "orx_p_201012_201019_2042_od291_v04.bc", + kernels .. "orx_p_210411_210510_xq006_od297_v05.bc", + kernels .. "orx_p_210509_210513_xr001_adm_final_mod_od311_v01.bc", + kernels .. "orx_p_210509_210607_xr001_od298_v00.bc", + kernels .. "orx_p_230824_231008_src_release_od298_v00.bc", + kernels .. "OREX_20160904_M45_complete.bsp", + kernels .. "OREX_20160908_M60_complete.bsp", + kernels .. "orx_struct_polycam_v01.bc", + kernels .. "de424.bsp", + kernels .. "bennu_refdrmc_v1.bsp", + kernels .. "orx_160908_231024_pgaa2_day06m60.bsp", + kernels .. "orx_160908_231024_pgaa3_day06m60_v1.bsp", + kernels .. "orx_160909_161228_160919_od005_tcm1_v2.bsp", + kernels .. "orx_160909_161228_160930_od006_tcm1_v1.bsp", + kernels .. "orx_160909_170101_160912_od004_v1.bsp", + kernels .. "orx_160909_170101_161010_od008_v1.bsp", + kernels .. "spk_orx_160908_231024_pgaa2_day06m60_v3.bsp", + kernels .. "orx_160909_231024_refod009_v2.bsp", + kernels .. "orx_171006_231024_171005_refod027_v1.bsp", + kernels .. "orx_180301_200101_180711_od037-R-AM1-P-M17B_v2.bsp", + kernels .. "orx_180801_181219_181128_od066-N-M0P-L-VC1_v1.bsp", + kernels .. "orx_191101_200407_191202_od204-R-R1P1-P-R3R_v1.bsp", + kernels .. "orx_201020_210524_210103_od297-N-PTO1-F_v1.bsp", + kernels .. "orx_201020_210601_201109_od295-R_v1.bsp", + kernels .. "orx_201020_201110_201021_od293-N_v1.bsp", + kernels .. "orx_201005_201201_200615_od258-R-T1P1-P-T1R1_v1.bsp", + kernels .. "orx_201005_201201_200615_od258-C-T1P1-P-T1R5_v2.bsp", + kernels .. "orx_210115_210701_210426_od310-N-ADM-P_v1.bsp", + kernels .. "orx_210408_210701_210503_od311-N-ADM-F_v1.bsp", + kernels .. "orx_210509_231025_210119_od298-R-ADM1-P-DB1_v1.bsp" } asset.export('kernels', OsirisRexKernels) diff --git a/data/assets/scene/solarsystem/missions/osirisrex/model.asset b/data/assets/scene/solarsystem/missions/osirisrex/model.asset index 33a2a694c6..d2ff92c41f 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/model.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/model.asset @@ -48,7 +48,7 @@ local OsirisRex = { Renderable = { Type = "RenderableModel", Body = "OSIRIS-REX", - GeometryFile = models .. "/orx_base_resized_12_sep_2016.obj", + GeometryFile = models .. "orx_base_resized_12_sep_2016.obj", LightSources = LightSources }, GUI = { @@ -74,7 +74,7 @@ local PolyCam = { Renderable = { Type = "RenderableModel", Body = "OSIRIS-REX", - GeometryFile = models .. "/orx_polycam_resized_12_sep_2016.obj", + GeometryFile = models .. "orx_polycam_resized_12_sep_2016.obj", LightSources = LightSources }, GUI = { @@ -89,7 +89,7 @@ local Rexis = { Renderable = { Type = "RenderableModel", Body = "OSIRIS-REX", - GeometryFile = models .. "/orx_rexis_resized_12_sep_2016.obj", + GeometryFile = models .. "orx_rexis_resized_12_sep_2016.obj", LightSources = LightSources }, Transform = { diff --git a/data/assets/scene/solarsystem/missions/perseverance/model.asset b/data/assets/scene/solarsystem/missions/perseverance/model.asset index cbe8099d9f..4a77fa808b 100644 --- a/data/assets/scene/solarsystem/missions/perseverance/model.asset +++ b/data/assets/scene/solarsystem/missions/perseverance/model.asset @@ -54,7 +54,7 @@ local Body = { Renderable = { Type = "RenderableModel", Body = "MARS SCIENCE LABORATORY", - GeometryFile = models .. "/Perseverance.obj", + GeometryFile = models .. "Perseverance.obj", LightSources = LightSources, PerformShading = false, RotationVector = {65.940000,201.389999,263.980011} diff --git a/data/assets/scene/solarsystem/missions/perseverance/trail.asset b/data/assets/scene/solarsystem/missions/perseverance/trail.asset index cd7fffdb30..d11d3fd2cc 100644 --- a/data/assets/scene/solarsystem/missions/perseverance/trail.asset +++ b/data/assets/scene/solarsystem/missions/perseverance/trail.asset @@ -13,15 +13,15 @@ local kernels = asset.syncedResource({ local perseverance_id = "-168" local m2020_kernels = { - kernels .. "/m2020.tf", + kernels .. "m2020.tf", - kernels .. "/m2020.tls", - kernels .. "/naif0012.tls", + kernels .. "m2020.tls", + kernels .. "naif0012.tls", - kernels .. "/m2020.tsc", + kernels .. "m2020.tsc", - kernels .. "/m2020_FMAresponse_JEZ_20200717_P000.cruise.bsp", - kernels .. "/m2020_FMAresponse_JEZ_20200717_P000.edl.bsp" + kernels .. "m2020_FMAresponse_JEZ_20200717_P000.cruise.bsp", + kernels .. "m2020_FMAresponse_JEZ_20200717_P000.edl.bsp" } local startTime = "2020 JUL 17 13:56:42" diff --git a/data/assets/scene/solarsystem/missions/pioneer/pioneer10.asset b/data/assets/scene/solarsystem/missions/pioneer/pioneer10.asset index bf147bbf71..f94bd066c4 100644 --- a/data/assets/scene/solarsystem/missions/pioneer/pioneer10.asset +++ b/data/assets/scene/solarsystem/missions/pioneer/pioneer10.asset @@ -10,7 +10,7 @@ local kernelsFolder = asset.syncedResource({ Version = 1 }) -local kernelsList = {kernelsFolder .. '/p10-a.bsp'} +local kernelsList = {kernelsFolder .. 'p10-a.bsp'} local Pioneer10NAIF = "-23" diff --git a/data/assets/scene/solarsystem/missions/pioneer/pioneer11.asset b/data/assets/scene/solarsystem/missions/pioneer/pioneer11.asset index dad188e997..05d1db1743 100644 --- a/data/assets/scene/solarsystem/missions/pioneer/pioneer11.asset +++ b/data/assets/scene/solarsystem/missions/pioneer/pioneer11.asset @@ -11,8 +11,8 @@ local kernelsFolder = asset.syncedResource({ }) local kernelsList = { - kernelsFolder .. '/p11-a.bsp', - kernelsFolder .. '/p11_sat336.bsp' + kernelsFolder .. 'p11-a.bsp', + kernelsFolder .. 'p11_sat336.bsp' } local Pioneer11NAIF = "-24" diff --git a/data/assets/scene/solarsystem/missions/pioneer/pioneermodel.asset b/data/assets/scene/solarsystem/missions/pioneer/pioneermodel.asset index f414337170..29115ec61b 100644 --- a/data/assets/scene/solarsystem/missions/pioneer/pioneermodel.asset +++ b/data/assets/scene/solarsystem/missions/pioneer/pioneermodel.asset @@ -10,7 +10,7 @@ local modelFolder = asset.syncedResource({ local ModelRenderable = { Type = "RenderableModel", - GeometryFile = modelFolder .. "/pioneer.fbx", + GeometryFile = modelFolder .. "pioneer.fbx", LightSources = assetHelper.getDefaultLightSources( sunTransforms.SolarSystemBarycenter.Identifier ) diff --git a/data/assets/scene/solarsystem/missions/rosetta/67p.asset b/data/assets/scene/solarsystem/missions/rosetta/67p.asset index 76d84cb4fa..b0bb61d15b 100644 --- a/data/assets/scene/solarsystem/missions/rosetta/67p.asset +++ b/data/assets/scene/solarsystem/missions/rosetta/67p.asset @@ -24,7 +24,7 @@ local images = asset.syncedResource({ Version = 2 }) -local imagesDestination = images .. "/images" +local imagesDestination = images .. "images" local Barycenter = { Identifier = "67PBarycenter", @@ -54,7 +54,7 @@ local Comet67P = { }, Renderable = { Type = "RenderableModelProjection", - GeometryFile = models .. "/67P_rotated_5_130.obj", + GeometryFile = models .. "67P_rotated_5_130.obj", Projection = { Sequence = { imagesDestination }, SequenceType = "image-sequence", @@ -134,7 +134,7 @@ local Trail67P = { asset.onInitialize(function() if not openspace.directoryExists(imagesDestination) then openspace.printInfo("Extracting Rosetta images") - openspace.unzipFile(images .. "/images_v1_v2.zip", imagesDestination, true) + openspace.unzipFile(images .. "images_v1_v2.zip", imagesDestination, true) end end) diff --git a/data/assets/scene/solarsystem/missions/rosetta/rosetta.asset b/data/assets/scene/solarsystem/missions/rosetta/rosetta.asset index b33c412cde..1e777d44c1 100644 --- a/data/assets/scene/solarsystem/missions/rosetta/rosetta.asset +++ b/data/assets/scene/solarsystem/missions/rosetta/rosetta.asset @@ -18,53 +18,52 @@ local kernels = asset.syncedResource({ }) local RosettaKernels = { - kernels .. "/ROS_160718_STEP.TSC", - kernels .. "/ros_triv.tsc", + kernels .. "ROS_160718_STEP.TSC", + kernels .. "ros_triv.tsc", - kernels .. "/CORB_DV_243_01___T19_00325.BSP", - kernels .. "/CORB_DV_223_01___T19_00302.BSP", - kernels .. "/CORB_DV_145_01___T19_00216.BSP", + kernels .. "CORB_DV_243_01___T19_00325.BSP", + kernels .. "CORB_DV_223_01___T19_00302.BSP", + kernels .. "CORB_DV_145_01___T19_00216.BSP", - kernels .. "/LORB_DV_236_01___T19_00318.BSP", - kernels .. "/LORB_DV_223_01___T19_00302.BSP", - kernels .. "/LORB_DV_145_01___T19_00216.BSP", + kernels .. "LORB_DV_236_01___T19_00318.BSP", + kernels .. "LORB_DV_223_01___T19_00302.BSP", + kernels .. "LORB_DV_145_01___T19_00216.BSP", - kernels .. "/RORB_DV_243_01___T19_00325.BSP", - kernels .. "/RORB_DV_223_01___T19_00302.BSP", - kernels .. "/RORB_DV_145_01___T19_00216.BSP", + kernels .. "RORB_DV_243_01___T19_00325.BSP", + kernels .. "RORB_DV_223_01___T19_00302.BSP", + kernels .. "RORB_DV_145_01___T19_00216.BSP", - kernels .. "/ATNR_P040302093352_00127.BC", + kernels .. "ATNR_P040302093352_00127.BC", - kernels .. "/ROS_STRUCT_V5.BSP", + kernels .. "ROS_STRUCT_V5.BSP", - kernels .. "/ROS_NAVCAM_V01.TI", + kernels .. "ROS_NAVCAM_V01.TI", - kernels .. "/ROS_CHURYUMOV_V01.TF", - kernels .. "/ROS_V26.TF", + kernels .. "ROS_CHURYUMOV_V01.TF", + kernels .. "ROS_V26.TF", -- CK -- Rosetta attitude - kernels .. "/RATT_DV_243_01_01____00325.BC", - kernels .. "/RATT_DV_223_01_01____00302.BC", - kernels .. "/RATT_DV_145_01_01____00216.BC", + kernels .. "RATT_DV_243_01_01____00325.BC", + kernels .. "RATT_DV_223_01_01____00302.BC", + kernels .. "RATT_DV_145_01_01____00216.BC", -- Comet attitude - kernels .. "/CATT_DV_243_01_______00325.BC", - kernels .. "/CATT_DV_223_01_______00302.BC", - kernels .. "/CATT_DV_145_01_______00216.BC", + kernels .. "CATT_DV_243_01_______00325.BC", + kernels .. "CATT_DV_223_01_______00302.BC", + kernels .. "CATT_DV_145_01_______00216.BC", -- High gain antenna - kernels .. "/ROS_HGA_2016_V0035.BC", - kernels .. "/ROS_HGA_2015_V0053.BC", - kernels .. "/ROS_HGA_2014_V0044.BC", + kernels .. "ROS_HGA_2016_V0035.BC", + kernels .. "ROS_HGA_2015_V0053.BC", + kernels .. "ROS_HGA_2014_V0044.BC", -- Solar arrays - kernels .. "/ROS_SA_2016_V0034.BC", - kernels .. "/ROS_SA_2015_V0042.BC", - kernels .. "/ROS_SA_2014_V0047.BC", + kernels .. "ROS_SA_2016_V0034.BC", + kernels .. "ROS_SA_2015_V0042.BC", + kernels .. "ROS_SA_2014_V0047.BC", - - kernels .. "/ROS_CGS_RSOC_V03.TPC" + kernels .. "ROS_CGS_RSOC_V03.TPC" } local LightSources = { @@ -130,7 +129,7 @@ local RosettaBlackFoil = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/black_foil.obj", + GeometryFile = models .. "black_foil.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -146,7 +145,7 @@ local RosettaBlackParts = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/black_parts.obj", + GeometryFile = models .. "black_parts.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -162,7 +161,7 @@ local RosettaDish = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/dish.obj", + GeometryFile = models .. "dish.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -178,7 +177,7 @@ local RosettaParts = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/parts.obj", + GeometryFile = models .. "parts.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -194,7 +193,7 @@ local RosettaSilverFoil = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/silver_foil.obj", + GeometryFile = models .. "silver_foil.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -210,7 +209,7 @@ local RosettaVents = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/vents.obj", + GeometryFile = models .. "vents.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -226,7 +225,7 @@ local RosettaWingA = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .."/wingA.obj", + GeometryFile = models .."wingA.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -242,7 +241,7 @@ local RosettaWingB = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/wingB.obj", + GeometryFile = models .. "wingB.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -258,7 +257,7 @@ local RosettaYellowFoil = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/yellow_foil.obj", + GeometryFile = models .. "yellow_foil.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -303,7 +302,7 @@ local PhilaeFoil = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/lander_foil.obj", + GeometryFile = models .. "lander_foil.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -319,7 +318,7 @@ local PhilaeLids = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/lander_lids.obj", + GeometryFile = models .. "lander_lids.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -335,7 +334,7 @@ local PhilaeParts = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/lander_parts.obj", + GeometryFile = models .. "lander_parts.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -351,7 +350,7 @@ local PhilaeSolarPanels = { Renderable = { Type = "RenderableModel", Body = "ROSETTA", - GeometryFile = models .. "/lander_solarp.obj", + GeometryFile = models .. "lander_solarp.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -403,7 +402,7 @@ local ImagePlane = { Spacecraft = "ROSETTA", Instrument = "ROS_NAVCAM-A", Moving = false, - Texture = models .. "/defaultProj.png" + Texture = models .. "defaultProj.png" }, GUI = { Name = "Rosetta Image Plane", diff --git a/data/assets/scene/solarsystem/missions/voyager/voyager1.asset b/data/assets/scene/solarsystem/missions/voyager/voyager1.asset index 6021db412f..5180d150f4 100644 --- a/data/assets/scene/solarsystem/missions/voyager/voyager1.asset +++ b/data/assets/scene/solarsystem/missions/voyager/voyager1.asset @@ -16,14 +16,14 @@ local kernels = asset.syncedResource({ }) local Kernels = { - kernels .. '/vg1_v02.tf', - kernels .. '/vg100019.tsc', - kernels .. '/Voyager_1.a54206u_V0.2_merged.bsp', - kernels .. '/voyager_1.ST+1991_a54418u.merged.bsp', - kernels .. '/vgr1_jup230.bsp', - kernels .. '/vgr1_sat337.bsp', - kernels .. '/vgr1_super.bc', - kernels .. '/vgr1_super_v2.bc' + kernels .. 'vg1_v02.tf', + kernels .. 'vg100019.tsc', + kernels .. 'Voyager_1.a54206u_V0.2_merged.bsp', + kernels .. 'voyager_1.ST+1991_a54418u.merged.bsp', + kernels .. 'vgr1_jup230.bsp', + kernels .. 'vgr1_sat337.bsp', + kernels .. 'vgr1_super.bc', + kernels .. 'vgr1_super_v2.bc' } local RotationMatrix = { @@ -78,7 +78,7 @@ local Voyager1Main = { Parent = Voyager1.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/voyager-main.obj", + GeometryFile = models .. "voyager-main.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -93,7 +93,7 @@ local Voyager1Antenna = { Parent = Voyager1.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/voyager-antenna.obj", + GeometryFile = models .. "voyager-antenna.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, diff --git a/data/assets/scene/solarsystem/missions/voyager/voyager2.asset b/data/assets/scene/solarsystem/missions/voyager/voyager2.asset index 87d32f852b..04125eff56 100644 --- a/data/assets/scene/solarsystem/missions/voyager/voyager2.asset +++ b/data/assets/scene/solarsystem/missions/voyager/voyager2.asset @@ -17,16 +17,16 @@ local kernels = asset.syncedResource({ }) local Kernels = { - kernels .. '/vg2_v02.tf', - kernels .. '/vg200022.tsc', - kernels .. '/Voyager_2.m05016u.merged.bsp', - kernels .. '/voyager_2.ST+1992_m05208u.merged.bsp', - kernels .. '/vgr2_jup230.bsp', - kernels .. '/vgr2_sat337.bsp', - kernels .. '/vgr2_ura083.bsp', - kernels .. '/vgr2_nep081.bsp', - kernels .. '/vgr2_super.bc', - kernels .. '/vgr2_super_v2.bc' + kernels .. 'vg2_v02.tf', + kernels .. 'vg200022.tsc', + kernels .. 'Voyager_2.m05016u.merged.bsp', + kernels .. 'voyager_2.ST+1992_m05208u.merged.bsp', + kernels .. 'vgr2_jup230.bsp', + kernels .. 'vgr2_sat337.bsp', + kernels .. 'vgr2_ura083.bsp', + kernels .. 'vgr2_nep081.bsp', + kernels .. 'vgr2_super.bc', + kernels .. 'vgr2_super_v2.bc' } local RotationMatrix = { @@ -82,7 +82,7 @@ local Voyager2Main = { Parent = Voyager2.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/voyager-main.obj", + GeometryFile = models .. "voyager-main.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, @@ -97,7 +97,7 @@ local Voyager2Antenna = { Parent = Voyager2.Identifier, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/voyager-antenna.obj", + GeometryFile = models .. "voyager-antenna.obj", ModelTransform = RotationMatrix, LightSources = LightSources }, diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index 501140a5b5..5ffbc7d5a9 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -30,7 +30,7 @@ local Earth = { }, Labels = { Enabled = false, - FileName = labelsPath .. "/Earth.labels", + FileName = labelsPath .. "Earth.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 5.0, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset index 94822c0af6..03741477fd 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset @@ -24,7 +24,7 @@ local L1 = { RenderableType = "Opaque", Billboard = true, Size = 700E5, - Texture = circle .. "/circle.png", + Texture = circle .. "circle.png", BlendMode = "Additive" }, Transform = { @@ -32,7 +32,7 @@ local L1 = { Type = "SpiceTranslation", Target = "391", -- L1 Observer = "SSB", - Kernels = kernels .. "/L1_de431.bsp" + Kernels = kernels .. "L1_de431.bsp" } }, Tag = { "lagrange_points_earth" , "lagrange_points_earth_l1" }, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset index 645def7014..9675194cdb 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset @@ -24,7 +24,7 @@ local L2Small = { RenderableType = "Opaque", Billboard = true, Size = 400E4, - Texture = circle .. "/circle.png", + Texture = circle .. "circle.png", BlendMode = "Additive" }, Transform = { @@ -32,7 +32,7 @@ local L2Small = { Type = "SpiceTranslation", Target = "392", -- L2 Observer = "SSB", - Kernels = kernels .. "/L2_de431.bsp" + Kernels = kernels .. "L2_de431.bsp" } }, Tag = { "lagrange_points_earth_l2_small" }, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset index 0b5faad71e..fecfac343d 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset @@ -24,7 +24,7 @@ local L4 = { RenderableType = "Opaque", Billboard = true, Size = 800E6, - Texture = circle .. "/circle.png", + Texture = circle .. "circle.png", BlendMode = "Additive" }, Transform = { @@ -32,7 +32,7 @@ local L4 = { Type = "SpiceTranslation", Target = "394", -- L4 Observer = "SSB", - Kernels = kernels .. "/L4_de431.bsp" + Kernels = kernels .. "L4_de431.bsp" } }, Tag = { "lagrange_points_earth", "lagrange_points_earth_l4" }, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset index ed3bb40514..bf95efa496 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset @@ -24,7 +24,7 @@ local L5 = { RenderableType = "Opaque", Billboard = true, Size = 800E6, - Texture = circle .. "/circle.png", + Texture = circle .. "circle.png", BlendMode = "Additive" }, Transform = { @@ -32,7 +32,7 @@ local L5 = { Type = "SpiceTranslation", Target = "395", -- L5 Observer = "SSB", - Kernels = kernels .. "/L5_de431.bsp" + Kernels = kernels .. "L5_de431.bsp" } }, Tag = { "lagrange_points_earth", "lagrange_points_earth_l5" }, diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset index cded8f8ea0..d335bcd44a 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Blue_Marble", Name = "Blue Marble", - FilePath = texturesPath .. "/earth_bluemarble.jpg", + FilePath = texturesPath .. "earth_bluemarble.jpg", Description = [[ Earth image from Blue Marble Next Generation ]], } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset index e45c0fe506..8c011649d3 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/fallbacks/blue_marble_height.asset @@ -8,7 +8,7 @@ local texturesPath = asset.syncedResource({ local layer = { Name = "Earth Bluemarble Height", Identifier = "Earth_Bluemarble_Height", - FilePath = texturesPath .. "/earth_bluemarble_height.jpg", + FilePath = texturesPath .. "earth_bluemarble_height.jpg", Description = [[ Topographic layer from Blue Marble Next Generation]] } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset index 1779e8a5b6..e2af3ebc65 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/fallbacks/earth_night_texture.asset @@ -8,7 +8,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Earth_Night_Texture", Name = "Earth Night Texture", - FilePath = texturesPath .. "/earth_night.jpg", + FilePath = texturesPath .. "earth_night.jpg", Description = [[ Earth's city lights are clearly visible from space ]] } diff --git a/data/assets/scene/solarsystem/planets/earth/markers.asset b/data/assets/scene/solarsystem/planets/earth/markers.asset index 975bb4b8b6..f65c1fb8dc 100644 --- a/data/assets/scene/solarsystem/planets/earth/markers.asset +++ b/data/assets/scene/solarsystem/planets/earth/markers.asset @@ -18,7 +18,7 @@ local EarthMarker = { Size = 3.0E11, Origin = "Center", Billboard = true, - Texture = texturesPath .. "/marker.png", + Texture = texturesPath .. "marker.png", BlendMode = "Additive" }, GUI = { diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset index 6c3cf10831..084c9bd401 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset @@ -41,7 +41,7 @@ local Moon = { }, Labels = { Enabled = false, - FileName = labelsPath .. "/moon.labels", + FileName = labelsPath .. "moon.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 7.6, diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset index 3c12782da0..af41474f0a 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset @@ -19,7 +19,7 @@ local models = asset.syncedResource({ local initializeAndAddNodes = function() local lineElement = satelliteHelper.makeSingleLineElement(tle, filename) local period = satelliteHelper.getPeriodFromElement(lineElement) - local path = tle .. "/" .. filename + local path = tle .. filename local iss = { Identifier = "ISS", @@ -59,7 +59,7 @@ local initializeAndAddNodes = function() }, Renderable = { Type = "RenderableModel", - GeometryFile = models .. "/ISS.fbx", + GeometryFile = models .. "ISS.fbx", ModelScale = "Centimeter", LightSources = { { diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset index f6417fdb88..ddeb635c01 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset @@ -35,7 +35,7 @@ local Callisto = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/callisto.labels", + FileName = labelsPath .. "callisto.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 11.5, diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset index 113938eaf8..922f837387 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/callisto_os.tif", + FilePath = texturesPath .. "callisto_os.tif", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset index f6f5dae90e..9d410ab75e 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset @@ -35,7 +35,7 @@ local Europa = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/europa.labels", + FileName = labelsPath .. "europa.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 11.0, diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset index ff04cd262f..1022dd7536 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/europa_os.tif", + FilePath = texturesPath .. "europa_os.tif", Enabled = true } diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset index c4991eb4e7..7a4265a51c 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Voyager_Global_Mosaic_Local", Name = "Voyager Global Mosaic [Local]", - FilePath = texturesPath .. "/evgos.vrt", + FilePath = texturesPath .. "evgos.vrt", BlendMode = "Color" } diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset index 182c3aefeb..18a6765f99 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset @@ -35,7 +35,7 @@ local Ganymede = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/ganymede.labels", + FileName = labelsPath .. "ganymede.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 11.5, diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset index 5bfd9aa607..677569d2a8 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/ganymede.jpg", + FilePath = texturesPath .. "ganymede.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset index 3bf82f2cc8..63b3d0d44d 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset @@ -35,7 +35,7 @@ local Io = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/io.labels", + FileName = labelsPath .. "io.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 11.0, diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset index baa929c659..5caebacd1c 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/io.jpg", + FilePath = texturesPath .. "io.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/jupiter/kernels.asset b/data/assets/scene/solarsystem/planets/jupiter/kernels.asset index 0a015021b8..5496ff308a 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/kernels.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/kernels.asset @@ -5,8 +5,8 @@ local Kernels = asset.syncedResource({ Version = 1 }) -asset.export("jup310", Kernels .. '/jup310.bsp') -asset.export("jup341", Kernels .. '/jup341.bsp') +asset.export("jup310", Kernels .. 'jup310.bsp') +asset.export("jup341", Kernels .. 'jup341.bsp') asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset index b1253cd604..a3abb622ce 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/jupiter_os.tif", + FilePath = texturesPath .. "jupiter_os.tif", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/fallbacks/mars_texture.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/fallbacks/mars_texture.asset index c9094eaa85..5f5e11db94 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/fallbacks/mars_texture.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/fallbacks/mars_texture.asset @@ -8,7 +8,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Mars_Texture", Name = "Mars Texture", - FilePath = texturesPath .. "/mars.jpg", + FilePath = texturesPath .. "mars.jpg", } asset.export("layer", layer) diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset index 18bf3f5e92..d33448f891 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Mars_Texture", Name = "Mars Texture", - FilePath = texturesPath .. "/mars.jpg", + FilePath = texturesPath .. "mars.jpg", Description = [[ Default jpg texture for Mars]] } diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index b0d8c1c486..d1d6babd0f 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -35,7 +35,7 @@ local Mars = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/mars.labels", + FileName = labelsPath .. "mars.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 8.7, diff --git a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset index e5fb205cf4..f98cd46dc1 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset @@ -17,13 +17,13 @@ local Deimos = { Type = "SpiceRotation", SourceFrame = "IAU_DEIMOS", DestinationFrame = "GALACTIC", - Kernels = kernels .. '/mar097.bsp' + Kernels = kernels .. 'mar097.bsp' }, Translation = { Type = "SpiceTranslation", Target = "DEIMOS", Observer = "MARS BARYCENTER", - Kernels = kernels .. '/mar097.bsp' + Kernels = kernels .. 'mar097.bsp' } }, Renderable = { diff --git a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset index 4daa558e81..cedd49e9f8 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset @@ -17,13 +17,13 @@ local Phobos = { Type = "SpiceRotation", SourceFrame = "IAU_PHOBOS", DestinationFrame = "GALACTIC", - Kernels = kernels .. '/mar097.bsp' + Kernels = kernels .. 'mar097.bsp' }, Translation = { Type = "SpiceTranslation", Target = "PHOBOS", Observer = "MARS BARYCENTER", - Kernels = kernels .. '/mar097.bsp' + Kernels = kernels .. 'mar097.bsp' } }, Renderable = { diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset index 48e77aa092..ee7e845e12 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Name = "Aluminium Abundance", Identifier = "alsimap_02122015", - FilePath = texturesPath .. "/alsimap_02122015.png", + FilePath = texturesPath .. "alsimap_02122015.png", BlendMode = "Multiply", } diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset index 4349b52fa6..62a02e3634 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Name = "Calcium Abundance", Identifier = "casimap_02122015", - FilePath = texturesPath .. "/casimap_02122015.png", + FilePath = texturesPath .. "casimap_02122015.png", BlendMode = "Multiply", } diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset index 44de613d98..254c215600 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Name = "Iron Abundance", Identifier = "fesimap_02122015", - FilePath = texturesPath .. "/fesimap_02122015.png", + FilePath = texturesPath .. "fesimap_02122015.png", BlendMode = "Multiply", } diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset index 9eaa922e2e..d814e81f01 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Name = "Magnesium Abundance", Identifier = "mgsimap_02122015", - FilePath = texturesPath .. "/mgsimap_02122015.png", + FilePath = texturesPath .. "mgsimap_02122015.png", Settings = { Gamma = 1.33, Multiplier = 1.15 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset index e07396ecb8..5ceddf457e 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Name = "Silicon Abundance", Identifier = "ssimap_02122015", - FilePath = texturesPath .. "/ssimap_02122015.png", + FilePath = texturesPath .. "ssimap_02122015.png", BlendMode = "Multiply", } diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index 037c85a891..65adb9c0b2 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -36,7 +36,7 @@ local Mercury = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/Mercury.labels", + FileName = labelsPath .. "Mercury.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 10.1, diff --git a/data/assets/scene/solarsystem/planets/neptune/kernels.asset b/data/assets/scene/solarsystem/planets/neptune/kernels.asset index 8898ad4e7f..f3ba3754aa 100644 --- a/data/assets/scene/solarsystem/planets/neptune/kernels.asset +++ b/data/assets/scene/solarsystem/planets/neptune/kernels.asset @@ -5,10 +5,10 @@ local Kernels = asset.syncedResource({ Version = 1 }) -asset.export("nep081", Kernels .. '/nep081.bsp') -asset.export("nep086", Kernels .. '/nep086.bsp') -asset.export("nep087", Kernels .. '/nep087.bsp') -asset.export("nep088", Kernels .. '/nep088.bsp') +asset.export("nep081", Kernels .. 'nep081.bsp') +asset.export("nep086", Kernels .. 'nep086.bsp') +asset.export("nep087", Kernels .. 'nep087.bsp') +asset.export("nep088", Kernels .. 'nep088.bsp') asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset b/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset index 6d3f350826..88e18a9a97 100644 --- a/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset +++ b/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/neptune.jpg", + FilePath = texturesPath .. "neptune.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset index a694b53569..b257b98717 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset @@ -33,7 +33,7 @@ local Dione = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/dione.labels", + FileName = labelsPath .. "dione.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 8.7, diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset b/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset index a6adcf8c7e..aa44d870d3 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/dione.jpg", + FilePath = texturesPath .. "dione.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset index bba6f22c07..7361a0676d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset @@ -33,7 +33,7 @@ local Enceladus = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/enceladus.labels", + FileName = labelsPath .. "enceladus.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 8.1, diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset index 62cb627e83..0242b1901e 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/enceladus.jpg", + FilePath = texturesPath .. "enceladus.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset index 25b4c940b2..0a0d1725a1 100644 --- a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset +++ b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset @@ -34,7 +34,7 @@ local Hyperion = { Labels = { -- @TODO (2021-05-21, emmbr26) These labels do not seem to be visible Enabled = false, - FileName = labelsPath .. "/hyperion.labels", + FileName = labelsPath .. "hyperion.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 8.6, diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset index 5be09e3359..877924ef15 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset @@ -33,7 +33,7 @@ local Iapetus = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/iapetus.labels", + FileName = labelsPath .. "iapetus.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 8.7, diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset index 454909fcff..750821d999 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/iapetus.jpg", + FilePath = texturesPath .. "iapetus.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/saturn/kernels.asset b/data/assets/scene/solarsystem/planets/saturn/kernels.asset index 3c4c25eca2..06eec38e3a 100644 --- a/data/assets/scene/solarsystem/planets/saturn/kernels.asset +++ b/data/assets/scene/solarsystem/planets/saturn/kernels.asset @@ -5,10 +5,10 @@ local Kernels = asset.syncedResource({ Version = 1 }) -asset.export("sat319", Kernels .. '/sat319.bsp') -asset.export("sat368", Kernels .. '/sat368.bsp') -asset.export("sat375", Kernels .. '/sat375.bsp') -asset.export("sat393", Kernels .. '/sat393.bsp') +asset.export("sat319", Kernels .. 'sat319.bsp') +asset.export("sat368", Kernels .. 'sat368.bsp') +asset.export("sat375", Kernels .. 'sat375.bsp') +asset.export("sat393", Kernels .. 'sat393.bsp') asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset b/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset index 7262a13bac..66a345c47e 100644 --- a/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/saturn.jpg", + FilePath = texturesPath .. "saturn.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset index 7873d18ded..257393d372 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/mimas.jpg", + FilePath = texturesPath .. "mimas.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset index 4726d070bc..18d1c667ed 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset @@ -33,7 +33,7 @@ local Mimas = { Layers = { }, Labels = { Enabled = false, - FileName = labelsPath .. "/mimas.labels", + FileName = labelsPath .. "mimas.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 7.7, diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset index c7899722cf..c23808c37d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/rhea.jpg", + FilePath = texturesPath .. "rhea.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset index cdfb4a9038..080cb0e086 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset @@ -33,7 +33,7 @@ local Rhea = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/rhea.labels", + FileName = labelsPath .. "rhea.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 9.0, diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index de19cb60eb..201afdbec8 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -36,11 +36,11 @@ local Saturn = { --ColorFilter = 0.15, -- MultiTexture Valeus: - TextureFwrd = texturesPath .. "/forward_original_single.png", - TextureBckwrd = texturesPath .. "/back_original_single.png", - TextureUnlit = texturesPath .. "/unlit_original_single.png", - TextureColor = texturesPath .. "/color_original_single.png", - TextureTransparency = texturesPath .. "/trans_original_single.png", + TextureFwrd = texturesPath .. "forward_original_single.png", + TextureBckwrd = texturesPath .. "back_original_single.png", + TextureUnlit = texturesPath .. "unlit_original_single.png", + TextureColor = texturesPath .. "color_original_single.png", + TextureTransparency = texturesPath .. "trans_original_single.png", ColorFilter = 0.8, NightFactor = 1.0, diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset index da20584fcf..6fa25627ca 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/tethys.jpg", + FilePath = texturesPath .. "tethys.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset index 3bc7f43987..0e70c9ccf4 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset @@ -33,7 +33,7 @@ local Tethys = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/tethys.labels", + FileName = labelsPath .. "tethys.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 8.3, diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset index fe470aff6c..22afab24a1 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Cassini_ISS_Global_Mosaic_4km_Local", Name = "Cassini ISS Global Mosaic 4km", - FilePath = texturesPath .. "/Titan_ISS_P19658_Mosaic_Global_4km_os.tif", + FilePath = texturesPath .. "Titan_ISS_P19658_Mosaic_Global_4km_os.tif", Description = [[ This global digital map of Saturn's moon Titan was created using images taken by the Cassini spacecraft's Imaging Science Subsystem (ISS). The map was produced in June 2015 using data collected through Cassini's flyby on April 7, diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset index a68538c64b..0eaa1f8101 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset @@ -33,7 +33,7 @@ local Titan = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/titan.labels", + FileName = labelsPath .. "titan.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 9.6, diff --git a/data/assets/scene/solarsystem/planets/uranus/kernels.asset b/data/assets/scene/solarsystem/planets/uranus/kernels.asset index 3e8ba66685..fed1e70e14 100644 --- a/data/assets/scene/solarsystem/planets/uranus/kernels.asset +++ b/data/assets/scene/solarsystem/planets/uranus/kernels.asset @@ -5,9 +5,9 @@ local Kernels = asset.syncedResource({ Version = 1 }) -asset.export("ura091", Kernels .. "/ura091-rocks-merge.bsp") -asset.export("ura111", Kernels .. "/ura111.bsp") -asset.export("ura112", Kernels .. "/ura112.bsp") +asset.export("ura091", Kernels .. "ura091-rocks-merge.bsp") +asset.export("ura111", Kernels .. "ura111.bsp") +asset.export("ura112", Kernels .. "ura112.bsp") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset b/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset index b1c7636a47..711bda11df 100644 --- a/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset +++ b/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/uranus.jpg", + FilePath = texturesPath .. "uranus.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset index 77fc18f747..c02915438e 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset @@ -9,7 +9,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/venus.jpg", + FilePath = texturesPath .. "venus.jpg", Settings = { Opacity = 0.48, Gamma = 0.48 diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index b3cd407a63..6dea626664 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -38,7 +38,7 @@ local Venus = { Layers = {}, Labels = { Enabled = false, - FileName = labelsPath .. "/venus.labels", + FileName = labelsPath .. "venus.labels", AlignmentOption = "Horizontally", -- or Circularly FontSize = 20.0, Size = 11.0, diff --git a/data/assets/scene/solarsystem/sssb/astraea.asset b/data/assets/scene/solarsystem/sssb/astraea.asset index fc0895743b..1f9a5ccc15 100644 --- a/data/assets/scene/solarsystem/sssb/astraea.asset +++ b/data/assets/scene/solarsystem/sssb/astraea.asset @@ -15,7 +15,7 @@ local AstraeaTrail = { Type = "RenderableTrailTrajectory", Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trajectory .. "/horizons_astraea.dat" + HorizonsTextFile = trajectory .. "horizons_astraea.dat" }, Color = { 0.9, 0.9, 0.0 }, StartTime = "2014 JAN 01 00:00:00", @@ -35,7 +35,7 @@ local AstraeaPosition = { Transform = { Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = trajectory .. "/horizons_astraea.dat" + HorizonsTextFile = trajectory .. "horizons_astraea.dat" } }, GUI = { diff --git a/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset b/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset index e3525ae6d8..58307832c8 100644 --- a/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset +++ b/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset @@ -6,7 +6,7 @@ local orbit = asset.syncedResource({ Type = "HttpSynchronization", Identifier = "horizons_c2019y4atlas", Version = 1 -}) .. "/c2019y4atlas.txt" +}) .. "c2019y4atlas.txt" local C2019Y4AtlasTrail = { Identifier = "C2019Y4AtlasTrail", diff --git a/data/assets/scene/solarsystem/sssb/sssb_shared.asset b/data/assets/scene/solarsystem/sssb/sssb_shared.asset index 9ba25174e9..c3b1d07ecf 100644 --- a/data/assets/scene/solarsystem/sssb/sssb_shared.asset +++ b/data/assets/scene/solarsystem/sssb/sssb_shared.asset @@ -24,7 +24,7 @@ local createSssbGroupObject = function(filename, guiName, sssbFolder, trailColor Parent = transforms.SunECLIPJ2000.Identifier, Renderable = { Type = "RenderableSmallBody", - Path = sssbFolder.."/"..filename, + Path = sssbFolder .. filename, Segments = 200, Color = trailColor, TrailFade = 0.5, diff --git a/data/assets/scene/solarsystem/sssb/swifttuttle.asset b/data/assets/scene/solarsystem/sssb/swifttuttle.asset index f0d97c6fdc..469e71f551 100644 --- a/data/assets/scene/solarsystem/sssb/swifttuttle.asset +++ b/data/assets/scene/solarsystem/sssb/swifttuttle.asset @@ -15,7 +15,7 @@ local SwiftTuttleTrail = { Type = "RenderableTrailTrajectory", Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = sync .. "/horizons_swifttuttle.dat" + HorizonsTextFile = sync .. "horizons_swifttuttle.dat" }, Color = { 0.9, 0.9, 0.0 }, StartTime = "1879 JUN 27 00:00:00", @@ -34,7 +34,7 @@ local SwiftTuttlePosition = { Transform = { Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = sync .. "/horizons_swifttuttle.dat" + HorizonsTextFile = sync .. "horizons_swifttuttle.dat" } }, GUI = { diff --git a/data/assets/scene/solarsystem/sssb/tesla_roadster.asset b/data/assets/scene/solarsystem/sssb/tesla_roadster.asset index 19b8ac2c44..7627d71b56 100644 --- a/data/assets/scene/solarsystem/sssb/tesla_roadster.asset +++ b/data/assets/scene/solarsystem/sssb/tesla_roadster.asset @@ -15,7 +15,7 @@ local TeslaRoadsterTrail = { Type = "RenderableTrailTrajectory", Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = orbit .. "/horizons_tesla.dat" + HorizonsTextFile = orbit .. "horizons_tesla.dat" }, Color = { 0.9, 0.9, 0.0 }, StartTime = "2018 FEB 8 00:00:00", @@ -35,7 +35,7 @@ local TeslaPosition = { Transform = { Translation = { Type = "HorizonsTranslation", - HorizonsTextFile = orbit .. "/horizons_tesla.dat" + HorizonsTextFile = orbit .. "horizons_tesla.dat" } }, GUI = { diff --git a/data/assets/scene/solarsystem/sun/glare.asset b/data/assets/scene/solarsystem/sun/glare.asset index 6566d245a3..ee3697c1aa 100644 --- a/data/assets/scene/solarsystem/sun/glare.asset +++ b/data/assets/scene/solarsystem/sun/glare.asset @@ -18,7 +18,7 @@ local SunGlare = { Size = 1.3*10^10.5, Origin = "Center", Billboard = true, - Texture = textures .. "/halo.png", + Texture = textures .. "halo.png", BlendMode = "Additive", Opacity = 0.65, RenderableType = "PreDeferredTransparency" diff --git a/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset b/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset index 557d57ff06..4aab850afe 100644 --- a/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset +++ b/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset @@ -10,7 +10,7 @@ local texturesPath = asset.syncedResource({ local layer = { Identifier = "Texture", - FilePath = texturesPath .. "/sun.jpg", + FilePath = texturesPath .. "sun.jpg", } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/sun/marker.asset b/data/assets/scene/solarsystem/sun/marker.asset index 43d2b9b42b..877fad9992 100644 --- a/data/assets/scene/solarsystem/sun/marker.asset +++ b/data/assets/scene/solarsystem/sun/marker.asset @@ -19,7 +19,7 @@ local SunMarker = { Size = 3.0E11, Origin = "Center", Billboard = true, - Texture = textures .. "/marker.png", + Texture = textures .. "marker.png", BlendMode = "Additive" }, GUI = { diff --git a/data/assets/spice/base.asset b/data/assets/spice/base.asset index 9a9f9a31e1..2f57cf3f38 100644 --- a/data/assets/spice/base.asset +++ b/data/assets/spice/base.asset @@ -13,7 +13,7 @@ local kernels = { asset.localResource("naif0012.tls"), -- Leapseconds: asset.localResource("pck00010.tpc"), - syncedDirectory .. "/de430_1850-2150.bsp" + syncedDirectory .. "de430_1850-2150.bsp" } assetHelper.registerSpiceKernels(asset, kernels) diff --git a/data/assets/sync/everything.asset b/data/assets/sync/everything.asset deleted file mode 100644 index 3f7806f4b9..0000000000 --- a/data/assets/sync/everything.asset +++ /dev/null @@ -1,10 +0,0 @@ --- Please note that this scene/asset is not meant to be included anywhere directly and --- OpenSpace will probably fail as soon as it gets to the initialization step, but at --- least the synchronization will all work - -local assetHelper = asset.require('../util/asset_helper') - -assetHelper.requireAll(asset, '../customization') -assetHelper.requireAll(asset, '../scene') -assetHelper.requireAll(asset, '../spice') -assetHelper.requireAll(asset, '../util') diff --git a/data/assets/util/add_marker.asset b/data/assets/util/add_marker.asset index 1d62a2f00c..527c776c25 100644 --- a/data/assets/util/add_marker.asset +++ b/data/assets/util/add_marker.asset @@ -10,7 +10,7 @@ asset.onInitialize(function() Identifier = "target-marker", Name = "Target Marker", Type = "ScreenSpaceImageLocal", - TexturePath = icons .. '/target.png' + TexturePath = icons .. 'target.png' }) end) diff --git a/data/assets/util/static_server.asset b/data/assets/util/static_server.asset index 060d2676b4..75bc1b9e04 100644 --- a/data/assets/util/static_server.asset +++ b/data/assets/util/static_server.asset @@ -12,7 +12,7 @@ asset.onInitialize(function () -- Unzip the server bundle local dest = backend .. "/backend" if not openspace.directoryExists(dest) then - openspace.unzipFile(backend .. "/backend.zip", dest, true) + openspace.unzipFile(backend .. "backend.zip", dest, true) end openspace.setPropertyValueSingle( diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset index 698f491ec7..b2cb10c9c9 100644 --- a/data/assets/util/webgui.asset +++ b/data/assets/util/webgui.asset @@ -15,9 +15,9 @@ local frontend = asset.syncedResource({ asset.onInitialize(function () -- Unzip the frontend bundle - local dest = frontend .. "/frontend" + local dest = frontend .. "frontend" if not openspace.directoryExists(dest) then - openspace.unzipFile(frontend .. "/frontend.zip", dest, true) + openspace.unzipFile(frontend .. "frontend.zip", dest, true) end -- Disable the server, add production gui endpoint, and restart server. @@ -31,7 +31,7 @@ asset.onInitialize(function () local directories = openspace.getPropertyValue("Modules.WebGui.Directories") directories[#directories + 1] = "frontend" - directories[#directories + 1] = frontend .. '/frontend' + directories[#directories + 1] = frontend .. 'frontend' openspace.setPropertyValueSingle("Modules.WebGui.Directories", directories) openspace.setPropertyValueSingle("Modules.WebGui.DefaultEndpoint", "frontend") diff --git a/src/scene/assetmanager.cpp b/src/scene/assetmanager.cpp index c597a1ec7e..0aa5e956b7 100644 --- a/src/scene/assetmanager.cpp +++ b/src/scene/assetmanager.cpp @@ -496,7 +496,9 @@ void AssetManager::setUpAssetLuaTable(Asset* asset) { } asset->addSynchronization(syncItem->synchronization.get()); - ghoul::lua::push(L, syncItem->synchronization->directory()); + std::filesystem::path dir = syncItem->synchronization->directory(); + dir += std::filesystem::path::preferred_separator; + ghoul::lua::push(L, dir); return 1; }, 2 From 8b4de949dc891aceda3fb8c20eb8847331c99860 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Dec 2021 23:39:33 +0100 Subject: [PATCH 035/117] Correctly report issue if a required asset is not available; Fix issue loading a colormap for the gaia stars --- modules/gaia/rendering/renderablegaiastars.cpp | 2 +- src/scene/assetmanager.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp index f9f05f7c3d..63a1c2cee9 100644 --- a/modules/gaia/rendering/renderablegaiastars.cpp +++ b/modules/gaia/rendering/renderablegaiastars.cpp @@ -2131,7 +2131,7 @@ void RenderableGaiaStars::update(const UpdateData&) { if (!_colorTexturePath.value().empty()) { _colorTexture = ghoul::io::TextureReader::ref().loadTexture( absPath(_colorTexturePath).string(), - 2 + 1 ); if (_colorTexture) { LDEBUG(fmt::format("Loaded texture from {}", absPath(_colorTexturePath))); diff --git a/src/scene/assetmanager.cpp b/src/scene/assetmanager.cpp index 0aa5e956b7..641d738d2f 100644 --- a/src/scene/assetmanager.cpp +++ b/src/scene/assetmanager.cpp @@ -496,9 +496,9 @@ void AssetManager::setUpAssetLuaTable(Asset* asset) { } asset->addSynchronization(syncItem->synchronization.get()); - std::filesystem::path dir = syncItem->synchronization->directory(); - dir += std::filesystem::path::preferred_separator; - ghoul::lua::push(L, dir); + std::filesystem::path path = syncItem->synchronization->directory(); + path += std::filesystem::path::preferred_separator; + ghoul::lua::push(L, path); return 1; }, 2 @@ -697,6 +697,9 @@ Asset* AssetManager::retrieveAsset(const std::filesystem::path& path) { return it->get(); } + if (!std::filesystem::is_regular_file(path)) { + throw ghoul::RuntimeError(fmt::format("Could not find asset file {}", path)); + } std::unique_ptr asset = std::make_unique(*this, path); Asset* res = asset.get(); From 064a483b819bb0ae50e123398a9fbd0d01b476df Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 28 Dec 2021 23:40:09 +0100 Subject: [PATCH 036/117] Cleanup and unifying coding style for asset files --- data/assets/base.asset | 110 ++- data/assets/base_blank.asset | 26 +- data/assets/customization/globebrowsing.asset | 40 +- data/assets/dashboard/default_dashboard.asset | 14 +- data/assets/events/toggle_trail.asset | 2 +- data/assets/examples/animation.asset | 6 +- data/assets/examples/approachevents.asset | 6 +- data/assets/examples/basic.scene | 25 - data/assets/examples/dashboarditems.asset | 2 +- .../assets/examples/debugcoordinateaxes.asset | 6 +- data/assets/examples/discs.asset | 8 +- data/assets/examples/globerotation.asset | 6 +- data/assets/examples/globetranslation.asset | 6 +- data/assets/examples/grids.asset | 2 +- data/assets/examples/joystickProperty.asset | 6 +- data/assets/examples/luastatemachine.asset | 10 +- .../examples/modelshader/modelshader.asset | 6 +- data/assets/examples/primitives.asset | 2 +- data/assets/examples/screenspacebrowser.asset | 2 +- data/assets/examples/slidedeck.asset | 2 +- data/assets/examples/spheres.asset | 2 +- data/assets/examples/statemachine.asset | 16 +- .../examples/temperature_land_highres.asset | 2 +- .../examples/volume/generated/cartesian.asset | 2 +- .../volume/generated/cartesiansequence.asset | 2 +- .../examples/volume/generated/spherical.asset | 2 +- data/assets/global/localbookmarks.asset | 6 +- data/assets/global/openspacebookmarks.asset | 14 +- data/assets/scene/digitaluniverse/2dF.asset | 2 +- data/assets/scene/digitaluniverse/2mass.asset | 2 +- data/assets/scene/digitaluniverse/6dF.asset | 2 +- data/assets/scene/digitaluniverse/abell.asset | 4 +- .../digitaluniverse/alternatestarlabels.asset | 2 +- .../digitaluniverse/backgroundradiation.asset | 20 +- .../backgroundradiation_multiverse.asset | 30 +- .../backgroundradiation_textures.asset | 8 - .../scene/digitaluniverse/clusters.asset | 2 +- .../digitaluniverse/constellationbounds.asset | 2 +- .../digitaluniverse/constellations.asset | 2 +- .../scene/digitaluniverse/deepsky.asset | 6 +- .../digitaluniverse/digitaluniverse.asset | 73 +- .../assets/scene/digitaluniverse/dwarfs.asset | 2 +- .../scene/digitaluniverse/exoplanets.asset | 2 +- .../digitaluniverse/globularclusters.asset | 2 +- data/assets/scene/digitaluniverse/grids.asset | 6 +- .../assets/scene/digitaluniverse/groups.asset | 2 +- .../scene/digitaluniverse/h2regions.asset | 2 +- data/assets/scene/digitaluniverse/hdf.asset | 2 +- .../assets/scene/digitaluniverse/kepler.asset | 2 +- .../scene/digitaluniverse/localdwarfs.asset | 2 +- .../scene/digitaluniverse/milkyway.asset | 22 +- .../digitaluniverse/milkyway_arm_labels.asset | 22 +- .../scene/digitaluniverse/milkyway_data.asset | 16 - .../digitaluniverse/milkyway_label.asset | 3 +- .../digitaluniverse/milkyway_sphere.asset | 4 +- .../digitaluniverse/obassociations.asset | 2 +- .../scene/digitaluniverse/openclusters.asset | 2 +- .../digitaluniverse/planetarynebulae.asset | 2 +- .../scene/digitaluniverse/pulsars.asset | 2 +- .../scene/digitaluniverse/quasars.asset | 2 +- data/assets/scene/digitaluniverse/sdss.asset | 2 +- .../scene/digitaluniverse/starlabels.asset | 2 +- .../scene/digitaluniverse/starorbits.asset | 6 +- data/assets/scene/digitaluniverse/stars.asset | 19 +- .../digitaluniverse/stars_colormap.asset | 22 - .../digitaluniverse/stars_textures.asset | 20 - .../scene/digitaluniverse/superclusters.asset | 2 +- .../digitaluniverse/supernovaremnants.asset | 2 +- data/assets/scene/digitaluniverse/tully.asset | 2 +- data/assets/scene/digitaluniverse/voids.asset | 2 +- .../constellations/constellation_art.asset | 40 +- .../constellation_extrakeybinds.asset | 2 +- .../constellation_keybinds.asset | 2 +- .../milkyway/exoplanets/exoplanets_data.asset | 9 +- .../exoplanets/exoplanets_textures.asset | 2 +- data/assets/scene/milkyway/gaia/apogee.asset | 22 +- .../gaia/gaia_dr2_download_stars.asset | 8 +- .../scene/milkyway/gaia/gaiastars.asset | 19 +- data/assets/scene/milkyway/gaia/galah.asset | 22 +- data/assets/scene/milkyway/milkyway/eso.asset | 4 +- .../scene/milkyway/milkyway/volume.asset | 6 +- .../objects/orionnebula/cluster.asset | 5 +- .../milkyway/objects/orionnebula/nebula.asset | 6 +- .../objects/orionnebula/orionnebula.asset | 4 +- .../objects/orionnebula/transforms.asset | 4 +- data/assets/scene/milkyway/stars/denver.asset | 2 +- .../dwarf_planets/pluto/charon/charon.asset | 6 +- .../pluto/charon/charon_trail.asset | 4 +- .../pluto/charon/default_layers.asset | 4 +- .../layers/colorlayers/greyscale_usgs.asset | 2 +- .../dwarf_planets/pluto/default_layers.asset | 4 +- .../layers/colorlayers/greyscale_usgs.asset | 2 +- .../dwarf_planets/pluto/minor/hydra.asset | 6 +- .../dwarf_planets/pluto/minor/kerberos.asset | 6 +- .../dwarf_planets/pluto/minor/nix.asset | 6 +- .../dwarf_planets/pluto/minor/styx.asset | 6 +- .../dwarf_planets/pluto/pluto.asset | 6 +- .../dwarf_planets/pluto/pluto_trail.asset | 4 +- .../pluto/pluto_trail_kepler.asset | 8 +- .../dwarf_planets/pluto/system.asset | 20 +- .../dwarf_planets/pluto/trail.asset | 6 +- .../dwarf_planets/pluto/transforms.asset | 6 +- .../bastille_day/density_volume.asset | 4 +- .../heliosphere/bastille_day/fieldlines.asset | 8 +- .../heliosphere/bastille_day/fluxnodes.asset | 8 +- .../bastille_day/fluxnodescutplane.asset | 4 +- .../bastille_day/fluxnodeslegend.asset | 12 +- .../bastille_day/lightindicator.asset | 6 +- .../bastille_day/magnetogram_textures.asset | 14 +- .../interstellar/c-2019_q4_borisov.asset | 4 +- .../solarsystem/interstellar/oumuamua.asset | 4 +- .../missions/apollo/11/apollo11.asset | 18 +- .../missions/apollo/11/kernels.asset | 2 +- .../solarsystem/missions/apollo/11/lem.asset | 6 +- .../missions/apollo/11/lem_descent.asset | 456 +++++----- .../apollo/11/lem_descent_rotation.asset | 796 +++++++++--------- .../missions/apollo/11/lem_flipbook.asset | 4 +- .../missions/apollo/15/apollo15.asset | 10 +- .../missions/apollo/15/kernels.asset | 18 +- .../missions/apollo/17/bouldersstation2.asset | 6 +- .../missions/apollo/17/bouldersstation6.asset | 6 +- .../missions/apollo/17/bouldersstation7.asset | 6 +- .../solarsystem/missions/apollo/17/lem.asset | 6 +- .../missions/apollo/8/apollo8.asset | 6 +- .../missions/apollo/8/kernels.asset | 8 +- .../missions/apollo/8/launch_model.asset | 10 +- .../solarsystem/missions/apollo/8/model.asset | 10 +- .../missions/apollo/8/trails.asset | 8 +- .../apollo/apollo_globebrowsing.asset | 3 +- .../missions/apollo/insignias_map.asset | 16 +- .../solarsystem/missions/dawn/ceres.asset | 4 +- .../solarsystem/missions/dawn/dawn.asset | 8 +- .../solarsystem/missions/dawn/vesta.asset | 4 +- .../solarsystem/missions/gaia/dashboard.asset | 2 +- .../solarsystem/missions/gaia/gaia.asset | 6 +- .../solarsystem/missions/gaia/trail.asset | 6 +- .../missions/gaia/transforms.asset | 4 +- .../solarsystem/missions/insight/edl.asset | 44 +- .../missions/insight/shortcuts.asset | 45 +- .../solarsystem/missions/juno/juno.asset | 6 +- .../solarsystem/missions/jwst/hudf.asset | 12 +- .../solarsystem/missions/jwst/image.asset | 2 +- .../solarsystem/missions/jwst/jwst.asset | 8 +- .../solarsystem/missions/jwst/timelapse.asset | 162 ++-- .../solarsystem/missions/jwst/trail.asset | 8 +- .../missions/jwst/transforms.asset | 16 +- .../missions/messenger/dashboard.asset | 2 +- .../messenger/mercurymagnetosphere.asset | 6 +- .../missions/messenger/messengerSC.asset | 54 +- .../missions/newhorizons/charon.asset | 6 +- .../missions/newhorizons/dashboard.asset | 2 +- .../missions/newhorizons/fov.asset | 6 +- .../missions/newhorizons/label.asset | 10 +- .../missions/newhorizons/model.asset | 6 +- .../missions/newhorizons/newhorizons.asset | 14 +- .../missions/newhorizons/othermoons.asset | 10 +- .../missions/newhorizons/pluto.asset | 8 +- .../missions/newhorizons/trail.asset | 4 +- .../missions/newhorizons/transforms.asset | 6 +- .../missions/osirisrex/bennu.asset | 6 +- .../missions/osirisrex/bennu_projection.asset | 6 +- .../missions/osirisrex/dashboard.asset | 2 +- .../missions/osirisrex/imageplane.asset | 4 +- .../missions/osirisrex/kernels.asset | 2 +- .../missions/osirisrex/model.asset | 10 +- .../missions/osirisrex/osirisrex.asset | 14 +- .../missions/osirisrex/script_schedule.asset | 20 +- .../missions/osirisrex/trail.asset | 8 +- .../missions/osirisrex/transforms.asset | 4 +- .../missions/perseverance/model.asset | 11 +- .../missions/perseverance/perseverance.asset | 5 +- .../missions/perseverance/shortcuts.asset | 47 +- .../missions/perseverance/trail.asset | 7 +- .../missions/pioneer/pioneer10.asset | 6 +- .../missions/pioneer/pioneer11.asset | 8 +- .../missions/pioneer/pioneermodel.asset | 4 +- .../solarsystem/missions/rosetta/67p.asset | 4 +- .../missions/rosetta/dashboard.asset | 2 +- .../missions/rosetta/rosetta.asset | 6 +- .../missions/voyager/dashboard.asset | 2 +- .../missions/voyager/voyager1.asset | 20 +- .../missions/voyager/voyager2.asset | 24 +- .../voyager1_2__pioneer10_11.asset | 2 +- .../solarsystem/planets/default_layers.asset | 46 +- .../planets/earth/atmosphere.asset | 4 +- .../planets/earth/default_layers.asset | 52 +- .../solarsystem/planets/earth/earth.asset | 4 +- .../planets/earth/lagrange_points/L1.asset | 6 +- .../planets/earth/lagrange_points/L2.asset | 10 +- .../planets/earth/lagrange_points/L4.asset | 6 +- .../planets/earth/lagrange_points/L5.asset | 6 +- .../lagrange_points/lagrange_points.asset | 8 +- ...om_w1_sea_ice_concentration_temporal.asset | 2 +- .../colorlayers/aqua_modis_temporal.asset | 2 +- .../layers/colorlayers/bmng_sweden.asset | 5 +- .../earth/layers/colorlayers/bmng_utah.asset | 5 +- .../colorlayers/esri_imagery_world_2D.asset | 5 +- .../layers/colorlayers/esri_viirs_combo.asset | 5 +- .../colorlayers/esri_world_imagery.asset | 5 +- .../colorlayers/fallbacks/blue_marble.asset | 2 +- ...sst_sea_surface_temperature_temporal.asset | 2 +- ...mur_sea_surface_temperature_temporal.asset | 2 +- .../modis_terra_chlorophyll_a_temporal.asset | 2 +- .../colorlayers/terra_modis_temporal.asset | 2 +- .../colorlayers/viirs_snpp_temporal.asset | 2 +- .../layers/heightlayers/terrain_tileset.asset | 5 +- .../nightlayers/earth_at_night_2012.asset | 5 +- .../nightlayers/earth_at_night_temporal.asset | 2 +- .../earth/layers/overlays/coastlines.asset | 5 +- .../layers/overlays/coastlines_enabled.asset | 2 +- .../layers/overlays/reference_features.asset | 5 +- .../layers/overlays/reference_labels.asset | 5 +- .../layers/overlays/size_reference.asset | 2 +- .../earth/layers/overlays/tile_indices.asset | 3 +- .../layers/watermasks/gebco_sweden.asset | 5 +- .../earth/layers/watermasks/gebco_utah.asset | 5 +- .../layers/watermasks/modis_water_mask.asset | 5 +- .../earth/magnetosphere/magnetosphere.asset | 4 +- .../transforms_magnetosphere.asset | 4 +- .../solarsystem/planets/earth/markers.asset | 4 +- .../planets/earth/moon/default_layers.asset | 31 +- .../layers/colorlayers/clemuvvis_sweden.asset | 5 +- .../layers/colorlayers/clemuvvis_utah.asset | 5 +- .../layers/colorlayers/kaguya_sweden.asset | 5 +- .../moon/layers/colorlayers/kaguya_utah.asset | 5 +- .../colorlayers/lola_clr_shade_sweden.asset | 5 +- .../colorlayers/lola_clr_shade_utah.asset | 5 +- .../colorlayers/lola_shade_sweden.asset | 5 +- .../layers/colorlayers/lola_shade_utah.asset | 5 +- .../colorlayers/uvvishybrid_sweden.asset | 5 +- .../layers/colorlayers/uvvishybrid_utah.asset | 5 +- .../moon/layers/colorlayers/wac_sweden.asset | 6 +- .../moon/layers/colorlayers/wac_utah.asset | 5 +- .../layers/heightlayers/loladem_sweden.asset | 5 +- .../layers/heightlayers/loladem_utah.asset | 5 +- .../moon/layers/overlays/size_reference.asset | 2 +- .../solarsystem/planets/earth/moon/moon.asset | 10 +- .../planets/earth/moon/trail.asset | 6 +- .../satellites/communications/amateur.asset | 3 +- .../communications/experimental.asset | 3 +- .../communications/geostationary.asset | 3 +- .../communications/globalstar.asset | 3 +- .../satellites/communications/gorizont.asset | 3 +- .../satellites/communications/intelsat.asset | 3 +- .../satellites/communications/iridium.asset | 3 +- .../communications/iridium_next.asset | 3 +- .../satellites/communications/molniya.asset | 3 +- .../satellites/communications/orbcomm.asset | 3 +- .../communications/other_comm.asset | 3 +- .../satellites/communications/raduga.asset | 3 +- .../earth/satellites/communications/ses.asset | 3 +- .../earth/satellites/debris/debris_asat.asset | 3 +- .../satellites/debris/debris_breezem.asset | 3 +- .../satellites/debris/debris_fengyun.asset | 3 +- .../satellites/debris/debris_iridium33.asset | 3 +- .../satellites/debris/debris_kosmos2251.asset | 3 +- .../debris/volume/cartesian_volume.asset | 2 +- .../debris/volume/spherical_volume.asset | 2 +- .../earth/satellites/misc/brightest.asset | 3 +- .../earth/satellites/misc/cubesats.asset | 3 +- .../planets/earth/satellites/misc/iss.asset | 7 +- .../earth/satellites/misc/military.asset | 3 +- .../planets/earth/satellites/misc/other.asset | 3 +- .../planets/earth/satellites/misc/radar.asset | 3 +- .../earth/satellites/misc/spacestations.asset | 3 +- .../earth/satellites/misc/tle-new.asset | 3 +- .../earth/satellites/navigation/beidou.asset | 3 +- .../earth/satellites/navigation/galileo.asset | 3 +- .../satellites/navigation/glosnass.asset | 3 +- .../earth/satellites/navigation/gps.asset | 3 +- .../earth/satellites/navigation/musson.asset | 3 +- .../earth/satellites/navigation/nnss.asset | 3 +- .../earth/satellites/navigation/sbas.asset | 3 +- .../planets/earth/satellites/satellites.asset | 2 +- .../earth/satellites/satellites_all.asset | 14 +- .../satellites_communications.asset | 26 +- .../earth/satellites/satellites_debris.asset | 10 +- .../satellites/satellites_interesting.asset | 12 +- .../earth/satellites/satellites_misc.asset | 8 +- .../satellites/satellites_navigation.asset | 14 +- .../earth/satellites/satellites_science.asset | 8 +- .../earth/satellites/satellites_weather.asset | 20 +- .../earth/satellites/science/education.asset | 3 +- .../satellites/science/engineering.asset | 3 +- .../earth/satellites/science/geodetic.asset | 3 +- .../earth/satellites/science/spaceearth.asset | 3 +- .../earth/satellites/weather/aqua.asset | 7 +- .../earth/satellites/weather/argos.asset | 3 +- .../earth/satellites/weather/dmc.asset | 3 +- .../satellites/weather/earth_resources.asset | 3 +- .../earth/satellites/weather/goes.asset | 3 +- .../earth/satellites/weather/noaa.asset | 3 +- .../earth/satellites/weather/planet.asset | 3 +- .../earth/satellites/weather/sarsat.asset | 3 +- .../earth/satellites/weather/snpp.asset | 7 +- .../earth/satellites/weather/spire.asset | 3 +- .../earth/satellites/weather/tdrss.asset | 3 +- .../earth/satellites/weather/terra.asset | 7 +- .../earth/satellites/weather/weather.asset | 3 +- .../solarsystem/planets/earth/trail.asset | 4 +- .../planets/earth/transforms.asset | 4 +- .../planets/jupiter/callisto/callisto.asset | 8 +- .../jupiter/callisto/default_layers.asset | 4 +- .../layers/colorlayers/callisto_texture.asset | 2 +- .../planets/jupiter/callisto/trail.asset | 6 +- .../planets/jupiter/europa/europa.asset | 8 +- .../layers/colorlayers/europa_texture.asset | 2 +- .../colorlayers/voyager_global_mosaic.asset | 5 +- .../voyager_global_mosaic_local.asset | 2 +- .../planets/jupiter/europa/trail.asset | 6 +- .../planets/jupiter/ganymede/ganymede.asset | 8 +- .../layers/colorlayers/ganymede_texture.asset | 2 +- .../planets/jupiter/ganymede/trail.asset | 6 +- .../solarsystem/planets/jupiter/io/io.asset | 8 +- .../io/layers/colorlayers/io_texture.asset | 2 +- .../planets/jupiter/io/trail.asset | 6 +- .../solarsystem/planets/jupiter/jupiter.asset | 6 +- .../solarsystem/planets/jupiter/kernels.asset | 4 +- .../layers/colorlayers/jupiter_texture.asset | 2 +- .../planets/jupiter/major_moons.asset | 8 +- .../planets/jupiter/minor/ananke_group.asset | 8 +- .../planets/jupiter/minor/carme_group.asset | 8 +- .../planets/jupiter/minor/carpo_group.asset | 8 +- .../planets/jupiter/minor/himalia_group.asset | 8 +- .../planets/jupiter/minor/inner_group.asset | 8 +- .../planets/jupiter/minor/other_groups.asset | 8 +- .../jupiter/minor/pasiphae_group.asset | 8 +- .../jupiter/minor/themisto_group.asset | 8 +- .../planets/jupiter/minor_moons.asset | 16 +- .../solarsystem/planets/jupiter/trail.asset | 4 +- .../planets/jupiter/trail_earth.asset | 6 +- .../planets/jupiter/transforms.asset | 4 +- .../solarsystem/planets/mars/atmosphere.asset | 4 +- .../planets/mars/default_layers.asset | 50 +- .../layers/colorlayers/ctx_blended_01.asset | 5 +- .../colorlayers/ctx_mosaic_sweden.asset | 5 +- .../layers/colorlayers/ctx_mosaic_utah.asset | 5 +- .../mars/layers/colorlayers/hirise.asset | 5 +- .../mars/layers/colorlayers/hirisels.asset | 5 +- .../layers/colorlayers/mars_texture.asset | 2 +- .../layers/colorlayers/moc_wa_color_liu.asset | 5 +- .../colorlayers/moc_wa_color_utah.asset | 5 +- .../layers/colorlayers/mola_hrsc_sweden.asset | 5 +- .../layers/colorlayers/mola_hrsc_utah.asset | 5 +- .../mola_pseudo_color_sweden.asset | 5 +- .../colorlayers/mola_pseudo_color_utah.asset | 5 +- .../colorlayers/themis_ir_day_sweden.asset | 5 +- .../colorlayers/themis_ir_day_utah.asset | 5 +- .../colorlayers/themis_ir_night_sweden.asset | 5 +- .../colorlayers/themis_ir_night_utah.asset | 5 +- .../colorlayers/viking_mdim_sweden.asset | 5 +- .../layers/colorlayers/viking_mdim_utah.asset | 5 +- .../mars/layers/heightlayers/MDEM200M.asset | 5 +- .../mars/layers/heightlayers/hirisels.asset | 5 +- .../layers/heightlayers/mola_europe.asset | 5 +- .../mars/layers/heightlayers/mola_utah.asset | 5 +- .../mars/layers/overlays/indices.asset | 2 +- .../mars/layers/overlays/size_reference.asset | 2 +- .../scene/solarsystem/planets/mars/mars.asset | 6 +- .../planets/mars/moons/deimos.asset | 9 +- .../layers/colorlayers/deimos_viking.asset | 2 +- .../layers/colorlayers/phobos_viking.asset | 2 +- .../planets/mars/moons/phobos.asset | 9 +- .../solarsystem/planets/mars/trail.asset | 4 +- .../planets/mars/trail_earth.asset | 6 +- .../solarsystem/planets/mars/transforms.asset | 4 +- .../planets/mercury/default_layers.asset | 48 +- .../layers/colorlayers/alsimap_02122015.asset | 2 +- .../layers/colorlayers/casimap_02122015.asset | 2 +- .../layers/colorlayers/fesimap_02122015.asset | 2 +- .../colorlayers/messenger_bdr_sweden.asset | 5 +- .../colorlayers/messenger_bdr_utah.asset | 7 +- .../colorlayers/messenger_hie_sweden.asset | 5 +- .../colorlayers/messenger_hie_utah.asset | 5 +- .../colorlayers/messenger_hiw_sweden.asset | 5 +- .../colorlayers/messenger_hiw_utah.asset | 5 +- .../colorlayers/messenger_loi_sweden.asset | 5 +- .../colorlayers/messenger_loi_utah.asset | 5 +- .../colorlayers/messenger_mdis_sweden.asset | 5 +- .../colorlayers/messenger_mdis_utah.asset | 5 +- .../colorlayers/messenger_mdr_utah.asset | 5 +- .../messenger_mosaic2_sweden.asset | 5 +- .../colorlayers/messenger_mosaic2_utah.asset | 5 +- .../colorlayers/messenger_mosaic_sweden.asset | 5 +- .../colorlayers/messenger_mosaic_utah.asset | 5 +- .../colorlayers/messenger_mp3_utah.asset | 5 +- .../colorlayers/messenger_shade_sweden.asset | 5 +- .../colorlayers/messenger_shade_utah.asset | 5 +- .../layers/colorlayers/mgsimap_02122015.asset | 2 +- .../layers/colorlayers/ssimap_02122015.asset | 2 +- .../solarsystem/planets/mercury/mercury.asset | 7 +- .../solarsystem/planets/mercury/trail.asset | 4 +- .../planets/mercury/trail_earth.asset | 6 +- .../planets/mercury/transforms.asset | 4 +- .../planets/neptune/default_layers.asset | 4 +- .../planets/neptune/inner_moons.asset | 8 +- .../neptune/irregular_prograde_moons.asset | 8 +- .../neptune/irregular_retrograde_moons.asset | 8 +- .../solarsystem/planets/neptune/kernels.asset | 8 +- .../layers/colorlayers/neptune_texture.asset | 2 +- .../planets/neptune/major_moons.asset | 2 +- .../planets/neptune/minor_moons.asset | 6 +- .../solarsystem/planets/neptune/neptune.asset | 6 +- .../solarsystem/planets/neptune/trail.asset | 4 +- .../planets/neptune/trail_earth.asset | 6 +- .../planets/neptune/transforms.asset | 4 +- .../solarsystem/planets/neptune/triton.asset | 8 +- .../scene/solarsystem/planets/planets.asset | 46 +- .../planets/saturn/default_layers.asset | 4 +- .../planets/saturn/dione/default_layers.asset | 4 +- .../planets/saturn/dione/dione.asset | 8 +- .../layers/colorlayers/dione_texture.asset | 2 +- .../planets/saturn/dione/trail.asset | 6 +- .../saturn/enceladus/default_layers.asset | 6 +- .../planets/saturn/enceladus/enceladus.asset | 8 +- .../colorlayers/enceladus_texture.asset | 2 +- .../colorlayers/global_mosaic_100m_hpf.asset | 5 +- .../planets/saturn/enceladus/trail.asset | 6 +- .../saturn/hyperion/default_layers.asset | 2 - .../planets/saturn/hyperion/hyperion.asset | 8 +- .../planets/saturn/hyperion/trail.asset | 6 +- .../saturn/iapetus/default_layers.asset | 4 +- .../planets/saturn/iapetus/iapetus.asset | 8 +- .../layers/colorlayers/iapetus_texture.asset | 2 +- .../planets/saturn/iapetus/trail.asset | 6 +- .../solarsystem/planets/saturn/kernels.asset | 8 +- .../layers/colorlayers/saturn_texture.asset | 2 +- .../planets/saturn/major_moons.asset | 18 +- .../planets/saturn/mimas/default_layers.asset | 4 +- .../layers/colorlayers/mimas_texture.asset | 2 +- .../planets/saturn/mimas/mimas.asset | 8 +- .../planets/saturn/mimas/trail.asset | 6 +- .../planets/saturn/minor/gallic_group.asset | 8 +- .../planets/saturn/minor/inuit_group.asset | 8 +- .../planets/saturn/minor/norse_group.asset | 8 +- .../planets/saturn/minor/other_group.asset | 8 +- .../planets/saturn/minor_moons.asset | 8 +- .../planets/saturn/rhea/default_layers.asset | 4 +- .../layers/colorlayers/rhea_texture.asset | 2 +- .../planets/saturn/rhea/rhea.asset | 8 +- .../planets/saturn/rhea/trail.asset | 6 +- .../solarsystem/planets/saturn/saturn.asset | 6 +- .../saturn/tethys/default_layers.asset | 4 +- .../layers/colorlayers/tethys_texture.asset | 2 +- .../planets/saturn/tethys/tethys.asset | 8 +- .../planets/saturn/tethys/trail.asset | 6 +- .../planets/saturn/titan/atmosphere.asset | 4 +- .../planets/saturn/titan/default_layers.asset | 4 +- .../cassini_iss_global_mosaic_4km_liu.asset | 5 +- .../cassini_iss_global_mosaic_4km_local.asset | 2 +- .../planets/saturn/titan/titan.asset | 8 +- .../planets/saturn/titan/trail.asset | 6 +- .../solarsystem/planets/saturn/trail.asset | 4 +- .../planets/saturn/trail_earth.asset | 6 +- .../planets/saturn/transforms.asset | 4 +- .../planets/uranus/default_layers.asset | 4 +- .../planets/uranus/inner_moons.asset | 8 +- .../uranus/irregular_prograde_moons.asset | 8 +- .../uranus/irregular_retrograde_moons.asset | 8 +- .../layers/colorlayers/uranus_texture.asset | 2 +- .../planets/uranus/major_moons.asset | 8 +- .../planets/uranus/minor_moons.asset | 6 +- .../solarsystem/planets/uranus/trail.asset | 4 +- .../planets/uranus/trail_earth.asset | 6 +- .../planets/uranus/transforms.asset | 4 +- .../solarsystem/planets/uranus/uranus.asset | 6 +- .../planets/venus/atmosphere.asset | 4 +- .../planets/venus/default_layers.asset | 9 +- .../colorlayers/magellan_mosaic_utah.asset | 5 +- .../layers/colorlayers/venus_texture.asset | 2 +- .../venus/layers/heightlayers/magellan.asset | 5 +- .../solarsystem/planets/venus/trail.asset | 4 +- .../planets/venus/trail_earth.asset | 6 +- .../planets/venus/transforms.asset | 4 +- .../solarsystem/planets/venus/venus.asset | 6 +- .../solarsystem/sssb/amor_asteroid.asset | 10 +- .../solarsystem/sssb/apollo_asteroid.asset | 10 +- .../scene/solarsystem/sssb/astraea.asset | 4 +- .../solarsystem/sssb/aten_asteroid.asset | 10 +- .../solarsystem/sssb/atira_asteroid.asset | 10 +- .../scene/solarsystem/sssb/c2019y4atlas.asset | 8 +- .../solarsystem/sssb/centaur_asteroid.asset | 10 +- .../solarsystem/sssb/chiron-type_comet.asset | 10 +- .../solarsystem/sssb/encke-type_comet.asset | 10 +- .../solarsystem/sssb/halley-type_comet.asset | 10 +- .../sssb/inner_main_belt_asteroid.asset | 10 +- .../sssb/jupiter-family_comet.asset | 10 +- .../sssb/jupiter_trojan_asteroid.asset | 10 +- .../solarsystem/sssb/main_belt_asteroid.asset | 10 +- .../sssb/mars-crossing_asteroid.asset | 10 +- .../sssb/outer_main_belt_asteroid.asset | 10 +- data/assets/scene/solarsystem/sssb/pha.asset | 10 +- .../scene/solarsystem/sssb/sssb_shared.asset | 4 +- .../scene/solarsystem/sssb/swifttuttle.asset | 4 +- .../solarsystem/sssb/tesla_roadster.asset | 4 +- .../sssb/transneptunian_object_asteroid.asset | 10 +- data/assets/scene/solarsystem/sun.asset | 4 +- .../scene/solarsystem/sun/EUV_layer.asset | 2 +- .../solarsystem/sun/default_layers.asset | 4 +- .../scene/solarsystem/sun/habitablezone.asset | 4 +- .../sun/layers/colorlayers/sun_texture.asset | 2 +- .../sun/transforms_heliosphere.asset | 2 +- data/assets/util/add_marker.asset | 4 +- data/assets/util/asset_helper.asset | 6 +- data/assets/util/default_keybindings.asset | 26 +- data/assets/util/generate_bookmarks.asset | 32 +- data/assets/util/ipac.asset | 16 +- data/assets/util/joysticks/ps4.asset | 26 +- .../joysticks/space-mouse-not-sticky.asset | 4 +- data/assets/util/joysticks/space-mouse.asset | 4 +- data/assets/util/joysticks/xbox.asset | 26 +- .../util/lua_state_machine_helper.asset | 2 +- data/assets/util/procedural_globe.asset | 2 +- data/assets/util/property_helper.asset | 22 +- data/assets/util/renderable_helper.asset | 8 +- .../assets/util/script_scheduler_helper.asset | 6 +- data/assets/util/slide_deck_helper.asset | 14 +- data/assets/util/streamnodes_textures.asset | 8 - data/assets/util/testing_keybindings.asset | 2 +- data/assets/util/tle_helper.asset | 14 +- data/assets/util/vrt_flipbook_helper.asset | 7 +- data/assets/util/webgui.asset | 16 +- 522 files changed, 2557 insertions(+), 2679 deletions(-) delete mode 100644 data/assets/examples/basic.scene delete mode 100644 data/assets/scene/digitaluniverse/backgroundradiation_textures.asset delete mode 100644 data/assets/scene/digitaluniverse/milkyway_data.asset delete mode 100644 data/assets/scene/digitaluniverse/stars_colormap.asset delete mode 100644 data/assets/scene/digitaluniverse/stars_textures.asset delete mode 100644 data/assets/util/streamnodes_textures.asset diff --git a/data/assets/base.asset b/data/assets/base.asset index d80f40934f..5f71d4896e 100644 --- a/data/assets/base.asset +++ b/data/assets/base.asset @@ -2,69 +2,67 @@ -- loading this scene directly without any other elements added on top of it will -- probably not work -asset.require('./base_blank') +asset.require("./base_blank") -- Specifying which other assets should be loaded in this scene -asset.require('scene/solarsystem/sun/sun') -asset.require('scene/solarsystem/sun/glare') -asset.require('scene/solarsystem/sun/habitablezone') -asset.require('scene/solarsystem/sun/default_layers') -asset.require('scene/solarsystem/planets/planets') -asset.require('scene/solarsystem/planets/default_layers') -asset.require('scene/solarsystem/dwarf_planets/pluto/system') -asset.require('scene/solarsystem/dwarf_planets/pluto/default_layers') -asset.require('scene/solarsystem/dwarf_planets/pluto/charon/default_layers') -asset.require('scene/milkyway/milkyway/volume') -asset.require('scene/milkyway/constellations/constellation_art') -asset.require('scene/milkyway/constellations/constellation_keybinds') -asset.require('scene/milkyway/objects/orionnebula/orionnebula') -asset.require('util/launcher_images') +asset.require("scene/solarsystem/sun/sun") +asset.require("scene/solarsystem/sun/glare") +asset.require("scene/solarsystem/sun/habitablezone") +asset.require("scene/solarsystem/sun/default_layers") +asset.require("scene/solarsystem/planets/planets") +asset.require("scene/solarsystem/planets/default_layers") +asset.require("scene/solarsystem/dwarf_planets/pluto/system") +asset.require("scene/solarsystem/dwarf_planets/pluto/default_layers") +asset.require("scene/solarsystem/dwarf_planets/pluto/charon/default_layers") +asset.require("scene/milkyway/milkyway/volume") +asset.require("scene/milkyway/constellations/constellation_art") +asset.require("scene/milkyway/constellations/constellation_keybinds") +asset.require("scene/milkyway/objects/orionnebula/orionnebula") +asset.require("util/launcher_images") -- For exoplanet system visualizations -asset.require('scene/milkyway/exoplanets/exoplanets_data') -asset.require('scene/milkyway/exoplanets/exoplanets_textures') +asset.require("scene/milkyway/exoplanets/exoplanets_data") +asset.require("scene/milkyway/exoplanets/exoplanets_textures") -local assetHelper = asset.require('util/asset_helper') -asset.require('scene/digitaluniverse/2dF') -asset.require('scene/digitaluniverse/2mass') -asset.require('scene/digitaluniverse/6dF') -asset.require('scene/digitaluniverse/abell') -asset.require('scene/digitaluniverse/alternatestarlabels') -asset.require('scene/digitaluniverse/backgroundradiation') --- asset.require('scene/digitaluniverse/backgroundradiation_multiverse') -asset.require('scene/digitaluniverse/clusters') -asset.require('scene/digitaluniverse/constellationbounds') -asset.require('scene/digitaluniverse/constellations') -asset.require('scene/digitaluniverse/deepsky') -asset.require('scene/digitaluniverse/dwarfs') -asset.require('scene/digitaluniverse/exoplanets') -asset.require('scene/digitaluniverse/globularclusters') -asset.require('scene/digitaluniverse/grids') -asset.require('scene/digitaluniverse/groups') -asset.require('scene/digitaluniverse/h2regions') -asset.require('scene/digitaluniverse/kepler') -asset.require('scene/digitaluniverse/localdwarfs') -asset.require('scene/digitaluniverse/milkyway') -asset.require('scene/digitaluniverse/milkyway_arm_labels') -asset.require('scene/digitaluniverse/milkyway_data') -asset.require('scene/digitaluniverse/milkyway_label') -asset.require('scene/digitaluniverse/milkyway_sphere') -asset.require('scene/digitaluniverse/obassociations') -asset.require('scene/digitaluniverse/openclusters') -asset.require('scene/digitaluniverse/planetarynebulae') -asset.require('scene/digitaluniverse/pulsars') -asset.require('scene/digitaluniverse/quasars') -asset.require('scene/digitaluniverse/sdss') -asset.require('scene/digitaluniverse/starlabels') -asset.require('scene/digitaluniverse/starorbits') -asset.require('scene/digitaluniverse/stars') -asset.require('scene/digitaluniverse/superclusters') -asset.require('scene/digitaluniverse/supernovaremnants') -asset.require('scene/digitaluniverse/tully') -asset.require('scene/digitaluniverse/voids') +local assetHelper = asset.require("util/asset_helper") +asset.require("scene/digitaluniverse/2dF") +asset.require("scene/digitaluniverse/2mass") +asset.require("scene/digitaluniverse/6dF") +asset.require("scene/digitaluniverse/abell") +asset.require("scene/digitaluniverse/alternatestarlabels") +asset.require("scene/digitaluniverse/backgroundradiation") +asset.require("scene/digitaluniverse/clusters") +asset.require("scene/digitaluniverse/constellationbounds") +asset.require("scene/digitaluniverse/constellations") +asset.require("scene/digitaluniverse/deepsky") +asset.require("scene/digitaluniverse/dwarfs") +asset.require("scene/digitaluniverse/exoplanets") +asset.require("scene/digitaluniverse/globularclusters") +asset.require("scene/digitaluniverse/grids") +asset.require("scene/digitaluniverse/groups") +asset.require("scene/digitaluniverse/h2regions") +asset.require("scene/digitaluniverse/kepler") +asset.require("scene/digitaluniverse/localdwarfs") +asset.require("scene/digitaluniverse/milkyway") +asset.require("scene/digitaluniverse/milkyway_arm_labels") +asset.require("scene/digitaluniverse/milkyway_label") +asset.require("scene/digitaluniverse/milkyway_sphere") +asset.require("scene/digitaluniverse/obassociations") +asset.require("scene/digitaluniverse/openclusters") +asset.require("scene/digitaluniverse/planetarynebulae") +asset.require("scene/digitaluniverse/pulsars") +asset.require("scene/digitaluniverse/quasars") +asset.require("scene/digitaluniverse/sdss") +asset.require("scene/digitaluniverse/starlabels") +asset.require("scene/digitaluniverse/starorbits") +asset.require("scene/digitaluniverse/stars") +asset.require("scene/digitaluniverse/superclusters") +asset.require("scene/digitaluniverse/supernovaremnants") +asset.require("scene/digitaluniverse/tully") +asset.require("scene/digitaluniverse/voids") -asset.require('customization/globebrowsing') +asset.require("customization/globebrowsing") asset.onInitialize(function () openspace.globebrowsing.loadWMSServersFromFile( diff --git a/data/assets/base_blank.asset b/data/assets/base_blank.asset index 6c47bea5d9..ce7bb1ef01 100644 --- a/data/assets/base_blank.asset +++ b/data/assets/base_blank.asset @@ -1,23 +1,28 @@ -- This is a blank scene that that just sets up the default menus/dasboard/keys, etc. -local assetHelper = asset.require('util/asset_helper') -local propertyHelper = asset.require('util/property_helper') +local assetHelper = asset.require("util/asset_helper") +local propertyHelper = asset.require("util/property_helper") -- Specifying which other assets should be loaded in this scene -asset.require('spice/base') +asset.require("spice/base") -- Load default key bindings applicable to most scenes -asset.require('dashboard/default_dashboard') -asset.require('util/default_keybindings') +asset.require("dashboard/default_dashboard") +asset.require("util/default_keybindings") -- Load web gui -local webGui = asset.require('util/webgui') +local webGui = asset.require("util/webgui") local toggle_trails = { Identifier = "os_default.toggle_trails", Name = "Toggle Trails", - Command = "local list = openspace.getProperty('{planetTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end\n" .. - "local moonlist = openspace.getProperty('{moonTrail_solarSystem}.Renderable.Enabled'); for _,v in pairs(moonlist) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end", + Command = [[ + local list = openspace.getProperty("{planetTrail_solarSystem}.Renderable.Enabled"); + for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end + + local moonlist = openspace.getProperty("{moonTrail_solarSystem}.Renderable.Enabled"); + for _,v in pairs(moonlist) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end + ]], Documentation = "Toggles the visibility of planet and moon trails", GuiPath = "/Rendering", IsLocal = false, @@ -28,7 +33,10 @@ local toggle_trails = { local toggle_planet_labels = { Identifier = "os_default.toggle_planet_labels", Name = "Toggle planet labels", - Command = "local list = openspace.getProperty('{solarsystem_labels}.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end", + Command = [[ + local list = openspace.getProperty("{solarsystem_labels}.Renderable.Enabled"); + for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end + ]], Documentation = "Turns on visibility for all solar system labels", GuiPath = "/Rendering", IsLocal = false, diff --git a/data/assets/customization/globebrowsing.asset b/data/assets/customization/globebrowsing.asset index fe03f650af..e1307229d4 100644 --- a/data/assets/customization/globebrowsing.asset +++ b/data/assets/customization/globebrowsing.asset @@ -4,7 +4,7 @@ local CreateFocusNodes = false local AddMarsLayers = true local AddMoonLayers = true local AddMercuryLayers = true -local DataFolder = openspace.absPath('${BASE}/../OpenSpaceData') +local DataFolder = openspace.absPath("${BASE}/../OpenSpaceData") ---------------------------------------- -- If you add layers for different planets than listed here, be sure to add an @@ -23,61 +23,61 @@ local vrt_folders = { -- CTX will stomp over the HiRISE. -- tl;dr: Specify CTX folders first, then HiRISE - -- example: 'C:/OpenSpace/GlobeBrowsingData/Mars/CTX' + -- example: "C:/OpenSpace/GlobeBrowsingData/Mars/CTX" -- We recommend using this folder for CTX - DataFolder .. '/Mars/CTX', + DataFolder .. "/Mars/CTX", -- if not and you have a custom path for CTX layers, enter it below - '', + "", -- We recommend using this folder for HiRISE - DataFolder .. '/Mars/HiRISE', + DataFolder .. "/Mars/HiRISE", -- if not and you have a custom path for HiRISE layers, enter it below - '' + "" }, Moon = { -- Add folders here whose contents will be automatically added to the Moon globe -- If multiple folders are added, the results will be added sequentially, meaning that -- if areas overlap, images from the lower results will overwrite the images from former -- results - -- example: 'C:/OpenSpace/GlobeBrowsingData/Moon' - DataFolder .. '/Moon', - DataFolder .. '/Apollo', - '' + -- example: "C:/OpenSpace/GlobeBrowsingData/Moon" + DataFolder .. "/Moon", + DataFolder .. "/Apollo", + "" }, Mercury = { -- Add folders here whose contents will be automatically added to the Mercury globe -- If multiple folders are added, the results will be added sequentially, meaning that -- if areas overlap, images from the lower results will overwrite the images from former -- results - -- example: 'C:/OpenSpace/GlobeBrowsingData/Mercury' - DataFolder .. '/Mercury', - '' + -- example: "C:/OpenSpace/GlobeBrowsingData/Mercury" + DataFolder .. "/Mercury", + "" } } -- Add require statements for assets exporting the neccessary globes -- here we add Mars, Moon and Mercury: if AddMarsLayers then - asset.require('../scene/solarsystem/planets/mars/mars') + asset.require("../scene/solarsystem/planets/mars/mars") else - vrt_folders['Mars'] = nil + vrt_folders["Mars"] = nil end if AddMoonLayers then - asset.require('../scene/solarsystem/planets/earth/moon/moon') + asset.require("../scene/solarsystem/planets/earth/moon/moon") else - vrt_folders['Moon'] = nil + vrt_folders["Moon"] = nil end if AddMercuryLayers then - asset.require('../scene/solarsystem/planets/mercury/mercury') + asset.require("../scene/solarsystem/planets/mercury/mercury") else - vrt_folders['Mercury'] = nil + vrt_folders["Mercury"] = nil end asset.onInitialize(function () -- Add local patches described at the top of this file for obj, list in pairs(vrt_folders) do for _, dir in pairs(list) do - if (dir ~= '') then + if (dir ~= "") then openspace.globebrowsing.addBlendingLayersFromDirectory(dir, obj) if CreateFocusNodes then diff --git a/data/assets/dashboard/default_dashboard.asset b/data/assets/dashboard/default_dashboard.asset index af524db703..453895ab4e 100644 --- a/data/assets/dashboard/default_dashboard.asset +++ b/data/assets/dashboard/default_dashboard.asset @@ -1,8 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') - -asset.require('./date') -asset.require('./simulationincrement') -asset.require('./distance') -asset.require('./framerate') -asset.require('./parallelconnection') -asset.require('./globelocation') +asset.require("./date") +asset.require("./simulationincrement") +asset.require("./distance") +asset.require("./framerate") +asset.require("./parallelconnection") +asset.require("./globelocation") diff --git a/data/assets/events/toggle_trail.asset b/data/assets/events/toggle_trail.asset index 2e397ed7d8..803885cf73 100644 --- a/data/assets/events/toggle_trail.asset +++ b/data/assets/events/toggle_trail.asset @@ -1,4 +1,4 @@ -local action = asset.require('actions/toggle_trail') +local action = asset.require("actions/toggle_trail") asset.onInitialize(function() openspace.event.registerEventAction( diff --git a/data/assets/examples/animation.asset b/data/assets/examples/animation.asset index 2f5bf38af2..e9081f483b 100644 --- a/data/assets/examples/animation.asset +++ b/data/assets/examples/animation.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") local model = asset.syncedResource({ Name = "Animated Box", diff --git a/data/assets/examples/approachevents.asset b/data/assets/examples/approachevents.asset index ee68a34667..73914e12f5 100644 --- a/data/assets/examples/approachevents.asset +++ b/data/assets/examples/approachevents.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") local generic_action = { Identifier = "os.example.generic", diff --git a/data/assets/examples/basic.scene b/data/assets/examples/basic.scene deleted file mode 100644 index a4ca571d1b..0000000000 --- a/data/assets/examples/basic.scene +++ /dev/null @@ -1,25 +0,0 @@ -local assetHelper = asset.require('util/asset_helper') -local propertyHelper = asset.require('util/property_helper') -local debugHelper = asset.require('util/debug_helper') - --- At this point, a scene needs basic spice data to load. -asset.require('spice/base') - -asset.require('util/default_keybindings') -asset.require('util/default_dashboard') - -asset.require('util/webgui') -local spheres = asset.require('examples/spheres') - -debugHelper.registerCartesianAxes(asset, { - Parent = "Root", - Scale = 10 -}) - -asset.onInitialize(function () - openspace.navigation.setNavigationState({ - Anchor = "Root", - Position = { 20, 20, 20 }, - Up = {0, 1, 0}, - }) -end) diff --git a/data/assets/examples/dashboarditems.asset b/data/assets/examples/dashboarditems.asset index f76fe2e7a0..056fa1f2ff 100644 --- a/data/assets/examples/dashboarditems.asset +++ b/data/assets/examples/dashboarditems.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") assetHelper.registerDashboardItems(asset, { { diff --git a/data/assets/examples/debugcoordinateaxes.asset b/data/assets/examples/debugcoordinateaxes.asset index 84932ea4a1..defae46505 100644 --- a/data/assets/examples/debugcoordinateaxes.asset +++ b/data/assets/examples/debugcoordinateaxes.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local debugHelper = asset.require('util/debug_helper') -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local debugHelper = asset.require("util/debug_helper") +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") local sunRadius = 6.957E8 local earthRadius = 6.371E6 diff --git a/data/assets/examples/discs.asset b/data/assets/examples/discs.asset index 9bb583e96d..417edbc2aa 100644 --- a/data/assets/examples/discs.asset +++ b/data/assets/examples/discs.asset @@ -1,8 +1,8 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") -- @TODO (emmbr 2020-02-03) Potential threading issue later on? This will run on the main thread -local cyanTexture = openspace.createSingleColorImage("example_disc_color1", {0.0, 1.0, 1.0}) -local purpleTexture = openspace.createSingleColorImage("example_disc_color2", {0.5, 0.0, 0.5}) +local cyanTexture = openspace.createSingleColorImage("example_disc_color1", { 0.0, 1.0, 1.0 }) +local purpleTexture = openspace.createSingleColorImage("example_disc_color2", { 0.5, 0.0, 0.5 }) local BasicDisc = { Identifier = "BasicDisc", @@ -25,7 +25,7 @@ local FullEllipticDisc = { Transform = { Scale = { Type = "NonUniformStaticScale", - Scale = {2.0, 1.0, 1.0} + Scale = { 2.0, 1.0, 1.0 } } }, Renderable = { diff --git a/data/assets/examples/globerotation.asset b/data/assets/examples/globerotation.asset index c59332b311..6fb45e38c4 100644 --- a/data/assets/examples/globerotation.asset +++ b/data/assets/examples/globerotation.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local earth = asset.require('scene/solarsystem/planets/earth/earth') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local earth = asset.require("scene/solarsystem/planets/earth/earth") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local models = asset.syncedResource({ Name = "New Horizons Model", diff --git a/data/assets/examples/globetranslation.asset b/data/assets/examples/globetranslation.asset index a49af06d09..b67d97c126 100644 --- a/data/assets/examples/globetranslation.asset +++ b/data/assets/examples/globetranslation.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local earth = asset.require('scene/solarsystem/planets/earth/earth') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local earth = asset.require("scene/solarsystem/planets/earth/earth") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local models = asset.syncedResource({ Name = "New Horizons Model", diff --git a/data/assets/examples/grids.asset b/data/assets/examples/grids.asset index 37ebad89e2..6cc70afc8a 100644 --- a/data/assets/examples/grids.asset +++ b/data/assets/examples/grids.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper) local scale = 149597870700 -- 1 AU diff --git a/data/assets/examples/joystickProperty.asset b/data/assets/examples/joystickProperty.asset index a5aedceace..04088a783a 100644 --- a/data/assets/examples/joystickProperty.asset +++ b/data/assets/examples/joystickProperty.asset @@ -55,7 +55,7 @@ local XBoxController = { local freezeValue = function(name, axis, min, max) return [[ - local joystickType = openspace.navigation.joystickAxis(']] .. name .. "', " .. axis .. [[); + local joystickType = openspace.navigation.joystickAxis("]] .. name .. [[", ]] .. axis .. [[); local isPropertyBound = true; if joystickType == "None" then isPropertyBound = false; @@ -64,10 +64,10 @@ local freezeValue = function(name, axis, min, max) end if isPropertyBound then - openspace.navigation.bindJoystickAxis(']] .. name .. "', " .. axis .. [[, "None"); + openspace.navigation.bindJoystickAxis("]] .. name .. [[", ]] .. axis .. [[, "None"); isPropertyBound = false; else - openspace.navigation.bindJoystickAxisProperty(']] .. name .. "', " .. axis .. [[, 'Scene.Earth.Scale.Scale', ]] .. min ..", " .. max.. [[); + openspace.navigation.bindJoystickAxisProperty("]] .. name .. [[", ]] .. axis .. [[, "Scene.Earth.Scale.Scale", ]] .. min ..", " .. max.. [[); isPropertyBound = true; end ]] diff --git a/data/assets/examples/luastatemachine.asset b/data/assets/examples/luastatemachine.asset index 45ce5bb29a..788be31a4d 100644 --- a/data/assets/examples/luastatemachine.asset +++ b/data/assets/examples/luastatemachine.asset @@ -1,4 +1,4 @@ -local stateMachineHelper = asset.require('util/lua_state_machine_helper') +local stateMachineHelper = asset.require("util/lua_state_machine_helper") local states = { { @@ -35,13 +35,13 @@ end asset.onInitialize(function () stateMachine = stateMachineHelper.createStateMachine(states) - openspace.bindKey('RIGHT', 'next()') - openspace.bindKey('LEFT', 'previous()') + openspace.bindKey("RIGHT", "next()") + openspace.bindKey("LEFT", "previous()") end) asset.onDeinitialize(function () stateMachine = nil - openspace.clearKey('RIGHT') - openspace.clearKey('LEFT') + openspace.clearKey("RIGHT") + openspace.clearKey("LEFT") end) diff --git a/data/assets/examples/modelshader/modelshader.asset b/data/assets/examples/modelshader/modelshader.asset index fa5cea97a7..60789a9d7e 100644 --- a/data/assets/examples/modelshader/modelshader.asset +++ b/data/assets/examples/modelshader/modelshader.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") local model = asset.syncedResource({ Name = "Animated Box", diff --git a/data/assets/examples/primitives.asset b/data/assets/examples/primitives.asset index 23a64b1a0b..1965552a95 100644 --- a/data/assets/examples/primitives.asset +++ b/data/assets/examples/primitives.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local scale = 149597870700 -- 1 AU diff --git a/data/assets/examples/screenspacebrowser.asset b/data/assets/examples/screenspacebrowser.asset index 282465848c..d6c18eb62a 100644 --- a/data/assets/examples/screenspacebrowser.asset +++ b/data/assets/examples/screenspacebrowser.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local spec = { Type = "ScreenSpaceBrowser", diff --git a/data/assets/examples/slidedeck.asset b/data/assets/examples/slidedeck.asset index 885dabb3b8..7765a9b8bd 100644 --- a/data/assets/examples/slidedeck.asset +++ b/data/assets/examples/slidedeck.asset @@ -1,4 +1,4 @@ -local helper = asset.require('util/slide_deck_helper') +local helper = asset.require("util/slide_deck_helper") local deck = nil asset.onInitialize(function () diff --git a/data/assets/examples/spheres.asset b/data/assets/examples/spheres.asset index c3734d8d75..ed56b5c300 100644 --- a/data/assets/examples/spheres.asset +++ b/data/assets/examples/spheres.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local i = 1 for z=1,3 do diff --git a/data/assets/examples/statemachine.asset b/data/assets/examples/statemachine.asset index bbc41055f1..3cf24c42b7 100644 --- a/data/assets/examples/statemachine.asset +++ b/data/assets/examples/statemachine.asset @@ -6,9 +6,9 @@ local targetNode = function(nodeIdentifier) openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil) openspace.setPropertyValueSingle( "NavigationHandler.OrbitalNavigator.Anchor", - ']] .. nodeIdentifier .. [[' + "]] .. nodeIdentifier .. [[" ) - openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", '') + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", "") ]] end @@ -16,16 +16,16 @@ local states = { { Identifier = "Constellations", Enter = [[ - openspace.setPropertyValueSingle('Scene.Constellations.Renderable.Opacity', 1.0, 1.0) + openspace.setPropertyValueSingle("Scene.Constellations.Renderable.Opacity", 1.0, 1.0) ]], Exit = [[ - openspace.setPropertyValueSingle('Scene.Constellations.Renderable.Opacity', 0.0, 1.0) + openspace.setPropertyValueSingle("Scene.Constellations.Renderable.Opacity", 0.0, 1.0) ]] }, { Identifier = "Earth", - Enter = "openspace.setPropertyValueSingle('Scene.EarthLabel.Renderable.Enabled', true)", - Exit = "openspace.setPropertyValueSingle('Scene.EarthLabel.Renderable.Enabled', false)" + Enter = "openspace.setPropertyValueSingle("Scene.EarthLabel.Renderable.Enabled", true)", + Exit = "openspace.setPropertyValueSingle("Scene.EarthLabel.Renderable.Enabled", false)" }, { Identifier = "Moon" @@ -65,8 +65,8 @@ local transitions = { asset.onInitialize(function() -- Setup (could be done in the profile) - openspace.setPropertyValueSingle('Scene.Constellations.Renderable.Enabled', true) - openspace.setPropertyValueSingle('Scene.Constellations.Renderable.Opacity', 0.0) + openspace.setPropertyValueSingle("Scene.Constellations.Renderable.Enabled", true) + openspace.setPropertyValueSingle("Scene.Constellations.Renderable.Opacity", 0.0) openspace.statemachine.createStateMachine(states, transitions, "Earth") end) diff --git a/data/assets/examples/temperature_land_highres.asset b/data/assets/examples/temperature_land_highres.asset index 0015da8ac8..40b562e1f7 100644 --- a/data/assets/examples/temperature_land_highres.asset +++ b/data/assets/examples/temperature_land_highres.asset @@ -19,7 +19,7 @@ local layer = { "YYYY-MM-DD" .. "" .. path .. "rainbow.png" .. "linear" .. - "" .. path .. "/${OpenSpaceTimeId}-land.png" .. + "" .. path .. "${OpenSpaceTimeId}-land.png" .. "", Description = [[ Temporal coverage: 01 Jan 1981 - 31 Dec 2020.]] } diff --git a/data/assets/examples/volume/generated/cartesian.asset b/data/assets/examples/volume/generated/cartesian.asset index 6561a2a76a..5673b0d869 100644 --- a/data/assets/examples/volume/generated/cartesian.asset +++ b/data/assets/examples/volume/generated/cartesian.asset @@ -4,7 +4,7 @@ -- the volume data itself needs to be generated, -- using the task 'data/tasks/volume/generate_cartesian.task' -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("scene/solarsystem/sun/transforms") local sunRadius = 695508000 diff --git a/data/assets/examples/volume/generated/cartesiansequence.asset b/data/assets/examples/volume/generated/cartesiansequence.asset index 7b341c79f1..537a4bbbc0 100644 --- a/data/assets/examples/volume/generated/cartesiansequence.asset +++ b/data/assets/examples/volume/generated/cartesiansequence.asset @@ -4,7 +4,7 @@ -- the volume data itself needs to be generated, -- using the task 'data/tasks/volume/generate_cartesian_sequence.task' -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("scene/solarsystem/sun/transforms") local sunRadius = 695508000 diff --git a/data/assets/examples/volume/generated/spherical.asset b/data/assets/examples/volume/generated/spherical.asset index 20c7564393..2acb6b9887 100644 --- a/data/assets/examples/volume/generated/spherical.asset +++ b/data/assets/examples/volume/generated/spherical.asset @@ -4,7 +4,7 @@ -- the volume data itself needs to be generated, -- using the task 'data/tasks/volume/generate_spherical.task' -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("scene/solarsystem/sun/transforms") local astronomicalUnit = 149597870700 diff --git a/data/assets/global/localbookmarks.asset b/data/assets/global/localbookmarks.asset index 18fd5b408e..a6727928b5 100644 --- a/data/assets/global/localbookmarks.asset +++ b/data/assets/global/localbookmarks.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local bookmarkHelper = asset.require('util/generate_bookmarks') +local assetHelper = asset.require("util/asset_helper") +local bookmarkHelper = asset.require("util/generate_bookmarks") -local nodes = bookmarkHelper.getBookmarks('Local Bookmarks', '${ASSETS}/customization/localbookmarks.csv') +local nodes = bookmarkHelper.getBookmarks("Local Bookmarks", "${ASSETS}/customization/localbookmarks.csv") assetHelper.registerSceneGraphNodesAndExport(asset, nodes); diff --git a/data/assets/global/openspacebookmarks.asset b/data/assets/global/openspacebookmarks.asset index 1c591050c8..b9780b50b6 100644 --- a/data/assets/global/openspacebookmarks.asset +++ b/data/assets/global/openspacebookmarks.asset @@ -1,12 +1,12 @@ -local assetHelper = asset.require('util/asset_helper') -local bookmarkHelper = asset.require('util/generate_bookmarks') +local assetHelper = asset.require("util/asset_helper") +local bookmarkHelper = asset.require("util/generate_bookmarks") -local dataProvider = 'http://data.openspaceproject.com/files/bookmarks/v1/bookmarks.csv' +local dataProvider = "http://data.openspaceproject.com/files/bookmarks/v1/bookmarks.csv" local bookmarksCSV = asset.syncedResource({ - Identifier = 'openspace_bookmarks', - Name = 'OpenSpace Bookmarks', - Type = 'UrlSynchronization', + Identifier = "openspace_bookmarks", + Name = "OpenSpace Bookmarks", + Type = "UrlSynchronization", UseHash = false, Override = true, Url = dataProvider @@ -15,7 +15,7 @@ local bookmarksCSV = asset.syncedResource({ local nodes = {} asset.onInitialize(function () - nodes = bookmarkHelper.getBookmarks('OpenSpace Bookmarks', bookmarksCSV .. 'bookmarks.csv') + nodes = bookmarkHelper.getBookmarks("OpenSpace Bookmarks", bookmarksCSV .. "bookmarks.csv") for _, n in ipairs(nodes) do openspace.addSceneGraphNode(n); end diff --git a/data/assets/scene/digitaluniverse/2dF.asset b/data/assets/scene/digitaluniverse/2dF.asset index 0c37d3dfec..13cd896ac5 100644 --- a/data/assets/scene/digitaluniverse/2dF.asset +++ b/data/assets/scene/digitaluniverse/2dF.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/2mass.asset b/data/assets/scene/digitaluniverse/2mass.asset index f86ba14f8b..e9ca7bdc7b 100644 --- a/data/assets/scene/digitaluniverse/2mass.asset +++ b/data/assets/scene/digitaluniverse/2mass.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/6dF.asset b/data/assets/scene/digitaluniverse/6dF.asset index c58ebe8bf4..3b61dd0221 100644 --- a/data/assets/scene/digitaluniverse/6dF.asset +++ b/data/assets/scene/digitaluniverse/6dF.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/abell.asset b/data/assets/scene/digitaluniverse/abell.asset index a4b7395a11..c6be3a84c3 100644 --- a/data/assets/scene/digitaluniverse/abell.asset +++ b/data/assets/scene/digitaluniverse/abell.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") @@ -23,7 +23,7 @@ local object = { Enabled = false, Color = { 1.0, 0.4, 0.2 }, Opacity = 1.0, - --ColorMap = speck .. "/abell.cmap", + --ColorMap = speck .. "abell.cmap", File = speck .. "abell.speck", Texture = textures .. "point3A.png", LabelFile = speck .. "abell.label", diff --git a/data/assets/scene/digitaluniverse/alternatestarlabels.asset b/data/assets/scene/digitaluniverse/alternatestarlabels.asset index 23d6a5f50d..b01cad1fe1 100644 --- a/data/assets/scene/digitaluniverse/alternatestarlabels.asset +++ b/data/assets/scene/digitaluniverse/alternatestarlabels.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/backgroundradiation.asset b/data/assets/scene/digitaluniverse/backgroundradiation.asset index 72d77bb0fb..b49e753be1 100644 --- a/data/assets/scene/digitaluniverse/backgroundradiation.asset +++ b/data/assets/scene/digitaluniverse/backgroundradiation.asset @@ -1,5 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local textures = asset.require('./backgroundradiation_textures').textures +local assetHelper = asset.require("util/asset_helper") + + local speck = asset.syncedResource({ Name = "Background Radiation Speck Files", @@ -8,12 +9,19 @@ local speck = asset.syncedResource({ Version = 1 }) +local textures = asset.syncedResource({ + Name = "Background Radiation Textures", + Type = "HttpSynchronization", + Identifier = "digitaluniverse_backgroundradiation_textures", + Version = 2 +}) + local wmap = { Identifier = "WMAP", Transform = { Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, Renderable = { @@ -39,7 +47,7 @@ local cbe = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, Renderable = { @@ -65,7 +73,7 @@ local planck = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, Renderable = { @@ -92,7 +100,7 @@ local Halpha = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = {0, 0, 3.14159265359} + Rotation = { 0, 0, math.pi } } }, Renderable = { diff --git a/data/assets/scene/digitaluniverse/backgroundradiation_multiverse.asset b/data/assets/scene/digitaluniverse/backgroundradiation_multiverse.asset index bc54679e0b..51560008fe 100644 --- a/data/assets/scene/digitaluniverse/backgroundradiation_multiverse.asset +++ b/data/assets/scene/digitaluniverse/backgroundradiation_multiverse.asset @@ -1,16 +1,24 @@ -local assetHelper = asset.require('util/asset_helper') -local textures = asset.require('./backgroundradiation_textures').textures +local assetHelper = asset.require("util/asset_helper") + + + +local textures = asset.syncedResource({ + Name = "Background Radiation Textures", + Type = "HttpSynchronization", + Identifier = "digitaluniverse_backgroundradiation_textures", + Version = 2 +}) local multiverse_planck_1 = { Identifier = "PlanckMultiverse1", Transform = { Translation = { Type = "StaticTranslation", - Position = { 0.0, 0.0, 2000E23} + Position = { 0.0, 0.0, 2000E23 } }, Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, Renderable = { @@ -19,7 +27,7 @@ local multiverse_planck_1 = { Size = 3975.41417036064E23, Segments = 80, Opacity = 0.3, - Texture = textures .. "/cmb4k.jpg", + Texture = textures .. "cmb4k.jpg", Orientation = "Both", MirrorTexture = true, UseAdditiveBlending = true, @@ -40,7 +48,7 @@ local multiverse_planck_2 = { }, Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, Renderable = { @@ -49,7 +57,7 @@ local multiverse_planck_2 = { Size = 3975.41417036064E23, Segments = 80, Opacity = 0.3, - Texture = textures .. "/cmb4k.jpg", + Texture = textures .. "cmb4k.jpg", Orientation = "Both", MirrorTexture = true, UseAdditiveBlending = true, @@ -70,7 +78,7 @@ local multiverse_planck_3 = { }, Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, Renderable = { @@ -79,7 +87,7 @@ local multiverse_planck_3 = { Size = 3975.41417036064E23, Segments = 80, Opacity = 0.3, - Texture = textures .. "/cmb4k.jpg", + Texture = textures .. "cmb4k.jpg", Orientation = "Both", MirrorTexture = true, UseAdditiveBlending = true, @@ -100,7 +108,7 @@ local multiverse_planck_4 = { }, Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, Renderable = { @@ -109,7 +117,7 @@ local multiverse_planck_4 = { Size = 3975.41417036064E23, Segments = 80, Opacity = 0.3, - Texture = textures .. "/cmb4k.jpg", + Texture = textures .. "cmb4k.jpg", Orientation = "Both", MirrorTexture = true, UseAdditiveBlending = true, diff --git a/data/assets/scene/digitaluniverse/backgroundradiation_textures.asset b/data/assets/scene/digitaluniverse/backgroundradiation_textures.asset deleted file mode 100644 index dd268d2165..0000000000 --- a/data/assets/scene/digitaluniverse/backgroundradiation_textures.asset +++ /dev/null @@ -1,8 +0,0 @@ -local textures = asset.syncedResource({ - Name = "Background Radiation Textures", - Type = "HttpSynchronization", - Identifier = "digitaluniverse_backgroundradiation_textures", - Version = 2 -}) - -asset.export('textures', textures) diff --git a/data/assets/scene/digitaluniverse/clusters.asset b/data/assets/scene/digitaluniverse/clusters.asset index 5f6c4835f1..0e8cae16ff 100644 --- a/data/assets/scene/digitaluniverse/clusters.asset +++ b/data/assets/scene/digitaluniverse/clusters.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/constellationbounds.asset b/data/assets/scene/digitaluniverse/constellationbounds.asset index 517a2e2684..8a253de6d9 100644 --- a/data/assets/scene/digitaluniverse/constellationbounds.asset +++ b/data/assets/scene/digitaluniverse/constellationbounds.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index 2fc48498f2..f65c00b905 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/deepsky.asset b/data/assets/scene/digitaluniverse/deepsky.asset index 618c671b30..8109316997 100644 --- a/data/assets/scene/digitaluniverse/deepsky.asset +++ b/data/assets/scene/digitaluniverse/deepsky.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local textures = asset.syncedResource({ Name = "Deep Sky Objects Textures", @@ -43,7 +43,7 @@ local deepSkyPoints = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, GUI = { @@ -73,7 +73,7 @@ local deepSkyImages = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = {3.14159265359, 3.14159265359, 0 } + Rotation = { math.pi, math.pi, 0 } } }, GUI = { diff --git a/data/assets/scene/digitaluniverse/digitaluniverse.asset b/data/assets/scene/digitaluniverse/digitaluniverse.asset index 9bdf3c367a..f4bc5e7465 100644 --- a/data/assets/scene/digitaluniverse/digitaluniverse.asset +++ b/data/assets/scene/digitaluniverse/digitaluniverse.asset @@ -1,37 +1,36 @@ -asset.require('./2dF') -asset.require('./2mass') -asset.require('./6dF') -asset.require('./abell') -asset.require('./alternatestarlabels') -asset.require('./backgroundradiation') -asset.require('./backgroundradiation_multiverse') -asset.require('./clusters') -asset.require('./constellationbounds') -asset.require('./constellations') -asset.require('./deepsky') -asset.require('./dwarfs') -asset.require('./exoplanets') -asset.require('./globularclusters') -asset.require('./grids') -asset.require('./groups') -asset.require('./h2regions') -asset.require('./kepler') -asset.require('./localdwarfs') -asset.require('./milkyway') -asset.require('./milkyway_arm_labels') -asset.require('./milkyway_data') -asset.require('./milkyway_label') -asset.require('./milkyway_sphere') -asset.require('./obassociations') -asset.require('./openclusters') -asset.require('./planetarynebulae') -asset.require('./pulsars') -asset.require('./quasars') -asset.require('./sdss') -asset.require('./starlabels') -asset.require('./starorbits') -asset.require('./stars') -asset.require('./superclusters') -asset.require('./supernovaremnants') -asset.require('./tully') -asset.require('./voids') +asset.require("./2dF") +asset.require("./2mass") +asset.require("./6dF") +asset.require("./abell") +asset.require("./alternatestarlabels") +asset.require("./backgroundradiation") +asset.require("./backgroundradiation_multiverse") +asset.require("./clusters") +asset.require("./constellationbounds") +asset.require("./constellations") +asset.require("./deepsky") +asset.require("./dwarfs") +asset.require("./exoplanets") +asset.require("./globularclusters") +asset.require("./grids") +asset.require("./groups") +asset.require("./h2regions") +asset.require("./kepler") +asset.require("./localdwarfs") +asset.require("./milkyway") +asset.require("./milkyway_arm_labels") +asset.require("./milkyway_label") +asset.require("./milkyway_sphere") +asset.require("./obassociations") +asset.require("./openclusters") +asset.require("./planetarynebulae") +asset.require("./pulsars") +asset.require("./quasars") +asset.require("./sdss") +asset.require("./starlabels") +asset.require("./starorbits") +asset.require("./stars") +asset.require("./superclusters") +asset.require("./supernovaremnants") +asset.require("./tully") +asset.require("./voids") diff --git a/data/assets/scene/digitaluniverse/dwarfs.asset b/data/assets/scene/digitaluniverse/dwarfs.asset index 0b37e59bf9..1a026472e2 100644 --- a/data/assets/scene/digitaluniverse/dwarfs.asset +++ b/data/assets/scene/digitaluniverse/dwarfs.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/exoplanets.asset b/data/assets/scene/digitaluniverse/exoplanets.asset index 4a37ecebc7..2da69322c6 100644 --- a/data/assets/scene/digitaluniverse/exoplanets.asset +++ b/data/assets/scene/digitaluniverse/exoplanets.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/globularclusters.asset b/data/assets/scene/digitaluniverse/globularclusters.asset index b4f4a0bd9e..e63b2d4579 100644 --- a/data/assets/scene/digitaluniverse/globularclusters.asset +++ b/data/assets/scene/digitaluniverse/globularclusters.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index fd66c34487..433069b89a 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earth_transforms = asset.require("scene/solarsystem/planets/earth/transforms") local equatorialRotationMatrix = { -0.05487554, 0.4941095, -0.8676661, diff --git a/data/assets/scene/digitaluniverse/groups.asset b/data/assets/scene/digitaluniverse/groups.asset index e24689c384..62b2eecd3f 100644 --- a/data/assets/scene/digitaluniverse/groups.asset +++ b/data/assets/scene/digitaluniverse/groups.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/h2regions.asset b/data/assets/scene/digitaluniverse/h2regions.asset index f333273608..d81999a271 100644 --- a/data/assets/scene/digitaluniverse/h2regions.asset +++ b/data/assets/scene/digitaluniverse/h2regions.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/hdf.asset b/data/assets/scene/digitaluniverse/hdf.asset index 45483e4672..f76fac43d7 100644 --- a/data/assets/scene/digitaluniverse/hdf.asset +++ b/data/assets/scene/digitaluniverse/hdf.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local circle = asset.syncedResource({ Name = "Circle", diff --git a/data/assets/scene/digitaluniverse/kepler.asset b/data/assets/scene/digitaluniverse/kepler.asset index 68e2db1e9a..9f7e5c4ff5 100644 --- a/data/assets/scene/digitaluniverse/kepler.asset +++ b/data/assets/scene/digitaluniverse/kepler.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/localdwarfs.asset b/data/assets/scene/digitaluniverse/localdwarfs.asset index 9619f0d762..d9c8c6212e 100644 --- a/data/assets/scene/digitaluniverse/localdwarfs.asset +++ b/data/assets/scene/digitaluniverse/localdwarfs.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/milkyway.asset b/data/assets/scene/digitaluniverse/milkyway.asset index 444c2614ad..34bf613fee 100644 --- a/data/assets/scene/digitaluniverse/milkyway.asset +++ b/data/assets/scene/digitaluniverse/milkyway.asset @@ -1,6 +1,20 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") -local dataPaths = asset.require("scene/digitaluniverse/milkyway_data") + + +local planeTextures = asset.syncedResource({ + Name = "Milky Way Plane Textures", + Type = "HttpSynchronization", + Identifier = "digitaluniverse_milkyway_textures", + Version = 2 +}) + +local planeSpeck = asset.syncedResource({ + Name = "Milky Way Plane Speck", + Type = "HttpSynchronization", + Identifier = "digitaluniverse_milkyway_speck", + Version = 1 +}) local plane = { Identifier = "MilkyWayGalaxyImage", @@ -11,8 +25,8 @@ local plane = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.99, ScaleFactor = 2.8, - File = dataPaths.SpeckPath .. "/galaxy.speck", - TexturePath = dataPaths.TexturesPath, + File = planeSpeck .. "galaxy.speck", + TexturePath = planeTextures, Luminosity = "size", ScaleLuminosity = 1.0, FadeInDistances = { 3000.0, 50000.0 }, diff --git a/data/assets/scene/digitaluniverse/milkyway_arm_labels.asset b/data/assets/scene/digitaluniverse/milkyway_arm_labels.asset index fb5f1fa761..3e4294b20a 100644 --- a/data/assets/scene/digitaluniverse/milkyway_arm_labels.asset +++ b/data/assets/scene/digitaluniverse/milkyway_arm_labels.asset @@ -1,6 +1,20 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") -local dataPaths = asset.require("scene/digitaluniverse/milkyway_data") + + +local planeTextures = asset.syncedResource({ + Name = "Milky Way Plane Textures", + Type = "HttpSynchronization", + Identifier = "digitaluniverse_milkyway_textures", + Version = 2 +}) + +local planeSpeck = asset.syncedResource({ + Name = "Milky Way Plane Speck", + Type = "HttpSynchronization", + Identifier = "digitaluniverse_milkyway_speck", + Version = 1 +}) local plane = { Identifier = "MilkyWayGalaxyArmLabelsImage", @@ -11,8 +25,8 @@ local plane = { Color = { 1.0, 1.0, 1.0 }, Opacity = 0.99, ScaleFactor = 2.8, - File = dataPaths.SpeckPath .. "/galaxyArmLabels.speck", - TexturePath = dataPaths.TexturesPath, + File = planeSpeck .. "galaxyArmLabels.speck", + TexturePath = planeTextures, Luminosity = "size", ScaleLuminosity = 1.0, FadeInDistances = { 3000.0, 50000.0 }, diff --git a/data/assets/scene/digitaluniverse/milkyway_data.asset b/data/assets/scene/digitaluniverse/milkyway_data.asset deleted file mode 100644 index 90f93e7a29..0000000000 --- a/data/assets/scene/digitaluniverse/milkyway_data.asset +++ /dev/null @@ -1,16 +0,0 @@ -local planeTextures = asset.syncedResource({ - Name = "Milky Way Plane Textures", - Type = "HttpSynchronization", - Identifier = "digitaluniverse_milkyway_textures", - Version = 2 -}) - -local planeSpeck = asset.syncedResource({ - Name = "Milky Way Plane Speck", - Type = "HttpSynchronization", - Identifier = "digitaluniverse_milkyway_speck", - Version = 1 -}) - -asset.export("TexturesPath", planeTextures) -asset.export("SpeckPath", planeSpeck) diff --git a/data/assets/scene/digitaluniverse/milkyway_label.asset b/data/assets/scene/digitaluniverse/milkyway_label.asset index 5d4e5405bf..062ca05f62 100644 --- a/data/assets/scene/digitaluniverse/milkyway_label.asset +++ b/data/assets/scene/digitaluniverse/milkyway_label.asset @@ -1,5 +1,4 @@ ---milkyway_label.asset -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/milkyway_sphere.asset b/data/assets/scene/digitaluniverse/milkyway_sphere.asset index db8348e4cd..7a5d3c1971 100644 --- a/data/assets/scene/digitaluniverse/milkyway_sphere.asset +++ b/data/assets/scene/digitaluniverse/milkyway_sphere.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") @@ -15,7 +15,7 @@ local sphere = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = { 0, 0, 3.14159265359 } + Rotation = { 0, 0, math.pi } } }, Renderable = { diff --git a/data/assets/scene/digitaluniverse/obassociations.asset b/data/assets/scene/digitaluniverse/obassociations.asset index 7d878d5b3b..3e2ece6db1 100644 --- a/data/assets/scene/digitaluniverse/obassociations.asset +++ b/data/assets/scene/digitaluniverse/obassociations.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/openclusters.asset b/data/assets/scene/digitaluniverse/openclusters.asset index a3d800cc40..057aacb5b8 100644 --- a/data/assets/scene/digitaluniverse/openclusters.asset +++ b/data/assets/scene/digitaluniverse/openclusters.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/planetarynebulae.asset b/data/assets/scene/digitaluniverse/planetarynebulae.asset index 83d9b7f3d6..23e0eccd09 100644 --- a/data/assets/scene/digitaluniverse/planetarynebulae.asset +++ b/data/assets/scene/digitaluniverse/planetarynebulae.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/pulsars.asset b/data/assets/scene/digitaluniverse/pulsars.asset index 46b61b397c..0a53462ce7 100644 --- a/data/assets/scene/digitaluniverse/pulsars.asset +++ b/data/assets/scene/digitaluniverse/pulsars.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/quasars.asset b/data/assets/scene/digitaluniverse/quasars.asset index 6591ab5456..0a50114c2d 100644 --- a/data/assets/scene/digitaluniverse/quasars.asset +++ b/data/assets/scene/digitaluniverse/quasars.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/sdss.asset b/data/assets/scene/digitaluniverse/sdss.asset index 12f5527dc9..c855534515 100644 --- a/data/assets/scene/digitaluniverse/sdss.asset +++ b/data/assets/scene/digitaluniverse/sdss.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/starlabels.asset b/data/assets/scene/digitaluniverse/starlabels.asset index 42c54d2524..eb8f049642 100644 --- a/data/assets/scene/digitaluniverse/starlabels.asset +++ b/data/assets/scene/digitaluniverse/starlabels.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/starorbits.asset b/data/assets/scene/digitaluniverse/starorbits.asset index 685581f534..ccded58ce2 100644 --- a/data/assets/scene/digitaluniverse/starorbits.asset +++ b/data/assets/scene/digitaluniverse/starorbits.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earth_transforms = asset.require("scene/solarsystem/planets/earth/transforms") local speck = asset.syncedResource({ diff --git a/data/assets/scene/digitaluniverse/stars.asset b/data/assets/scene/digitaluniverse/stars.asset index 35ec3cf742..27f950183c 100644 --- a/data/assets/scene/digitaluniverse/stars.asset +++ b/data/assets/scene/digitaluniverse/stars.asset @@ -1,7 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") + -local colormaps = asset.require('./stars_colormap').ColorMaps -local textures = asset.require('./stars_textures').textures local speck = asset.syncedResource({ Name = "Stars Speck Files", @@ -17,6 +16,20 @@ local sunspeck = asset.syncedResource({ Version = 1 }) +local colormaps = asset.syncedResource({ + Name = "Stars Color Table", + Type = "HttpSynchronization", + Identifier = "stars_colormap", + Version = 2 +}) + +local textures = asset.syncedResource({ + Name = "Stars Textures", + Type = "HttpSynchronization", + Identifier = "stars_textures", + Version = 1 +}) + local stars = { Identifier = "Stars", Renderable = { diff --git a/data/assets/scene/digitaluniverse/stars_colormap.asset b/data/assets/scene/digitaluniverse/stars_colormap.asset deleted file mode 100644 index d8aaa83f1d..0000000000 --- a/data/assets/scene/digitaluniverse/stars_colormap.asset +++ /dev/null @@ -1,22 +0,0 @@ -local assetHelper = asset.require('util/asset_helper') - -local colormaps = asset.syncedResource({ - Name = "Stars Color Table", - Type = "HttpSynchronization", - Identifier = "stars_colormap", - Version = 2 -}) - -asset.export("ColorMaps", colormaps) - -asset.meta = { - Name = "Star Colormaps", - Version = "2.0", - Description = [[Lookup tables used for star datasets, one of the tables map a B-V color - index to an RGB color. The B-V values are in the range (-0.4, 2.0) and each line maps - a value in that range to a color. The other table is the commonly used viridis map]], - Author = "OpenSpace Team", - URL = "https://www.amnh.org/research/hayden-planetarium/digital-universe", - License = "AMNH Digital Universe" -} - diff --git a/data/assets/scene/digitaluniverse/stars_textures.asset b/data/assets/scene/digitaluniverse/stars_textures.asset deleted file mode 100644 index d57f6d0907..0000000000 --- a/data/assets/scene/digitaluniverse/stars_textures.asset +++ /dev/null @@ -1,20 +0,0 @@ -local assetHelper = asset.require('util/asset_helper') - -local textures = asset.syncedResource({ - Name = "Stars Textures", - Type = "HttpSynchronization", - Identifier = "stars_textures", - Version = 1 -}) - -asset.export("textures", textures) - -asset.meta = { - Name = "Star Textures", - Version = "1.0", - Description = [[Square textures used to represent stars when applied to camera-facing bil;board]], - Author = "OpenSpace Team", - URL = "http://openspaceproject.com", - License = "MIT License" -} - diff --git a/data/assets/scene/digitaluniverse/superclusters.asset b/data/assets/scene/digitaluniverse/superclusters.asset index ccd95d0a4a..b183856ae3 100644 --- a/data/assets/scene/digitaluniverse/superclusters.asset +++ b/data/assets/scene/digitaluniverse/superclusters.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/supernovaremnants.asset b/data/assets/scene/digitaluniverse/supernovaremnants.asset index 8d6b781f38..9f5cf72062 100644 --- a/data/assets/scene/digitaluniverse/supernovaremnants.asset +++ b/data/assets/scene/digitaluniverse/supernovaremnants.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/tully.asset b/data/assets/scene/digitaluniverse/tully.asset index b43b368c49..d36e0a9224 100644 --- a/data/assets/scene/digitaluniverse/tully.asset +++ b/data/assets/scene/digitaluniverse/tully.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/digitaluniverse/voids.asset b/data/assets/scene/digitaluniverse/voids.asset index 5bc10c9712..db1bfba976 100644 --- a/data/assets/scene/digitaluniverse/voids.asset +++ b/data/assets/scene/digitaluniverse/voids.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/milkyway/constellations/constellation_art.asset b/data/assets/scene/milkyway/constellations/constellation_art.asset index 919e64e763..c036605476 100644 --- a/data/assets/scene/milkyway/constellations/constellation_art.asset +++ b/data/assets/scene/milkyway/constellations/constellation_art.asset @@ -1,4 +1,4 @@ -local constellationsCSV = asset.localResource('constellation_data.csv') +local constellationsCSV = asset.localResource("constellation_data.csv") local transforms = asset.require("scene/solarsystem/sun/transforms") local images = asset.syncedResource({ @@ -23,18 +23,18 @@ local createConstellations = function (baseIdentifier, guiPath, constellationfil for line in io.lines(openspace.absPath(constellationfile)) do if (notFirstLine) then -- describes the data - local matchstring = '(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)$' + local matchstring = "(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)$" local group, abbreviation, name, x, y, z, scale, imageName, rotX, rotY, rotZ, centerStar = line:match(matchstring) local magVec = math.sqrt(x*x + y*y + z*z) local normx = x/magVec local normy = y/magVec local normz = z/magVec - group = (group == '' and globe or group) + group = (group == "" and globe or group) local aconstellation = { - -- Identifier = guiPath .. '-' .. name, - Identifier = baseIdentifier .. '-' .. abbreviation, + -- Identifier = guiPath .. "-" .. name, + Identifier = baseIdentifier .. "-" .. abbreviation, Parent = transforms.SolarSystemBarycenter.Identifier, Transform = { Translation = { @@ -64,8 +64,8 @@ local createConstellations = function (baseIdentifier, guiPath, constellationfil }, Tag = { "ConstellationArtImage", group }, GUI = { - Name = name .. ' Image', - Path = '/Milky Way/' .. guiPath + Name = name .. " Image", + Path = "/Milky Way/" .. guiPath } } table.insert(genConstellations, aconstellation); @@ -81,9 +81,11 @@ end local show_art = { Identifier = "constellation_art.show_art", Name = "Show Constellation Art", - Command = "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Opacity', 0);" .. - "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Enabled', true);" .. - "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Opacity', 0.2, 2);", + Command = [[ + openspace.setPropertyValue("Scene.ConstellationArt*.Renderable.Opacity", 0); + openspace.setPropertyValue("Scene.ConstellationArt*.Renderable.Enabled", true); + openspace.setPropertyValue("Scene.ConstellationArt*.Renderable.Opacity", 0.2, 2); + ]], Documentation = "Enables and fades up constellation art work", GuiPath = "/Rendering", IsLocal = false @@ -93,7 +95,7 @@ asset.export("ShowArtAction", show_art) local hide_art = { Identifier = "constellation_art.hide_art", Name = "Hide Constellation Art", - Command = "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Opacity', 0, 2);", + Command = [[openspace.setPropertyValue("Scene.ConstellationArt*.Renderable.Opacity", 0, 2)]], Documentation = "Fades out constellation artwork", GuiPath = "/Rendering", IsLocal = false @@ -103,7 +105,7 @@ asset.export("HideArtAction", hide_art) local disable_art = { Identifier = "constellation_art.disable_art", Name = "Disable Constellation Art", - Command = "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Enabled', false);", + Command = [[openspace.setPropertyValue("Scene.ConstellationArt*.Renderable.Enabled", false)]], Documentation = "Disable constellation artwork", GuiPath = "/Rendering", IsLocal = false @@ -113,9 +115,11 @@ asset.export("DisableArtAction", disable_art) local show_zodiac_art = { Identifier = "constellation_art.show_zodiac_art", Name = "Show Zodiac Art", - Command = "openspace.setPropertyValue('Scene.ConstellationArt*.Renderable.Opacity', 0);" .. - "openspace.setPropertyValue('{zodiac}.Renderable.Enabled',true);" .. - "openspace.setPropertyValue('{zodiac}.Renderable.Opacity', 1, 2);", + Command = [[ + openspace.setPropertyValue("Scene.ConstellationArt*.Renderable.Opacity", 0); + openspace.setPropertyValue("{zodiac}.Renderable.Enabled",true); + openspace.setPropertyValue("{zodiac}.Renderable.Opacity", 1, 2); + ]], Documentation = "Enables and fades up zodiac art work", GuiPath = "/Rendering", IsLocal = false @@ -125,7 +129,7 @@ asset.export("ShowZodiacArt", show_zodiac_art) local hide_zodiac_art = { Identifier = "constellation_art.hide_zodiac_art", Name = "Hide Zodiac Art", - Command = "openspace.setPropertyValue('{zodiac}.Renderable.Opacity', 0, 2);", + Command = [[openspace.setPropertyValue("{zodiac}.Renderable.Opacity", 0, 2)]], Documentation = "fades down zodiac art work", GuiPath = "/Rendering", IsLocal = false @@ -135,9 +139,9 @@ asset.export("HideZodiacArt", hide_zodiac_art) local nodes = {} asset.onInitialize(function () - local constellationsCSV = images .. "/constellation_data.csv" + local constellationsCSV = images .. "constellation_data.csv" - nodes = createConstellations('ConstellationArt', 'Constellation Art', constellationsCSV) + nodes = createConstellations("ConstellationArt", "Constellation Art", constellationsCSV) for _, n in ipairs(nodes) do openspace.addSceneGraphNode(n); end diff --git a/data/assets/scene/milkyway/constellations/constellation_extrakeybinds.asset b/data/assets/scene/milkyway/constellations/constellation_extrakeybinds.asset index 33693141f8..8b4809195a 100644 --- a/data/assets/scene/milkyway/constellations/constellation_extrakeybinds.asset +++ b/data/assets/scene/milkyway/constellations/constellation_extrakeybinds.asset @@ -1,4 +1,4 @@ -local mainAsset = asset.require('./constellation_art') +local mainAsset = asset.require("./constellation_art") asset.onInitialize(function () openspace.bindKey("v", mainAsset.ShowZodiacArt.Identifier) diff --git a/data/assets/scene/milkyway/constellations/constellation_keybinds.asset b/data/assets/scene/milkyway/constellations/constellation_keybinds.asset index 37b9f3e124..3734cafdfc 100644 --- a/data/assets/scene/milkyway/constellations/constellation_keybinds.asset +++ b/data/assets/scene/milkyway/constellations/constellation_keybinds.asset @@ -1,4 +1,4 @@ -local mainAsset = asset.require('./constellation_art') +local mainAsset = asset.require("./constellation_art") asset.onInitialize(function () openspace.bindKey("c", mainAsset.ShowArtAction.Identifier) diff --git a/data/assets/scene/milkyway/exoplanets/exoplanets_data.asset b/data/assets/scene/milkyway/exoplanets/exoplanets_data.asset index 3cd5fc9e78..5c13517b64 100644 --- a/data/assets/scene/milkyway/exoplanets/exoplanets_data.asset +++ b/data/assets/scene/milkyway/exoplanets/exoplanets_data.asset @@ -1,5 +1,3 @@ -local colormaps = asset.require('scene/digitaluniverse/stars_colormap').ColorMaps - local DataPath = asset.syncedResource({ Name = "Exoplanet Data Files", Type = "HttpSynchronization", @@ -7,6 +5,13 @@ local DataPath = asset.syncedResource({ Version = 2 }) +local colormaps = asset.syncedResource({ + Name = "Stars Color Table", + Type = "HttpSynchronization", + Identifier = "stars_colormap", + Version = 2 +}) + asset.onInitialize(function () local p = "Modules.Exoplanets.DataFolder"; if (openspace.getPropertyValue(p) == "") then diff --git a/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset b/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset index eb5804687e..3f424fb2e0 100644 --- a/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset +++ b/data/assets/scene/milkyway/exoplanets/exoplanets_textures.asset @@ -1,5 +1,5 @@ local habitableZoneTextures = - asset.require('./../habitable_zones/habitable_zone_textures').TexturesPath + asset.require("../habitable_zones/habitable_zone_textures").TexturesPath local sunTextures = asset.syncedResource({ Type = "HttpSynchronization", diff --git a/data/assets/scene/milkyway/gaia/apogee.asset b/data/assets/scene/milkyway/gaia/apogee.asset index 19b4806a41..5c5eaca933 100644 --- a/data/assets/scene/milkyway/gaia/apogee.asset +++ b/data/assets/scene/milkyway/gaia/apogee.asset @@ -1,7 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") -local colorLUT = asset.require('scene/digitaluniverse/stars_colormap').ColorMaps -local textures = asset.require('scene/digitaluniverse/stars_textures').textures local speck = asset.syncedResource({ @@ -11,6 +9,20 @@ local speck = asset.syncedResource({ Version = 1 }) +local colormaps = asset.syncedResource({ + Name = "Stars Color Table", + Type = "HttpSynchronization", + Identifier = "stars_colormap", + Version = 2 +}) + +local textures = asset.syncedResource({ + Name = "Stars Textures", + Type = "HttpSynchronization", + Identifier = "stars_textures", + Version = 1 +}) + local gaia_abundance_apogee = { Identifier = "Gaia Abundance Apogee", Renderable = { @@ -24,8 +36,8 @@ local gaia_abundance_apogee = { RenderMethod = "Texture Based", Texture = textures .. "halo.png", -- ShapeTexture = textures .. "disc.png", - ColorMap = colorLUT .. "colorbv.cmap", - OtherDataColorMap = colorLUT .. "viridis.cmap", + ColorMap = colormaps .. "colorbv.cmap", + OtherDataColorMap = colormaps .. "viridis.cmap", StaticFilter = -9999, StaticFilterReplacement = 0.0, DataMapping = { diff --git a/data/assets/scene/milkyway/gaia/gaia_dr2_download_stars.asset b/data/assets/scene/milkyway/gaia/gaia_dr2_download_stars.asset index 7e4df4068c..9c8bcbf1a0 100644 --- a/data/assets/scene/milkyway/gaia/gaia_dr2_download_stars.asset +++ b/data/assets/scene/milkyway/gaia/gaia_dr2_download_stars.asset @@ -7,7 +7,7 @@ local gaia618Destination = asset.syncedResource({ Identifier = "gaia_stars_618M_octree", Version = 1 }) -local gaia618DestinationExtracted = gaia618Destination + '/data'; +local gaia618DestinationExtracted = gaia618Destination + "data"; -- Download the full DR2 dataset with 24 values per star (preprocessed with theReadFitsTask (gaia_read.task) into 8 binary files). -- From these files new subsets can be created with the ConstructOctreeTask (gaia_octree.task). @@ -22,9 +22,9 @@ local gaiaFull = asset.syncedResource({ asset.onInitialize(function() if not openspace.directoryExists(gaia618DestinationExtracted) then openspace.printInfo("Extracted Gaia dataset") - openspace.unzipFile(gaia618Destination .. 'DR2_full_Octree[50kSPN,500dist]_50,50.zip', gaia618DestinationExtracted, true) + openspace.unzipFile(gaia618Destination .. "DR2_full_Octree[50kSPN,500dist]_50,50.zip", gaia618DestinationExtracted, true) end end) -asset.export('GaiaDR2_618M', gaia618DestinationExtracted) -asset.export('GaiaFullDataset', gaiaFull) +asset.export("GaiaDR2_618M", gaia618DestinationExtracted) +asset.export("GaiaFullDataset", gaiaFull) diff --git a/data/assets/scene/milkyway/gaia/gaiastars.asset b/data/assets/scene/milkyway/gaia/gaiastars.asset index 624a511734..de6a84a71a 100644 --- a/data/assets/scene/milkyway/gaia/gaiastars.asset +++ b/data/assets/scene/milkyway/gaia/gaiastars.asset @@ -1,7 +1,6 @@ local assetHelper = asset.require("util/asset_helper") -local colorLUT = asset.require('scene/digitaluniverse/stars_colormap').ColorMaps -local textures = asset.require('scene/digitaluniverse/stars_textures').textures + -- Download a preprocessed binary octree of Radial Velocity subset values per star (preprocessed into 8 binary files). local starsFolder = asset.syncedResource({ @@ -11,6 +10,20 @@ local starsFolder = asset.syncedResource({ Version = 1 }) +local colormaps = asset.syncedResource({ + Name = "Stars Color Table", + Type = "HttpSynchronization", + Identifier = "stars_colormap", + Version = 2 +}) + +local textures = asset.syncedResource({ + Name = "Stars Textures", + Type = "HttpSynchronization", + Identifier = "stars_textures", + Version = 1 +}) + local GaiaStars = { Identifier = "GaiaStars", Renderable = { @@ -20,7 +33,7 @@ local GaiaStars = { RenderOption = "Motion", ShaderOption = "Point_SSBO", Texture = textures .. "halo.png", - ColorMap = colorLUT .. "colorbv.cmap", + ColorMap = colormaps .. "colorbv.cmap", LuminosityMultiplier = 35, MagnitudeBoost = 25, CutOffThreshold = 38, diff --git a/data/assets/scene/milkyway/gaia/galah.asset b/data/assets/scene/milkyway/gaia/galah.asset index 36da26f090..a311ed25ba 100644 --- a/data/assets/scene/milkyway/gaia/galah.asset +++ b/data/assets/scene/milkyway/gaia/galah.asset @@ -1,7 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") + -local colorLUT = asset.require('scene/digitaluniverse/stars_colormap').ColorMaps -local textures = asset.require('scene/digitaluniverse/stars_textures').textures local speck = asset.syncedResource({ Name = "Galah Speck Files", @@ -10,6 +9,19 @@ local speck = asset.syncedResource({ Version = 1 }) +local colormaps = asset.syncedResource({ + Name = "Stars Color Table", + Type = "HttpSynchronization", + Identifier = "stars_colormap", + Version = 2 +}) + +local textures = asset.syncedResource({ + Name = "Stars Textures", + Type = "HttpSynchronization", + Identifier = "stars_textures", + Version = 1 +}) local gaia_abundance_galah = { Identifier = "Gaia Abundance Galah", @@ -24,8 +36,8 @@ local gaia_abundance_galah = { RenderMethod = "Texture Based", ColorOption = "Other Data", OtherData = "FeH", - ColorMap = colorLUT .. "colorbv.cmap", - OtherDataColorMap = colorLUT .. "viridis.cmap", + ColorMap = colormaps .. "colorbv.cmap", + OtherDataColorMap = colormaps .. "viridis.cmap", StaticFilter = -9999, StaticFilterReplacement = 0.0, DataMapping = { diff --git a/data/assets/scene/milkyway/milkyway/eso.asset b/data/assets/scene/milkyway/milkyway/eso.asset index f6abfcc9e5..556e19a1a8 100644 --- a/data/assets/scene/milkyway/milkyway/eso.asset +++ b/data/assets/scene/milkyway/milkyway/eso.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") @@ -14,7 +14,7 @@ local object = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = {0, 0, 3.14159265359} + Rotation = { 0, 0, math.pi } } }, Renderable = { diff --git a/data/assets/scene/milkyway/milkyway/volume.asset b/data/assets/scene/milkyway/milkyway/volume.asset index 249e945d17..af427e384e 100644 --- a/data/assets/scene/milkyway/milkyway/volume.asset +++ b/data/assets/scene/milkyway/milkyway/volume.asset @@ -1,8 +1,8 @@ --- asset.require('../examples/volume/generated/cartesian.asset') - local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("scene/solarsystem/sun/transforms") + + local data = asset.syncedResource({ Name = "Milkyway Volume Data", Type = "HttpSynchronization", @@ -29,7 +29,7 @@ local MilkyWayVolumeGalaxy = { StepSize = 0.01, AbsorptionMultiply = 200, EmissionMultiply = 250, - Rotation = { 3.1415926, 3.1248, 4.45741 }, + Rotation = { math.pi, 3.1248, 4.45741 }, Volume = { Type = "Volume", Filename = openspace.absPath(data .. "MilkyWayRGBAVolume1024x1024x128.raw"), diff --git a/data/assets/scene/milkyway/objects/orionnebula/cluster.asset b/data/assets/scene/milkyway/objects/orionnebula/cluster.asset index 7c8f9a7b96..e10e6c024a 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/cluster.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/cluster.asset @@ -1,7 +1,8 @@ ---orionnebula/cluster.asset -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("./transforms") + + local sync = asset.syncedResource({ Name = "Orion Nebula Star Cluster", Type = "HttpSynchronization", diff --git a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset index 964f211ebb..f22b31f319 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local transforms = asset.require("./transforms") local center = sunTransforms.SolarSystemBarycenter.Identifier; local LIGHTS = assetHelper.getDefaultLightSources(center); diff --git a/data/assets/scene/milkyway/objects/orionnebula/orionnebula.asset b/data/assets/scene/milkyway/objects/orionnebula/orionnebula.asset index 34df0dacc9..014c4bc8c4 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/orionnebula.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/orionnebula.asset @@ -1,2 +1,2 @@ -asset.require('./cluster') -asset.require('./nebula') +asset.require("./cluster") +asset.require("./nebula") diff --git a/data/assets/scene/milkyway/objects/orionnebula/transforms.asset b/data/assets/scene/milkyway/objects/orionnebula/transforms.asset index 82c06e7c32..7f9c77e7dd 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/transforms.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local PARSEC_CONSTANT = 3.0856776E16; diff --git a/data/assets/scene/milkyway/stars/denver.asset b/data/assets/scene/milkyway/stars/denver.asset index cb7c620617..faaa1d2a47 100644 --- a/data/assets/scene/milkyway/stars/denver.asset +++ b/data/assets/scene/milkyway/stars/denver.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset index 16ecabfa64..7298e18c74 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./../transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("../transforms") asset.require("spice/base") -asset.require('../trail') +asset.require("../trail") diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon_trail.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon_trail.asset index 1c2f6918b8..0b045f1f5e 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon_trail.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/charon_trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('../transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("../transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/default_layers.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/default_layers.asset index ed825589b3..4a914f423d 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/default_layers.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/greyscale_usgs") +local colorLayer = asset.require("./layers/colorlayers/greyscale_usgs") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/layers/colorlayers/greyscale_usgs.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/layers/colorlayers/greyscale_usgs.asset index 05aeb630a3..e1905776cf 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/layers/colorlayers/greyscale_usgs.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/charon/layers/colorlayers/greyscale_usgs.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../charon").Charon.Identifier +local globeIdentifier = asset.require("../../charon").Charon.Identifier local layer = { Identifier = "Greyscale_USGS", diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/default_layers.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/default_layers.asset index 42c8f9f260..a32acd6d1b 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/default_layers.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/greyscale_usgs") +local colorLayer = asset.require("./layers/colorlayers/greyscale_usgs") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/layers/colorlayers/greyscale_usgs.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/layers/colorlayers/greyscale_usgs.asset index 0bf0135776..69ce144c80 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/layers/colorlayers/greyscale_usgs.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/layers/colorlayers/greyscale_usgs.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../pluto").Pluto.Identifier +local globeIdentifier = asset.require("../../pluto").Pluto.Identifier local layer = { Identifier = "Greyscale_USGS", diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/hydra.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/hydra.asset index a7f991c8cc..bf3ad123fa 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/hydra.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/hydra.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('../transforms') -local kernels = asset.require('../kernels').PlutoKernels +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("../transforms") +local kernels = asset.require("../kernels").PlutoKernels diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset index 2cf71c1de2..5183ca60d5 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/kerberos.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('../transforms') -local kernels = asset.require('../kernels').PlutoKernels +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("../transforms") +local kernels = asset.require("../kernels").PlutoKernels diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset index 0c057482d2..3ea1a994ed 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/nix.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('../transforms') -local kernels = asset.require('../kernels').PlutoKernels +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("../transforms") +local kernels = asset.require("../kernels").PlutoKernels diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset index ba9195d562..f154179247 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/minor/styx.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('../transforms') -local kernels = asset.require('../kernels').PlutoKernels +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("../transforms") +local kernels = asset.require("../kernels").PlutoKernels local Styx = { diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset index 3abde38140..e323d1a5de 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") asset.require("spice/base") -asset.require('./trail') +asset.require("./trail") local labelsPath = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset index 42e1e9dfd2..52363d1bca 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset index f8272f2726..3b8a7a063c 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/pluto_trail_kepler.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") -local kernels = asset.require('./kernels').PlutoKernels +local kernels = asset.require("./kernels").PlutoKernels local OneAU = 1.496e+8 @@ -18,7 +18,7 @@ local PlutoKeplerianTrail = { AscendingNode = 1.102099981996057E+02, ArgumentOfPeriapsis = 1.142248569189779E+02, MeanAnomaly = 14.53, - Epoch = '2000 01 01 00:00', + Epoch = "2000 01 01 00:00", Period = 7.82438e+9 }, Color = { 0.2, 0.8, 0.3 }, diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset index 0df3c771b8..3a34b5a336 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset @@ -1,13 +1,13 @@ -asset.require('./trail') -asset.require('./pluto') -asset.require('./pluto_trail') -asset.require('./pluto_trail_kepler') -asset.require('./charon/charon') -asset.require('./charon/charon_trail') -asset.require('./minor/hydra') -asset.require('./minor/kerberos') -asset.require('./minor/nix') -asset.require('./minor/styx') +asset.require("./trail") +asset.require("./pluto") +asset.require("./pluto_trail") +asset.require("./pluto_trail_kepler") +asset.require("./charon/charon") +asset.require("./charon/charon_trail") +asset.require("./minor/hydra") +asset.require("./minor/kerberos") +asset.require("./minor/nix") +asset.require("./minor/styx") asset.meta = { diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/trail.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/trail.asset index 129aeea4ea..8487d98ec5 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/trail.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/trail.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") -local kernels = asset.require('./kernels').PlutoKernels +local kernels = asset.require("./kernels").PlutoKernels diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/transforms.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/transforms.asset index 475a73286b..a21f1e8cf6 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/transforms.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/transforms.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local kernels = asset.require('./kernels').PlutoKernels +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local kernels = asset.require("./kernels").PlutoKernels asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/density_volume.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/density_volume.asset index b622245855..61262f1621 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/density_volume.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/density_volume.asset @@ -1,6 +1,6 @@ local assetHelper = asset.require("util/asset_helper") -local propertyHelper = asset.require('util/property_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local propertyHelper = asset.require("util/property_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local densityDirectory = asset.syncedResource({ Name = "Bastille Day MAS Density", diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/fieldlines.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/fieldlines.asset index 8672ddd590..0d284f051d 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/fieldlines.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/fieldlines.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local heliosphereTransforms = asset.require('scene/solarsystem/sun/transforms_heliosphere') -local propertyHelper = asset.require('util/property_helper') -local rot = asset.require('./carringtonToHEEQRotation.asset') +local assetHelper = asset.require("util/asset_helper") +local heliosphereTransforms = asset.require("scene/solarsystem/sun/transforms_heliosphere") +local propertyHelper = asset.require("util/property_helper") +local rot = asset.require("./carringtonToHEEQRotation.asset") local fieldlinesDirectory = asset.syncedResource({ Name = "Bastille Day MAS Fieldlines", diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodes.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodes.asset index 2a8efbb70c..8ce98c3646 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodes.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodes.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local heliosphereTransforms = asset.require('scene/solarsystem/sun/transforms_heliosphere') -local propertyHelper = asset.require('util/property_helper') -local rot = asset.require('./carringtonToHEEQRotation.asset') +local assetHelper = asset.require("util/asset_helper") +local heliosphereTransforms = asset.require("scene/solarsystem/sun/transforms_heliosphere") +local propertyHelper = asset.require("util/property_helper") +local rot = asset.require("./carringtonToHEEQRotation.asset") local fluxNodesBinaries = asset.syncedResource({ Name = "Bastille day Flux nodes binaries", diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane.asset index e7a85a7f19..c08a6a1905 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodescutplane.asset @@ -1,7 +1,7 @@ local assetHelper = asset.require("util/asset_helper") local propertyHelper = asset.require("util/property_helper") -local transforms = asset.require('scene/solarsystem/sun/transforms_heliosphere') -local rot = asset.require('./carringtonToHEEQRotation.asset') +local transforms = asset.require("scene/solarsystem/sun/transforms_heliosphere") +local rot = asset.require("./carringtonToHEEQRotation.asset") local TexturesPathEquatorial = asset.syncedResource({ Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset index 4c7c83afc8..47c837e730 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/fluxnodeslegend.asset @@ -19,9 +19,11 @@ local legend = { local show_legend = { Identifier = "fluxnodelegend.show_legend", Name = "Show the legend image", - Command = "openspace.setPropertyValueSingle('ScreenSpace.LegendFluxNodes-bastille-day-2000.Opacity', 0.0);" .. - "openspace.setPropertyValueSingle('ScreenSpace.LegendFluxNodes-bastille-day-2000.Enabled', true);" .. - "openspace.setPropertyValueSingle('ScreenSpace.LegendFluxNodes-bastille-day-2000.Opacity', 1.0, 4);", + Command = [[ + openspace.setPropertyValueSingle("ScreenSpace.LegendFluxNodes-bastille-day-2000.Opacity", 0.0); + openspace.setPropertyValueSingle("ScreenSpace.LegendFluxNodes-bastille-day-2000.Enabled", true); + openspace.setPropertyValueSingle("ScreenSpace.LegendFluxNodes-bastille-day-2000.Opacity", 1.0, 4); + ]], Documentation = "Show the legend image", GuiPath = "/Bastille-Day 2000", IsLocal = false @@ -29,7 +31,7 @@ local show_legend = { local hide_legend = { Identifier = "fluxnodelegend.hide_legend", Name = "Hides the legend image", - Command = "openspace.setPropertyValueSingle('ScreenSpace.LegendFluxNodes-bastille-day-2000.Opacity', 0.0, 2);", + Command = [[openspace.setPropertyValueSingle("ScreenSpace.LegendFluxNodes-bastille-day-2000.Opacity", 0.0, 2)]], Documentation = "Hides the legend image", GuiPath = "/Bastille-Day 2000", IsLocal = false @@ -38,7 +40,7 @@ local hide_legend = { asset.onInitialize(function() openspace.addScreenSpaceRenderable(legend) -- These numbers are there to put the legend on the side of the screen. - openspace.setPropertyValueSingle('ScreenSpace.LegendFluxNodes-bastille-day-2000.Rotation', { 0.0, 0.0, 0.56652 }); + openspace.setPropertyValueSingle("ScreenSpace.LegendFluxNodes-bastille-day-2000.Rotation", { 0.0, 0.0, 0.56652 }); openspace.action.registerAction(show_legend) openspace.action.registerAction(hide_legend) end) diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/lightindicator.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/lightindicator.asset index 533cb79ba7..96980132f4 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/lightindicator.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/lightindicator.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") local travelSpeedIndicator = { Identifier = "TravelSpeedIndicator-2000", diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/magnetogram_textures.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/magnetogram_textures.asset index 4b91b6f5f4..c6b8df79c5 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/magnetogram_textures.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/magnetogram_textures.asset @@ -1,15 +1,15 @@ -local assetHelper = asset.require('util/asset_helper') -local sun = asset.require('scene/solarsystem/sun/sun') +local assetHelper = asset.require("util/asset_helper") +local sun = asset.require("scene/solarsystem/sun/sun") -- synced directories -local magnetogramDirectory = asset.require('./magnetogram').TexturesPath; +local magnetogramDirectory = asset.require("./magnetogram").TexturesPath; local magnetograms; local switch_color_layer = { Identifier = "magnetogram_texture.switch_color_layer", Name = "Next sun texture", Command = [[ - local textureList = openspace.globebrowsing.getLayers('Sun', 'ColorLayers'); + local textureList = openspace.globebrowsing.getLayers("Sun", "ColorLayers"); if (magnetogramsTextureIndex == -1) then magnetogramsTextureIndex = 2; end; @@ -35,8 +35,8 @@ asset.onInitialize(function () rawset(_G, "magnetogramsTextureIndex", -1) for i, imagename in ipairs(magnetograms) do openspace.globebrowsing.addLayer( - 'Sun', - 'ColorLayers', + "Sun", + "ColorLayers", { Identifier = "magnetogram-" .. i, Name = imagename, --"Magnetogram-" .. i, @@ -53,7 +53,7 @@ end) asset.onDeinitialize(function () for i, imagename in ipairs(magnetograms) do openspace.globebrowsing.deleteLayer( - 'Sun', 'ColorLayers', 'magnetogram-' .. i + "Sun", "ColorLayers", "magnetogram-" .. i ) end openspace.action.removeAction(switch_color_layer.Identifier) diff --git a/data/assets/scene/solarsystem/interstellar/c-2019_q4_borisov.asset b/data/assets/scene/solarsystem/interstellar/c-2019_q4_borisov.asset index 06e06d5a08..86f48785f6 100644 --- a/data/assets/scene/solarsystem/interstellar/c-2019_q4_borisov.asset +++ b/data/assets/scene/solarsystem/interstellar/c-2019_q4_borisov.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local trajectory = asset.syncedResource({ Name = "C-2019 Q4 Borisov Trajectory", diff --git a/data/assets/scene/solarsystem/interstellar/oumuamua.asset b/data/assets/scene/solarsystem/interstellar/oumuamua.asset index bb1714c64f..d3a9abc32b 100644 --- a/data/assets/scene/solarsystem/interstellar/oumuamua.asset +++ b/data/assets/scene/solarsystem/interstellar/oumuamua.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local trajectory = asset.syncedResource({ Name = "'Oumuamua Trajectory", diff --git a/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset b/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset index cf1ef5f56e..f88fef0bd7 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/apollo11.asset @@ -1,11 +1,12 @@ -local asset_helper = asset.require('util/asset_helper') -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local moon_transforms = asset.require('scene/solarsystem/planets/earth/moon/moon') +local asset_helper = asset.require("util/asset_helper") +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +local moon_transforms = asset.require("scene/solarsystem/planets/earth/moon/moon") -local descentKeyframes = asset.require('./lem_descent.asset') -local descentRotationKeyframes = asset.require('./lem_descent_rotation.asset') +local descentKeyframes = asset.require("./lem_descent.asset") +local descentRotationKeyframes = asset.require("./lem_descent_rotation.asset") -local kernels = asset.require('./kernels').kernels +local kernels = asset.require("./kernels").kernels +asset.require("spice/base") local models = asset.syncedResource({ Name = "Apollo Models", @@ -21,7 +22,6 @@ local lem_model = asset.syncedResource({ Version = 4 }) -asset.require('spice/base') --landing - 1969-07-20T20:17:40 local apolloSpiceId = "-911" @@ -108,14 +108,14 @@ local lemTranslation = { -- 20:14:30 is an arbitrary cutoff, but last 4 minutes data in descentKeyframes -- begins at 20.14.40. Due to linear interpolation, we will get -- a 10s linear transition to the location where the descentKeyframes start. - ['1969 JUL 20 20:14:30'] = { + ["1969 JUL 20 20:14:30"] = { Type = "SpiceTranslation", Target = apolloLemSpiceId, Observer = "MOON", Frame = "IAU_MOON", Kernels = kernels }, - ['1969 JUL 20 20:14:40'] = { + ["1969 JUL 20 20:14:40"] = { Type = "TimelineTranslation", Keyframes = descentKeyframes.keyframes } diff --git a/data/assets/scene/solarsystem/missions/apollo/11/kernels.asset b/data/assets/scene/solarsystem/missions/apollo/11/kernels.asset index 94bfb09c7c..e4aee05f27 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/kernels.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/kernels.asset @@ -13,4 +13,4 @@ local kernels = { kernelsFolder .. "apollo11_orbits_lm9km.bsp" } -asset.export('kernels', kernels) +asset.export("kernels", kernels) diff --git a/data/assets/scene/solarsystem/missions/apollo/11/lem.asset b/data/assets/scene/solarsystem/missions/apollo/11/lem.asset index 85ae896a16..cca59d8db6 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/lem.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/lem.asset @@ -1,7 +1,7 @@ -- a11_lem.asset -local asset_helper = asset.require('util/asset_helper') -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') +local asset_helper = asset.require("util/asset_helper") +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +local moon_asset = asset.require("scene/solarsystem/planets/earth/moon/moon") local lem_model = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/missions/apollo/11/lem_descent.asset b/data/assets/scene/solarsystem/missions/apollo/11/lem_descent.asset index 36189888fb..eb7f6a2533 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/lem_descent.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/lem_descent.asset @@ -13,7 +13,7 @@ In the conversion, some assumptions and simplifications were made: ]]-- local keyframes = { - ['1969-07-20T20:13:40'] = { + ["1969-07-20T20:13:40"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.64480784327766, @@ -21,7 +21,7 @@ local keyframes = { Altitude = -1546.3568594681615, UseHeightmap = false }, - ['1969-07-20T20:13:41'] = { + ["1969-07-20T20:13:41"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.64371058653857, @@ -29,7 +29,7 @@ local keyframes = { Altitude = -1565.4215164947534, UseHeightmap = false }, - ['1969-07-20T20:13:42'] = { + ["1969-07-20T20:13:42"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.64182673932963, @@ -37,7 +37,7 @@ local keyframes = { Altitude = -1565.4215164947534, UseHeightmap = false }, - ['1969-07-20T20:13:43'] = { + ["1969-07-20T20:13:43"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.64054706630478, @@ -45,7 +45,7 @@ local keyframes = { Altitude = -1579.0391286566048, UseHeightmap = false }, - ['1969-07-20T20:13:44'] = { + ["1969-07-20T20:13:44"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.63636509003987, @@ -53,7 +53,7 @@ local keyframes = { Altitude = -1579.0391286566048, UseHeightmap = false }, - ['1969-07-20T20:13:45'] = { + ["1969-07-20T20:13:45"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.63333610553231, @@ -61,7 +61,7 @@ local keyframes = { Altitude = -1584.4861735213453, UseHeightmap = false }, - ['1969-07-20T20:13:46'] = { + ["1969-07-20T20:13:46"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.630258198415152, @@ -69,7 +69,7 @@ local keyframes = { Altitude = -1587.2096959537155, UseHeightmap = false }, - ['1969-07-20T20:13:47'] = { + ["1969-07-20T20:13:47"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.62944534804935, @@ -77,7 +77,7 @@ local keyframes = { Altitude = -1592.656740818456, UseHeightmap = false }, - ['1969-07-20T20:13:48'] = { + ["1969-07-20T20:13:48"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.62679291745059, @@ -85,7 +85,7 @@ local keyframes = { Altitude = -1604.9125917641222, UseHeightmap = false }, - ['1969-07-20T20:13:49'] = { + ["1969-07-20T20:13:49"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.624085315638872, @@ -93,7 +93,7 @@ local keyframes = { Altitude = -1619.8919651421588, UseHeightmap = false }, - ['1969-07-20T20:13:50'] = { + ["1969-07-20T20:13:50"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.62142772795633, @@ -101,7 +101,7 @@ local keyframes = { Altitude = -1630.7860548716399, UseHeightmap = false }, - ['1969-07-20T20:13:51'] = { + ["1969-07-20T20:13:51"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.617193313827283, @@ -109,7 +109,7 @@ local keyframes = { Altitude = -1630.7860548716399, UseHeightmap = false }, - ['1969-07-20T20:13:52'] = { + ["1969-07-20T20:13:52"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.61543137875974, @@ -117,7 +117,7 @@ local keyframes = { Altitude = -1629.4242936554547, UseHeightmap = false }, - ['1969-07-20T20:13:53'] = { + ["1969-07-20T20:13:53"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.61158202958536, @@ -125,7 +125,7 @@ local keyframes = { Altitude = -1633.5095773040102, UseHeightmap = false }, - ['1969-07-20T20:13:54'] = { + ["1969-07-20T20:13:54"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.60991413189263, @@ -133,7 +133,7 @@ local keyframes = { Altitude = -1643.041905817306, UseHeightmap = false }, - ['1969-07-20T20:13:55'] = { + ["1969-07-20T20:13:55"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.607915527643012, @@ -141,7 +141,7 @@ local keyframes = { Altitude = -1662.106562843898, UseHeightmap = false }, - ['1969-07-20T20:13:56'] = { + ["1969-07-20T20:13:56"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.605996916437142, @@ -149,7 +149,7 @@ local keyframes = { Altitude = -1663.4683240600832, UseHeightmap = false }, - ['1969-07-20T20:13:57'] = { + ["1969-07-20T20:13:57"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.6027345854584, @@ -157,7 +157,7 @@ local keyframes = { Altitude = -1671.09418687072, UseHeightmap = false }, - ['1969-07-20T20:13:58'] = { + ["1969-07-20T20:13:58"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.60047452065999, @@ -165,7 +165,7 @@ local keyframes = { Altitude = -1671.638891357194, UseHeightmap = false }, - ['1969-07-20T20:13:59'] = { + ["1969-07-20T20:13:59"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.598006245556462, @@ -173,7 +173,7 @@ local keyframes = { Altitude = -1670.277130141009, UseHeightmap = false }, - ['1969-07-20T20:14:00'] = { + ["1969-07-20T20:14:00"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.594980604909782, @@ -181,7 +181,7 @@ local keyframes = { Altitude = -1683.8947423028603, UseHeightmap = false }, - ['1969-07-20T20:14:01'] = { + ["1969-07-20T20:14:01"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.595085912567033, @@ -189,7 +189,7 @@ local keyframes = { Altitude = -1698.874115680897, UseHeightmap = false }, - ['1969-07-20T20:14:02'] = { + ["1969-07-20T20:14:02"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.5930664955042, @@ -197,7 +197,7 @@ local keyframes = { Altitude = -1701.597638113267, UseHeightmap = false }, - ['1969-07-20T20:14:03'] = { + ["1969-07-20T20:14:03"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.591385100243283, @@ -205,7 +205,7 @@ local keyframes = { Altitude = -1709.768205410378, UseHeightmap = false }, - ['1969-07-20T20:14:04'] = { + ["1969-07-20T20:14:04"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.58888799865371, @@ -213,7 +213,7 @@ local keyframes = { Altitude = -1717.9387727074889, UseHeightmap = false }, - ['1969-07-20T20:14:05'] = { + ["1969-07-20T20:14:05"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.58707895840121, @@ -221,7 +221,7 @@ local keyframes = { Altitude = -1720.662295139859, UseHeightmap = false }, - ['1969-07-20T20:14:06'] = { + ["1969-07-20T20:14:06"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.585134523523262, @@ -229,7 +229,7 @@ local keyframes = { Altitude = -1726.1093400045995, UseHeightmap = false }, - ['1969-07-20T20:14:07'] = { + ["1969-07-20T20:14:07"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.58309233633901, @@ -237,7 +237,7 @@ local keyframes = { Altitude = -1730.194623653155, UseHeightmap = false }, - ['1969-07-20T20:14:08'] = { + ["1969-07-20T20:14:08"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.581800658763132, @@ -245,7 +245,7 @@ local keyframes = { Altitude = -1737.0034297340808, UseHeightmap = false }, - ['1969-07-20T20:14:09'] = { + ["1969-07-20T20:14:09"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.580055660445762, @@ -253,7 +253,7 @@ local keyframes = { Altitude = -1741.0887133826361, UseHeightmap = false }, - ['1969-07-20T20:14:10'] = { + ["1969-07-20T20:14:10"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.57863282556605, @@ -261,7 +261,7 @@ local keyframes = { Altitude = -1749.259280679747, UseHeightmap = false }, - ['1969-07-20T20:14:11'] = { + ["1969-07-20T20:14:11"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.57640031861404, @@ -269,7 +269,7 @@ local keyframes = { Altitude = -1751.9828031121174, UseHeightmap = false }, - ['1969-07-20T20:14:12'] = { + ["1969-07-20T20:14:12"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.57398679174075, @@ -277,7 +277,7 @@ local keyframes = { Altitude = -1750.6210418959322, UseHeightmap = false }, - ['1969-07-20T20:14:13'] = { + ["1969-07-20T20:14:13"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.57156483164977, @@ -285,7 +285,7 @@ local keyframes = { Altitude = -1758.7916091930429, UseHeightmap = false }, - ['1969-07-20T20:14:14'] = { + ["1969-07-20T20:14:14"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.568805614344672, @@ -293,7 +293,7 @@ local keyframes = { Altitude = -1764.2386540577836, UseHeightmap = false }, - ['1969-07-20T20:14:15'] = { + ["1969-07-20T20:14:15"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.56712274763365, @@ -301,7 +301,7 @@ local keyframes = { Altitude = -1764.2386540577836, UseHeightmap = false }, - ['1969-07-20T20:14:16'] = { + ["1969-07-20T20:14:16"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.56530723506546, @@ -309,7 +309,7 @@ local keyframes = { Altitude = -1772.4092213548943, UseHeightmap = false }, - ['1969-07-20T20:14:17'] = { + ["1969-07-20T20:14:17"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.56412162578659, @@ -317,7 +317,7 @@ local keyframes = { Altitude = -1773.7709825710795, UseHeightmap = false }, - ['1969-07-20T20:14:18'] = { + ["1969-07-20T20:14:18"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.56276962682385, @@ -325,7 +325,7 @@ local keyframes = { Altitude = -1779.2180274358202, UseHeightmap = false }, - ['1969-07-20T20:14:19'] = { + ["1969-07-20T20:14:19"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.560994966586822, @@ -333,7 +333,7 @@ local keyframes = { Altitude = -1781.9415498681901, UseHeightmap = false }, - ['1969-07-20T20:14:20'] = { + ["1969-07-20T20:14:20"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.55943927760013, @@ -341,7 +341,7 @@ local keyframes = { Altitude = -1788.7503559491158, UseHeightmap = false }, - ['1969-07-20T20:14:21'] = { + ["1969-07-20T20:14:21"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.55808185917876, @@ -349,7 +349,7 @@ local keyframes = { Altitude = -1788.205651462642, UseHeightmap = false }, - ['1969-07-20T20:14:22'] = { + ["1969-07-20T20:14:22"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.556393791415733, @@ -357,7 +357,7 @@ local keyframes = { Altitude = -1791.4738783814862, UseHeightmap = false }, - ['1969-07-20T20:14:23'] = { + ["1969-07-20T20:14:23"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.55496480157647, @@ -365,7 +365,7 @@ local keyframes = { Altitude = -1792.8356395976714, UseHeightmap = false }, - ['1969-07-20T20:14:24'] = { + ["1969-07-20T20:14:24"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.55306742293409, @@ -373,7 +373,7 @@ local keyframes = { Altitude = -1795.5591620300418, UseHeightmap = false }, - ['1969-07-20T20:14:25'] = { + ["1969-07-20T20:14:25"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.55137129589691, @@ -381,7 +381,7 @@ local keyframes = { Altitude = -1802.3679681109675, UseHeightmap = false }, - ['1969-07-20T20:14:26'] = { + ["1969-07-20T20:14:26"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.54977453252549, @@ -389,7 +389,7 @@ local keyframes = { Altitude = -1805.0914905433376, UseHeightmap = false }, - ['1969-07-20T20:14:27'] = { + ["1969-07-20T20:14:27"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.548083879890072, @@ -397,7 +397,7 @@ local keyframes = { Altitude = -1807.8150129757078, UseHeightmap = false }, - ['1969-07-20T20:14:28'] = { + ["1969-07-20T20:14:28"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.546540200146502, @@ -405,7 +405,7 @@ local keyframes = { Altitude = -1810.5385354080781, UseHeightmap = false }, - ['1969-07-20T20:14:29'] = { + ["1969-07-20T20:14:29"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.54516644867878, @@ -413,7 +413,7 @@ local keyframes = { Altitude = -1815.9855802728187, UseHeightmap = false }, - ['1969-07-20T20:14:30'] = { + ["1969-07-20T20:14:30"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.54408346592703, @@ -421,7 +421,7 @@ local keyframes = { Altitude = -1817.3473414890038, UseHeightmap = false }, - ['1969-07-20T20:14:31'] = { + ["1969-07-20T20:14:31"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.54339758182375, @@ -429,7 +429,7 @@ local keyframes = { Altitude = -1818.709102705189, UseHeightmap = false }, - ['1969-07-20T20:14:32'] = { + ["1969-07-20T20:14:32"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.54194570925206, @@ -437,7 +437,7 @@ local keyframes = { Altitude = -1821.4326251375592, UseHeightmap = false }, - ['1969-07-20T20:14:33'] = { + ["1969-07-20T20:14:33"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.54085221251783, @@ -445,7 +445,7 @@ local keyframes = { Altitude = -1824.9732042996407, UseHeightmap = false }, - ['1969-07-20T20:14:34'] = { + ["1969-07-20T20:14:34"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.53954140597472, @@ -453,7 +453,7 @@ local keyframes = { Altitude = -1827.696726732011, UseHeightmap = false }, - ['1969-07-20T20:14:35'] = { + ["1969-07-20T20:14:35"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.537934104316932, @@ -461,7 +461,7 @@ local keyframes = { Altitude = -1831.7820103805664, UseHeightmap = false }, - ['1969-07-20T20:14:36'] = { + ["1969-07-20T20:14:36"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.53689199133522, @@ -469,7 +469,7 @@ local keyframes = { Altitude = -1833.6884760832256, UseHeightmap = false }, - ['1969-07-20T20:14:37'] = { + ["1969-07-20T20:14:37"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.53536814560564, @@ -477,7 +477,7 @@ local keyframes = { Altitude = -1836.9567030020698, UseHeightmap = false }, - ['1969-07-20T20:14:38'] = { + ["1969-07-20T20:14:38"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.53395331216349, @@ -485,7 +485,7 @@ local keyframes = { Altitude = -1839.4078731912032, UseHeightmap = false }, - ['1969-07-20T20:14:39'] = { + ["1969-07-20T20:14:39"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.53275788877434, @@ -493,7 +493,7 @@ local keyframes = { Altitude = -1840.497282164151, UseHeightmap = false }, - ['1969-07-20T20:14:40'] = { + ["1969-07-20T20:14:40"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.531279977460432, @@ -501,7 +501,7 @@ local keyframes = { Altitude = -1844.5825658127067, UseHeightmap = false }, - ['1969-07-20T20:14:41'] = { + ["1969-07-20T20:14:41"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.52959475512685, @@ -509,7 +509,7 @@ local keyframes = { Altitude = -1845.9443270288918, UseHeightmap = false }, - ['1969-07-20T20:14:42'] = { + ["1969-07-20T20:14:42"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.52769228385669, @@ -517,7 +517,7 @@ local keyframes = { Altitude = -1848.123144974788, UseHeightmap = false }, - ['1969-07-20T20:14:43'] = { + ["1969-07-20T20:14:43"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.52685377337869, @@ -525,7 +525,7 @@ local keyframes = { Altitude = -1850.8466674071583, UseHeightmap = false }, - ['1969-07-20T20:14:44'] = { + ["1969-07-20T20:14:44"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.526284004538702, @@ -533,7 +533,7 @@ local keyframes = { Altitude = -1853.0254853530546, UseHeightmap = false }, - ['1969-07-20T20:14:45'] = { + ["1969-07-20T20:14:45"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.5258419320743, @@ -541,7 +541,7 @@ local keyframes = { Altitude = -1852.2084286233435, UseHeightmap = false }, - ['1969-07-20T20:14:46'] = { + ["1969-07-20T20:14:46"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.524906401275462, @@ -549,7 +549,7 @@ local keyframes = { Altitude = -1855.7490077854247, UseHeightmap = false }, - ['1969-07-20T20:14:47'] = { + ["1969-07-20T20:14:47"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.52349915098792, @@ -557,7 +557,7 @@ local keyframes = { Altitude = -1857.383121244847, UseHeightmap = false }, - ['1969-07-20T20:14:48'] = { + ["1969-07-20T20:14:48"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.522315823805602, @@ -565,7 +565,7 @@ local keyframes = { Altitude = -1859.5619391907433, UseHeightmap = false }, - ['1969-07-20T20:14:49'] = { + ["1969-07-20T20:14:49"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.52101739233993, @@ -573,7 +573,7 @@ local keyframes = { Altitude = -1862.2854616231134, UseHeightmap = false }, - ['1969-07-20T20:14:50'] = { + ["1969-07-20T20:14:50"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.51994166433182, @@ -581,7 +581,7 @@ local keyframes = { Altitude = -1864.7366318122467, UseHeightmap = false }, - ['1969-07-20T20:14:51'] = { + ["1969-07-20T20:14:51"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.51898851685442, @@ -589,7 +589,7 @@ local keyframes = { Altitude = -1866.643097514906, UseHeightmap = false }, - ['1969-07-20T20:14:52'] = { + ["1969-07-20T20:14:52"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.51808183367586, @@ -597,7 +597,7 @@ local keyframes = { Altitude = -1868.821915460802, UseHeightmap = false }, - ['1969-07-20T20:14:53'] = { + ["1969-07-20T20:14:53"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.517315195124922, @@ -605,7 +605,7 @@ local keyframes = { Altitude = -1869.6389721905132, UseHeightmap = false }, - ['1969-07-20T20:14:54'] = { + ["1969-07-20T20:14:54"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.516423288093712, @@ -613,7 +613,7 @@ local keyframes = { Altitude = -1872.0901423796465, UseHeightmap = false }, - ['1969-07-20T20:14:55'] = { + ["1969-07-20T20:14:55"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.515618488386473, @@ -621,7 +621,7 @@ local keyframes = { Altitude = -1873.7242558390685, UseHeightmap = false }, - ['1969-07-20T20:14:56'] = { + ["1969-07-20T20:14:56"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.514931748492103, @@ -629,7 +629,7 @@ local keyframes = { Altitude = -1875.0860170552537, UseHeightmap = false }, - ['1969-07-20T20:14:57'] = { + ["1969-07-20T20:14:57"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.5141592094038, @@ -637,7 +637,7 @@ local keyframes = { Altitude = -1876.1754260282019, UseHeightmap = false }, - ['1969-07-20T20:14:58'] = { + ["1969-07-20T20:14:58"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.513268517407862, @@ -645,7 +645,7 @@ local keyframes = { Altitude = -1878.3542439740982, UseHeightmap = false }, - ['1969-07-20T20:14:59'] = { + ["1969-07-20T20:14:59"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.51249864236425, @@ -653,7 +653,7 @@ local keyframes = { Altitude = -1878.8989484605722, UseHeightmap = false }, - ['1969-07-20T20:15:00'] = { + ["1969-07-20T20:15:00"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.511670817073732, @@ -661,7 +661,7 @@ local keyframes = { Altitude = -1879.9883574335202, UseHeightmap = false }, - ['1969-07-20T20:15:01'] = { + ["1969-07-20T20:15:01"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.510927468201952, @@ -669,7 +669,7 @@ local keyframes = { Altitude = -1881.0777664064683, UseHeightmap = false }, - ['1969-07-20T20:15:02'] = { + ["1969-07-20T20:15:02"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.510140364179833, @@ -677,7 +677,7 @@ local keyframes = { Altitude = -1882.9842321091276, UseHeightmap = false }, - ['1969-07-20T20:15:03'] = { + ["1969-07-20T20:15:03"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50940612514804, @@ -685,7 +685,7 @@ local keyframes = { Altitude = -1884.3459933253127, UseHeightmap = false }, - ['1969-07-20T20:15:04'] = { + ["1969-07-20T20:15:04"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.508556629045042, @@ -693,7 +693,7 @@ local keyframes = { Altitude = -1885.1630500550239, UseHeightmap = false }, - ['1969-07-20T20:15:05'] = { + ["1969-07-20T20:15:05"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.5078270022667, @@ -701,7 +701,7 @@ local keyframes = { Altitude = -1885.707754541498, UseHeightmap = false }, - ['1969-07-20T20:15:06'] = { + ["1969-07-20T20:15:06"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50712374883535, @@ -709,7 +709,7 @@ local keyframes = { Altitude = -1886.7971635144459, UseHeightmap = false }, - ['1969-07-20T20:15:07'] = { + ["1969-07-20T20:15:07"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50638631083077, @@ -717,7 +717,7 @@ local keyframes = { Altitude = -1888.158924730631, UseHeightmap = false }, - ['1969-07-20T20:15:08'] = { + ["1969-07-20T20:15:08"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50572166907488, @@ -725,7 +725,7 @@ local keyframes = { Altitude = -1888.431276973868, UseHeightmap = false }, - ['1969-07-20T20:15:09'] = { + ["1969-07-20T20:15:09"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.505080467779102, @@ -733,7 +733,7 @@ local keyframes = { Altitude = -1889.5206859468162, UseHeightmap = false }, - ['1969-07-20T20:15:10'] = { + ["1969-07-20T20:15:10"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.504394828536693, @@ -741,7 +741,7 @@ local keyframes = { Altitude = -1890.6100949197644, UseHeightmap = false }, - ['1969-07-20T20:15:11'] = { + ["1969-07-20T20:15:11"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50370057106609, @@ -749,7 +749,7 @@ local keyframes = { Altitude = -1891.9718561359496, UseHeightmap = false }, - ['1969-07-20T20:15:12'] = { + ["1969-07-20T20:15:12"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.503056349392182, @@ -757,7 +757,7 @@ local keyframes = { Altitude = -1893.3336173521345, UseHeightmap = false }, - ['1969-07-20T20:15:13'] = { + ["1969-07-20T20:15:13"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50246925266341, @@ -765,7 +765,7 @@ local keyframes = { Altitude = -1893.8783218386086, UseHeightmap = false }, - ['1969-07-20T20:15:14'] = { + ["1969-07-20T20:15:14"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50184956306549, @@ -773,7 +773,7 @@ local keyframes = { Altitude = -1894.9677308115567, UseHeightmap = false }, - ['1969-07-20T20:15:15'] = { + ["1969-07-20T20:15:15"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.501422630419572, @@ -781,7 +781,7 @@ local keyframes = { Altitude = -1894.1506740818456, UseHeightmap = false }, - ['1969-07-20T20:15:16'] = { + ["1969-07-20T20:15:16"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50104221348722, @@ -789,7 +789,7 @@ local keyframes = { Altitude = -1893.8783218386086, UseHeightmap = false }, - ['1969-07-20T20:15:17'] = { + ["1969-07-20T20:15:17"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50076948252455, @@ -797,7 +797,7 @@ local keyframes = { Altitude = -1892.2442083791866, UseHeightmap = false }, - ['1969-07-20T20:15:18'] = { + ["1969-07-20T20:15:18"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.50013364513089, @@ -805,7 +805,7 @@ local keyframes = { Altitude = -1893.3336173521345, UseHeightmap = false }, - ['1969-07-20T20:15:19'] = { + ["1969-07-20T20:15:19"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.499460285339502, @@ -813,7 +813,7 @@ local keyframes = { Altitude = -1894.9677308115567, UseHeightmap = false }, - ['1969-07-20T20:15:20'] = { + ["1969-07-20T20:15:20"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.498899330647752, @@ -821,7 +821,7 @@ local keyframes = { Altitude = -1896.057139784505, UseHeightmap = false }, - ['1969-07-20T20:15:21'] = { + ["1969-07-20T20:15:21"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.49826864115494, @@ -829,7 +829,7 @@ local keyframes = { Altitude = -1896.601844270979, UseHeightmap = false }, - ['1969-07-20T20:15:22'] = { + ["1969-07-20T20:15:22"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.49765193973772, @@ -837,7 +837,7 @@ local keyframes = { Altitude = -1897.41890100069, UseHeightmap = false }, - ['1969-07-20T20:15:23'] = { + ["1969-07-20T20:15:23"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.49706547748806, @@ -845,7 +845,7 @@ local keyframes = { Altitude = -1898.2359577304012, UseHeightmap = false }, - ['1969-07-20T20:15:24'] = { + ["1969-07-20T20:15:24"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.496489420526313, @@ -853,7 +853,7 @@ local keyframes = { Altitude = -1899.053014460112, UseHeightmap = false }, - ['1969-07-20T20:15:25'] = { + ["1969-07-20T20:15:25"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.495878153012562, @@ -861,7 +861,7 @@ local keyframes = { Altitude = -1900.1424234330602, UseHeightmap = false }, - ['1969-07-20T20:15:26'] = { + ["1969-07-20T20:15:26"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.4953425244022, @@ -869,7 +869,7 @@ local keyframes = { Altitude = -1901.5041846492454, UseHeightmap = false }, - ['1969-07-20T20:15:27'] = { + ["1969-07-20T20:15:27"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.494725217962213, @@ -877,7 +877,7 @@ local keyframes = { Altitude = -1902.5935936221936, UseHeightmap = false }, - ['1969-07-20T20:15:28'] = { + ["1969-07-20T20:15:28"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.494112443564592, @@ -885,7 +885,7 @@ local keyframes = { Altitude = -1903.4106503519047, UseHeightmap = false }, - ['1969-07-20T20:15:29'] = { + ["1969-07-20T20:15:29"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.493537644480202, @@ -893,7 +893,7 @@ local keyframes = { Altitude = -1903.9553548383788, UseHeightmap = false }, - ['1969-07-20T20:15:30'] = { + ["1969-07-20T20:15:30"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.49299719757025, @@ -901,7 +901,7 @@ local keyframes = { Altitude = -1903.9553548383788, UseHeightmap = false }, - ['1969-07-20T20:15:31'] = { + ["1969-07-20T20:15:31"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.492415313069813, @@ -909,7 +909,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:32'] = { + ["1969-07-20T20:15:32"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.491877755110142, @@ -917,7 +917,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:33'] = { + ["1969-07-20T20:15:33"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.49128819308786, @@ -925,7 +925,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:34'] = { + ["1969-07-20T20:15:34"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.49073158429634, @@ -933,7 +933,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:35'] = { + ["1969-07-20T20:15:35"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.490174891596332, @@ -941,7 +941,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:36'] = { + ["1969-07-20T20:15:36"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.489635065407523, @@ -949,7 +949,7 @@ local keyframes = { Altitude = -1904.5000593248528, UseHeightmap = false }, - ['1969-07-20T20:15:37'] = { + ["1969-07-20T20:15:37"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.4891060535486, @@ -957,7 +957,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:38'] = { + ["1969-07-20T20:15:38"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48855436619652, @@ -965,7 +965,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:39'] = { + ["1969-07-20T20:15:39"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.488052711552413, @@ -973,7 +973,7 @@ local keyframes = { Altitude = -1904.5000593248528, UseHeightmap = false }, - ['1969-07-20T20:15:40'] = { + ["1969-07-20T20:15:40"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48754943516269, @@ -981,7 +981,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:41'] = { + ["1969-07-20T20:15:41"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.487094304824993, @@ -989,7 +989,7 @@ local keyframes = { Altitude = -1904.2277070816158, UseHeightmap = false }, - ['1969-07-20T20:15:42'] = { + ["1969-07-20T20:15:42"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.486618165034592, @@ -997,7 +997,7 @@ local keyframes = { Altitude = -1904.7724115680899, UseHeightmap = false }, - ['1969-07-20T20:15:43'] = { + ["1969-07-20T20:15:43"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48604740534131, @@ -1005,7 +1005,7 @@ local keyframes = { Altitude = -1905.3171160545637, UseHeightmap = false }, - ['1969-07-20T20:15:44'] = { + ["1969-07-20T20:15:44"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48548248435554, @@ -1013,7 +1013,7 @@ local keyframes = { Altitude = -1905.8618205410378, UseHeightmap = false }, - ['1969-07-20T20:15:45'] = { + ["1969-07-20T20:15:45"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48494957486896, @@ -1021,7 +1021,7 @@ local keyframes = { Altitude = -1905.8618205410378, UseHeightmap = false }, - ['1969-07-20T20:15:46'] = { + ["1969-07-20T20:15:46"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.484598386683622, @@ -1029,7 +1029,7 @@ local keyframes = { Altitude = -1907.49593400046, UseHeightmap = false }, - ['1969-07-20T20:15:47'] = { + ["1969-07-20T20:15:47"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.4841269963268, @@ -1037,7 +1037,7 @@ local keyframes = { Altitude = -1908.040638486934, UseHeightmap = false }, - ['1969-07-20T20:15:48'] = { + ["1969-07-20T20:15:48"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48373390336955, @@ -1045,7 +1045,7 @@ local keyframes = { Altitude = -1908.8576952166452, UseHeightmap = false }, - ['1969-07-20T20:15:49'] = { + ["1969-07-20T20:15:49"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48325134882829, @@ -1053,7 +1053,7 @@ local keyframes = { Altitude = -1908.4491668517896, UseHeightmap = false }, - ['1969-07-20T20:15:50'] = { + ["1969-07-20T20:15:50"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48284574619883, @@ -1061,7 +1061,7 @@ local keyframes = { Altitude = -1909.1300474598822, UseHeightmap = false }, - ['1969-07-20T20:15:51'] = { + ["1969-07-20T20:15:51"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48245362823393, @@ -1069,7 +1069,7 @@ local keyframes = { Altitude = -1909.4023997031193, UseHeightmap = false }, - ['1969-07-20T20:15:52'] = { + ["1969-07-20T20:15:52"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.482060114185842, @@ -1077,7 +1077,7 @@ local keyframes = { Altitude = -1909.6747519463563, UseHeightmap = false }, - ['1969-07-20T20:15:53'] = { + ["1969-07-20T20:15:53"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.481698202127482, @@ -1085,7 +1085,7 @@ local keyframes = { Altitude = -1909.6747519463563, UseHeightmap = false }, - ['1969-07-20T20:15:54'] = { + ["1969-07-20T20:15:54"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48129046365451, @@ -1093,7 +1093,7 @@ local keyframes = { Altitude = -1909.6747519463563, UseHeightmap = false }, - ['1969-07-20T20:15:55'] = { + ["1969-07-20T20:15:55"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.480893026154902, @@ -1101,7 +1101,7 @@ local keyframes = { Altitude = -1909.6747519463563, UseHeightmap = false }, - ['1969-07-20T20:15:56'] = { + ["1969-07-20T20:15:56"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48059324160945, @@ -1109,7 +1109,7 @@ local keyframes = { Altitude = -1909.6747519463563, UseHeightmap = false }, - ['1969-07-20T20:15:57'] = { + ["1969-07-20T20:15:57"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48034984354739, @@ -1117,7 +1117,7 @@ local keyframes = { Altitude = -1909.6747519463563, UseHeightmap = false }, - ['1969-07-20T20:15:58'] = { + ["1969-07-20T20:15:58"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.48005268645993, @@ -1125,7 +1125,7 @@ local keyframes = { Altitude = -1909.6747519463563, UseHeightmap = false }, - ['1969-07-20T20:15:59'] = { + ["1969-07-20T20:15:59"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47978070153665, @@ -1133,7 +1133,7 @@ local keyframes = { Altitude = -1909.9471041895933, UseHeightmap = false }, - ['1969-07-20T20:16:00'] = { + ["1969-07-20T20:16:00"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47951311851127, @@ -1141,7 +1141,7 @@ local keyframes = { Altitude = -1909.9471041895933, UseHeightmap = false }, - ['1969-07-20T20:16:01'] = { + ["1969-07-20T20:16:01"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47927978098579, @@ -1149,7 +1149,7 @@ local keyframes = { Altitude = -1909.9471041895933, UseHeightmap = false }, - ['1969-07-20T20:16:02'] = { + ["1969-07-20T20:16:02"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47904250519933, @@ -1157,7 +1157,7 @@ local keyframes = { Altitude = -1910.4918086760674, UseHeightmap = false }, - ['1969-07-20T20:16:03'] = { + ["1969-07-20T20:16:03"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47879202998348, @@ -1165,7 +1165,7 @@ local keyframes = { Altitude = -1910.7641609193045, UseHeightmap = false }, - ['1969-07-20T20:16:04'] = { + ["1969-07-20T20:16:04"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.478567222437622, @@ -1173,7 +1173,7 @@ local keyframes = { Altitude = -1910.7641609193045, UseHeightmap = false }, - ['1969-07-20T20:16:05'] = { + ["1969-07-20T20:16:05"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47836548542964, @@ -1181,7 +1181,7 @@ local keyframes = { Altitude = -1910.7641609193045, UseHeightmap = false }, - ['1969-07-20T20:16:06'] = { + ["1969-07-20T20:16:06"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47818769774975, @@ -1189,7 +1189,7 @@ local keyframes = { Altitude = -1911.3088654057785, UseHeightmap = false }, - ['1969-07-20T20:16:07'] = { + ["1969-07-20T20:16:07"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.477896613823983, @@ -1197,7 +1197,7 @@ local keyframes = { Altitude = -1913.2153311084376, UseHeightmap = false }, - ['1969-07-20T20:16:08'] = { + ["1969-07-20T20:16:08"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47781195503974, @@ -1205,7 +1205,7 @@ local keyframes = { Altitude = -1913.2153311084376, UseHeightmap = false }, - ['1969-07-20T20:16:09'] = { + ["1969-07-20T20:16:09"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.477664452707373, @@ -1213,7 +1213,7 @@ local keyframes = { Altitude = -1914.0323878381487, UseHeightmap = false }, - -- ['1969-07-20T20:16:10'] = { + -- ["1969-07-20T20:16:10"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.477750217762413, @@ -1221,7 +1221,7 @@ local keyframes = { -- Altitude = -1912.6706266219635, -- UseHeightmap = false -- }, - -- ['1969-07-20T20:16:11'] = { + -- ["1969-07-20T20:16:11"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.477590925415402, @@ -1229,7 +1229,7 @@ local keyframes = { -- Altitude = -1912.6706266219635, -- UseHeightmap = false -- }, - -- ['1969-07-20T20:16:12'] = { + -- ["1969-07-20T20:16:12"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.47745952757753, @@ -1237,7 +1237,7 @@ local keyframes = { -- Altitude = -1912.6706266219635, -- UseHeightmap = false -- }, - -- ['1969-07-20T20:16:13'] = { + -- ["1969-07-20T20:16:13"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.477271343369093, @@ -1245,7 +1245,7 @@ local keyframes = { -- Altitude = -1913.2153311084376, -- UseHeightmap = false -- }, - -- ['1969-07-20T20:16:14'] = { + -- ["1969-07-20T20:16:14"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.477100932665042, @@ -1253,7 +1253,7 @@ local keyframes = { -- Altitude = -1914.3047400813857, -- UseHeightmap = false -- }, - ['1969-07-20T20:16:15'] = { + ["1969-07-20T20:16:15"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47697690593997, @@ -1261,7 +1261,7 @@ local keyframes = { Altitude = -1914.8494445678598, UseHeightmap = false }, - ['1969-07-20T20:16:16'] = { + ["1969-07-20T20:16:16"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.476842953277412, @@ -1269,7 +1269,7 @@ local keyframes = { Altitude = -1915.1217968110968, UseHeightmap = false }, - ['1969-07-20T20:16:17'] = { + ["1969-07-20T20:16:17"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.476774052091812, @@ -1277,7 +1277,7 @@ local keyframes = { Altitude = -1914.8494445678598, UseHeightmap = false }, - ['1969-07-20T20:16:18'] = { + ["1969-07-20T20:16:18"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47665204889191, @@ -1285,7 +1285,7 @@ local keyframes = { Altitude = -1915.1217968110968, UseHeightmap = false }, - ['1969-07-20T20:16:19'] = { + ["1969-07-20T20:16:19"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47657652039885, @@ -1293,7 +1293,7 @@ local keyframes = { Altitude = -1915.1217968110968, UseHeightmap = false }, - ['1969-07-20T20:16:20'] = { + ["1969-07-20T20:16:20"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.476475036022492, @@ -1301,7 +1301,7 @@ local keyframes = { Altitude = -1914.8494445678598, UseHeightmap = false }, - ['1969-07-20T20:16:21'] = { + ["1969-07-20T20:16:21"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47638671770867, @@ -1309,7 +1309,7 @@ local keyframes = { Altitude = -1915.3941490543339, UseHeightmap = false }, - ['1969-07-20T20:16:22'] = { + ["1969-07-20T20:16:22"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.476286834646782, @@ -1317,7 +1317,7 @@ local keyframes = { Altitude = -1915.3941490543339, UseHeightmap = false }, - ['1969-07-20T20:16:23'] = { + ["1969-07-20T20:16:23"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47623840477727, @@ -1325,7 +1325,7 @@ local keyframes = { Altitude = -1915.3941490543339, UseHeightmap = false }, - ['1969-07-20T20:16:24'] = { + ["1969-07-20T20:16:24"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.476125794037742, @@ -1333,7 +1333,7 @@ local keyframes = { Altitude = -1915.938853540808, UseHeightmap = false }, - ['1969-07-20T20:16:25'] = { + ["1969-07-20T20:16:25"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47604582826371, @@ -1341,7 +1341,7 @@ local keyframes = { Altitude = -1916.211205784045, UseHeightmap = false }, - ['1969-07-20T20:16:26'] = { + ["1969-07-20T20:16:26"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47599605084473, @@ -1349,7 +1349,7 @@ local keyframes = { Altitude = -1916.211205784045, UseHeightmap = false }, - ['1969-07-20T20:16:27'] = { + ["1969-07-20T20:16:27"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47598166921822, @@ -1357,7 +1357,7 @@ local keyframes = { Altitude = -1916.755910270519, UseHeightmap = false }, - -- ['1969-07-20T20:16:28'] = { + -- ["1969-07-20T20:16:28"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.47600003592791, @@ -1365,7 +1365,7 @@ local keyframes = { -- Altitude = -1916.211205784045, -- UseHeightmap = false -- }, - -- ['1969-07-20T20:16:29'] = { + -- ["1969-07-20T20:16:29"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.47593990066764, @@ -1373,7 +1373,7 @@ local keyframes = { -- Altitude = -1916.483558027282, -- UseHeightmap = false -- }, - ['1969-07-20T20:16:30'] = { + ["1969-07-20T20:16:30"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47587957412098, @@ -1381,7 +1381,7 @@ local keyframes = { Altitude = -1916.755910270519, UseHeightmap = false }, - ['1969-07-20T20:16:31'] = { + ["1969-07-20T20:16:31"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47579282136856, @@ -1389,7 +1389,7 @@ local keyframes = { Altitude = -1917.028262513756, UseHeightmap = false }, - ['1969-07-20T20:16:32'] = { + ["1969-07-20T20:16:32"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47571834266516, @@ -1397,7 +1397,7 @@ local keyframes = { Altitude = -1917.5729670002302, UseHeightmap = false }, - -- ['1969-07-20T20:16:33'] = { + -- ["1969-07-20T20:16:33"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.47569457676149, @@ -1405,7 +1405,7 @@ local keyframes = { -- Altitude = -1917.3006147569931, -- UseHeightmap = false -- }, - ['1969-07-20T20:16:34'] = { + ["1969-07-20T20:16:34"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47557041293751, @@ -1413,7 +1413,7 @@ local keyframes = { Altitude = -1918.117671486704, UseHeightmap = false }, - ['1969-07-20T20:16:35'] = { + ["1969-07-20T20:16:35"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.475475681892203, @@ -1421,7 +1421,7 @@ local keyframes = { Altitude = -1918.117671486704, UseHeightmap = false }, - ['1969-07-20T20:16:36'] = { + ["1969-07-20T20:16:36"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47541533097675, @@ -1429,7 +1429,7 @@ local keyframes = { Altitude = -1918.390023729941, UseHeightmap = false }, - ['1969-07-20T20:16:37'] = { + ["1969-07-20T20:16:37"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47532207549478, @@ -1437,7 +1437,7 @@ local keyframes = { Altitude = -1918.662375973178, UseHeightmap = false }, - ['1969-07-20T20:16:38'] = { + ["1969-07-20T20:16:38"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47522251798864, @@ -1445,7 +1445,7 @@ local keyframes = { Altitude = -1918.662375973178, UseHeightmap = false }, - ['1969-07-20T20:16:39'] = { + ["1969-07-20T20:16:39"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47513564425997, @@ -1453,7 +1453,7 @@ local keyframes = { Altitude = -1918.662375973178, UseHeightmap = false }, - ['1969-07-20T20:16:40'] = { + ["1969-07-20T20:16:40"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47498810518855, @@ -1461,7 +1461,7 @@ local keyframes = { Altitude = -1920.2964894326003, UseHeightmap = false }, - -- ['1969-07-20T20:16:41'] = { + -- ["1969-07-20T20:16:41"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.47489523759891, @@ -1469,7 +1469,7 @@ local keyframes = { -- Altitude = -1920.0241371893633, -- UseHeightmap = false -- }, - -- ['1969-07-20T20:16:42'] = { + -- ["1969-07-20T20:16:42"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.47479438729774, @@ -1477,7 +1477,7 @@ local keyframes = { -- Altitude = -1920.2964894326003, -- UseHeightmap = false -- }, - -- ['1969-07-20T20:16:43'] = { + -- ["1969-07-20T20:16:43"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.47475788126512, @@ -1485,7 +1485,7 @@ local keyframes = { -- Altitude = -1920.0241371893633, -- UseHeightmap = false -- }, - ['1969-07-20T20:16:44'] = { + ["1969-07-20T20:16:44"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.474678823712882, @@ -1493,7 +1493,7 @@ local keyframes = { Altitude = -1920.2964894326003, UseHeightmap = false }, - ['1969-07-20T20:16:45'] = { + ["1969-07-20T20:16:45"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47460302474115, @@ -1501,7 +1501,7 @@ local keyframes = { Altitude = -1920.2964894326003, UseHeightmap = false }, - ['1969-07-20T20:16:46'] = { + ["1969-07-20T20:16:46"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47450130965027, @@ -1509,7 +1509,7 @@ local keyframes = { Altitude = -1920.8411939190744, UseHeightmap = false }, - ['1969-07-20T20:16:47'] = { + ["1969-07-20T20:16:47"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.474379586340042, @@ -1517,7 +1517,7 @@ local keyframes = { Altitude = -1921.1135461623114, UseHeightmap = false }, - ['1969-07-20T20:16:48'] = { + ["1969-07-20T20:16:48"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47431921657337, @@ -1525,7 +1525,7 @@ local keyframes = { Altitude = -1921.1135461623114, UseHeightmap = false }, - ['1969-07-20T20:16:49'] = { + ["1969-07-20T20:16:49"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47424698504895, @@ -1533,7 +1533,7 @@ local keyframes = { Altitude = -1921.1135461623114, UseHeightmap = false }, - ['1969-07-20T20:16:50'] = { + ["1969-07-20T20:16:50"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.474158028620153, @@ -1541,7 +1541,7 @@ local keyframes = { Altitude = -1921.6582506487855, UseHeightmap = false }, - ['1969-07-20T20:16:51'] = { + ["1969-07-20T20:16:51"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47408003386958, @@ -1549,7 +1549,7 @@ local keyframes = { Altitude = -1921.6582506487855, UseHeightmap = false }, - ['1969-07-20T20:16:52'] = { + ["1969-07-20T20:16:52"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473993195514502, @@ -1557,7 +1557,7 @@ local keyframes = { Altitude = -1921.9306028920225, UseHeightmap = false }, - -- ['1969-07-20T20:16:53'] = { + -- ["1969-07-20T20:16:53"] = { -- Type = "GlobeTranslation", -- Globe = "Moon", -- Longitude = 23.47392353665608, @@ -1565,7 +1565,7 @@ local keyframes = { -- Altitude = -1922.2029551352596, -- UseHeightmap = false -- }, - ['1969-07-20T20:16:54'] = { + ["1969-07-20T20:16:54"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47388537487237, @@ -1573,7 +1573,7 @@ local keyframes = { Altitude = -1921.9306028920225, UseHeightmap = false }, - ['1969-07-20T20:16:55'] = { + ["1969-07-20T20:16:55"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47382957912373, @@ -1581,7 +1581,7 @@ local keyframes = { Altitude = -1921.9306028920225, UseHeightmap = false }, - ['1969-07-20T20:16:56'] = { + ["1969-07-20T20:16:56"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47378652829031, @@ -1589,7 +1589,7 @@ local keyframes = { Altitude = -1921.6582506487855, UseHeightmap = false }, - ['1969-07-20T20:16:57'] = { + ["1969-07-20T20:16:57"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473741159081282, @@ -1597,7 +1597,7 @@ local keyframes = { Altitude = -1921.6582506487855, UseHeightmap = false }, - ['1969-07-20T20:16:58'] = { + ["1969-07-20T20:16:58"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473674434325403, @@ -1605,7 +1605,7 @@ local keyframes = { Altitude = -1922.2029551352596, UseHeightmap = false }, - ['1969-07-20T20:16:59'] = { + ["1969-07-20T20:16:59"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47366202033169, @@ -1613,7 +1613,7 @@ local keyframes = { Altitude = -1922.2029551352596, UseHeightmap = false }, - ['1969-07-20T20:17:00'] = { + ["1969-07-20T20:17:00"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47360771579434, @@ -1621,7 +1621,7 @@ local keyframes = { Altitude = -1922.7476596217336, UseHeightmap = false }, - ['1969-07-20T20:17:01'] = { + ["1969-07-20T20:17:01"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47357090816817, @@ -1629,7 +1629,7 @@ local keyframes = { Altitude = -1923.0200118649707, UseHeightmap = false }, - ['1969-07-20T20:17:02'] = { + ["1969-07-20T20:17:02"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47354290217646, @@ -1637,7 +1637,7 @@ local keyframes = { Altitude = -1923.2923641082077, UseHeightmap = false }, - ['1969-07-20T20:17:03'] = { + ["1969-07-20T20:17:03"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47354640286736, @@ -1645,7 +1645,7 @@ local keyframes = { Altitude = -1923.5647163514448, UseHeightmap = false }, - ['1969-07-20T20:17:04'] = { + ["1969-07-20T20:17:04"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473541367503802, @@ -1653,7 +1653,7 @@ local keyframes = { Altitude = -1923.8370685946818, UseHeightmap = false }, - ['1969-07-20T20:17:05'] = { + ["1969-07-20T20:17:05"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47350854369485, @@ -1661,7 +1661,7 @@ local keyframes = { Altitude = -1924.1094208379188, UseHeightmap = false }, - ['1969-07-20T20:17:06'] = { + ["1969-07-20T20:17:06"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47347424911663, @@ -1669,7 +1669,7 @@ local keyframes = { Altitude = -1924.6541253243927, UseHeightmap = false }, - ['1969-07-20T20:17:07'] = { + ["1969-07-20T20:17:07"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473503629496022, @@ -1677,7 +1677,7 @@ local keyframes = { Altitude = -1924.6541253243927, UseHeightmap = false }, - ['1969-07-20T20:17:08'] = { + ["1969-07-20T20:17:08"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473512768546712, @@ -1685,7 +1685,7 @@ local keyframes = { Altitude = -1924.6541253243927, UseHeightmap = false }, - ['1969-07-20T20:17:09'] = { + ["1969-07-20T20:17:09"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47353343175876, @@ -1693,7 +1693,7 @@ local keyframes = { Altitude = -1924.3817730811559, UseHeightmap = false }, - ['1969-07-20T20:17:10'] = { + ["1969-07-20T20:17:10"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47353316391657, @@ -1701,7 +1701,7 @@ local keyframes = { Altitude = -1925.4711820541038, UseHeightmap = false }, - ['1969-07-20T20:17:11'] = { + ["1969-07-20T20:17:11"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47355774790429, @@ -1709,7 +1709,7 @@ local keyframes = { Altitude = -1924.9264775676297, UseHeightmap = false }, - ['1969-07-20T20:17:12'] = { + ["1969-07-20T20:17:12"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.4735540335665, @@ -1717,7 +1717,7 @@ local keyframes = { Altitude = -1924.9264775676297, UseHeightmap = false }, - ['1969-07-20T20:17:13'] = { + ["1969-07-20T20:17:13"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47353500681606, @@ -1725,7 +1725,7 @@ local keyframes = { Altitude = -1925.1988298108668, UseHeightmap = false }, - ['1969-07-20T20:17:14'] = { + ["1969-07-20T20:17:14"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47350664772458, @@ -1733,7 +1733,7 @@ local keyframes = { Altitude = -1925.4711820541038, UseHeightmap = false }, - ['1969-07-20T20:17:15'] = { + ["1969-07-20T20:17:15"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473494757982273, @@ -1741,7 +1741,7 @@ local keyframes = { Altitude = -1925.4711820541038, UseHeightmap = false }, - ['1969-07-20T20:17:16'] = { + ["1969-07-20T20:17:16"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473485349949943, @@ -1749,7 +1749,7 @@ local keyframes = { Altitude = -1925.4711820541038, UseHeightmap = false }, - ['1969-07-20T20:17:17'] = { + ["1969-07-20T20:17:17"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473464448566723, @@ -1757,7 +1757,7 @@ local keyframes = { Altitude = -1925.4711820541038, UseHeightmap = false }, - ['1969-07-20T20:17:18'] = { + ["1969-07-20T20:17:18"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47344203973089, @@ -1765,7 +1765,7 @@ local keyframes = { Altitude = -1925.4711820541038, UseHeightmap = false }, - ['1969-07-20T20:17:19'] = { + ["1969-07-20T20:17:19"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473416197134252, @@ -1773,7 +1773,7 @@ local keyframes = { Altitude = -1925.7435342973408, UseHeightmap = false }, - ['1969-07-20T20:17:20'] = { + ["1969-07-20T20:17:20"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47339416150648, @@ -1781,7 +1781,7 @@ local keyframes = { Altitude = -1925.7435342973408, UseHeightmap = false }, - ['1969-07-20T20:17:21'] = { + ["1969-07-20T20:17:21"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.4733232813815, @@ -1789,7 +1789,7 @@ local keyframes = { Altitude = -1926.288238783815, UseHeightmap = false }, - ['1969-07-20T20:17:24'] = { + ["1969-07-20T20:17:24"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47324174890097, @@ -1797,7 +1797,7 @@ local keyframes = { Altitude = -1926.288238783815, UseHeightmap = false }, - ['1969-07-20T20:17:27'] = { + ["1969-07-20T20:17:27"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47317556908458, @@ -1805,7 +1805,7 @@ local keyframes = { Altitude = -1926.560591027052, UseHeightmap = false }, - ['1969-07-20T20:17:30'] = { + ["1969-07-20T20:17:30"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47310752310149, @@ -1813,7 +1813,7 @@ local keyframes = { Altitude = -1926.832943270289, UseHeightmap = false }, - ['1969-07-20T20:17:32'] = { + ["1969-07-20T20:17:32"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.473074792306253, @@ -1821,7 +1821,7 @@ local keyframes = { Altitude = -1927.105295513526, UseHeightmap = false }, - ['1969-07-20T20:17:40'] = { + ["1969-07-20T20:17:40"] = { Type = "GlobeTranslation", Globe = "Moon", Longitude = 23.47306, @@ -1831,4 +1831,4 @@ local keyframes = { }, }; -asset.export('keyframes', keyframes); +asset.export("keyframes", keyframes); diff --git a/data/assets/scene/solarsystem/missions/apollo/11/lem_descent_rotation.asset b/data/assets/scene/solarsystem/missions/apollo/11/lem_descent_rotation.asset index 8ed85f9feb..d154270852 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/lem_descent_rotation.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/lem_descent_rotation.asset @@ -1,1586 +1,1586 @@ -asset.export('keyframes', { - -- ['1969-7-20T20:9:53'] = { +asset.export("keyframes", { + -- ["1969-7-20T20:9:53"] = { -- Type = "StaticRotation", -- Rotation = {-1.3815, -0.0048, -0.4891} -- }, - -- ['1969-7-20T20:9:55'] = { + -- ["1969-7-20T20:9:55"] = { -- Type = "StaticRotation", -- Rotation = {-1.3773, 0.0042, -0.3557} -- }, - -- ['1969-7-20T20:9:57'] = { + -- ["1969-7-20T20:9:57"] = { -- Type = "StaticRotation", -- Rotation = {-1.3677, 0.0184, -0.2218} -- }, - -- ['1969-7-20T20:9:59'] = { + -- ["1969-7-20T20:9:59"] = { -- Type = "StaticRotation", -- Rotation = {-1.3606, -0.0117, -0.0861} -- }, - -- ['1969-7-20T20:10:1'] = { + -- ["1969-7-20T20:10:1"] = { -- Type = "StaticRotation", -- Rotation = {-1.3587, -0.0222, -0.0219} -- }, - -- ['1969-7-20T20:10:3'] = { + -- ["1969-7-20T20:10:3"] = { -- Type = "StaticRotation", -- Rotation = {-1.3622, -0.0207, -0.0533} -- }, - -- ['1969-7-20T20:10:5'] = { + -- ["1969-7-20T20:10:5"] = { -- Type = "StaticRotation", -- Rotation = {-1.3639, -0.0032, -0.0640} -- }, - -- ['1969-7-20T20:10:7'] = { + -- ["1969-7-20T20:10:7"] = { -- Type = "StaticRotation", -- Rotation = {-1.3612, 0.0178, -0.0685} -- }, - -- ['1969-7-20T20:10:9'] = { + -- ["1969-7-20T20:10:9"] = { -- Type = "StaticRotation", -- Rotation = {-1.3571, 0.0196, -0.0796} -- }, - -- ['1969-7-20T20:10:11'] = { + -- ["1969-7-20T20:10:11"] = { -- Type = "StaticRotation", -- Rotation = {-1.3484, 0.0029, -0.0913} -- }, - -- ['1969-7-20T20:10:13'] = { + -- ["1969-7-20T20:10:13"] = { -- Type = "StaticRotation", -- Rotation = {-1.3597, -0.0149, -0.0832} -- }, - -- ['1969-7-20T20:10:15'] = { + -- ["1969-7-20T20:10:15"] = { -- Type = "StaticRotation", -- Rotation = {-1.3587, -0.0220, -0.0679} -- }, - -- ['1969-7-20T20:10:17'] = { + -- ["1969-7-20T20:10:17"] = { -- Type = "StaticRotation", -- Rotation = {-1.3482, -0.0121, -0.0736} -- }, - -- ['1969-7-20T20:10:19'] = { + -- ["1969-7-20T20:10:19"] = { -- Type = "StaticRotation", -- Rotation = {-1.3520, -0.0098, -0.0876} -- }, - -- ['1969-7-20T20:10:21'] = { + -- ["1969-7-20T20:10:21"] = { -- Type = "StaticRotation", -- Rotation = {-1.3503, -0.0240, -0.0872} -- }, - -- ['1969-7-20T20:10:25'] = { + -- ["1969-7-20T20:10:25"] = { -- Type = "StaticRotation", -- Rotation = {-1.3470, 0.0245, -0.0545} -- }, - -- ['1969-7-20T20:10:27'] = { + -- ["1969-7-20T20:10:27"] = { -- Type = "StaticRotation", -- Rotation = {-1.3420, 0.0115, -0.0518} -- }, - -- ['1969-7-20T20:10:29'] = { + -- ["1969-7-20T20:10:29"] = { -- Type = "StaticRotation", -- Rotation = {-1.3294, -0.0153, -0.0556} -- }, - -- ['1969-7-20T20:10:31'] = { + -- ["1969-7-20T20:10:31"] = { -- Type = "StaticRotation", -- Rotation = {-1.3399, -0.0136, -0.0573} -- }, - -- ['1969-7-20T20:10:33'] = { + -- ["1969-7-20T20:10:33"] = { -- Type = "StaticRotation", -- Rotation = {-1.3459, 0.0002, -0.0569} -- }, - -- ['1969-7-20T20:10:35'] = { + -- ["1969-7-20T20:10:35"] = { -- Type = "StaticRotation", -- Rotation = {-1.3440, 0.0012, -0.0542} -- }, - -- ['1969-7-20T20:10:37'] = { + -- ["1969-7-20T20:10:37"] = { -- Type = "StaticRotation", -- Rotation = {-1.3230, -0.0096, -0.0527} -- }, - -- ['1969-7-20T20:10:39'] = { + -- ["1969-7-20T20:10:39"] = { -- Type = "StaticRotation", -- Rotation = {-1.2966, -0.0119, -0.0510} -- }, - -- ['1969-7-20T20:10:41'] = { + -- ["1969-7-20T20:10:41"] = { -- Type = "StaticRotation", -- Rotation = {-1.3146, -0.0040, -0.0504} -- }, - -- ['1969-7-20T20:10:43'] = { + -- ["1969-7-20T20:10:43"] = { -- Type = "StaticRotation", -- Rotation = {-1.3355, -0.0015, -0.0514} -- }, - -- ['1969-7-20T20:10:45'] = { + -- ["1969-7-20T20:10:45"] = { -- Type = "StaticRotation", -- Rotation = {-1.2916, 0.0061, -0.0516} -- }, - -- ['1969-7-20T20:10:47'] = { + -- ["1969-7-20T20:10:47"] = { -- Type = "StaticRotation", -- Rotation = {-1.2901, -0.0257, -0.0516} -- }, - -- ['1969-7-20T20:10:49'] = { + -- ["1969-7-20T20:10:49"] = { -- Type = "StaticRotation", -- Rotation = {-1.2818, -0.0123, -0.0495} -- }, - -- ['1969-7-20T20:10:51'] = { + -- ["1969-7-20T20:10:51"] = { -- Type = "StaticRotation", -- Rotation = {-1.2682, 0.0058, -0.0477} -- }, - -- ['1969-7-20T20:10:53'] = { + -- ["1969-7-20T20:10:53"] = { -- Type = "StaticRotation", -- Rotation = {-1.2732, 0.0035, -0.0195} -- }, - -- ['1969-7-20T20:10:54'] = { + -- ["1969-7-20T20:10:54"] = { -- Type = "StaticRotation", -- Rotation = {-1.2740, 0.0029, 0.0123} -- }, - -- ['1969-7-20T20:10:55'] = { + -- ["1969-7-20T20:10:55"] = { -- Type = "StaticRotation", -- Rotation = {-1.2778, 0.0035, 0.0234} -- }, - -- ['1969-7-20T20:10:57'] = { + -- ["1969-7-20T20:10:57"] = { -- Type = "StaticRotation", -- Rotation = {-1.2573, 0.0069, 0.0174} -- }, - -- ['1969-7-20T20:10:58'] = { + -- ["1969-7-20T20:10:58"] = { -- Type = "StaticRotation", -- Rotation = {-1.2515, -0.0023, 0.0115} -- }, - -- ['1969-7-20T20:10:59'] = { + -- ["1969-7-20T20:10:59"] = { -- Type = "StaticRotation", -- Rotation = {-1.2333, -0.0092, 0.0092} -- }, - -- ['1969-7-20T20:11:0'] = { + -- ["1969-7-20T20:11:0"] = { -- Type = "StaticRotation", -- Rotation = {-1.2191, -0.0157, 0.0056} -- }, - -- ['1969-7-20T20:11:1'] = { + -- ["1969-7-20T20:11:1"] = { -- Type = "StaticRotation", -- Rotation = {-1.2246, -0.0195, 0.0029} -- }, - -- ['1969-7-20T20:11:3'] = { + -- ["1969-7-20T20:11:3"] = { -- Type = "StaticRotation", -- Rotation = {-1.2419, -0.0146, -0.0019} -- }, - -- ['1969-7-20T20:11:5'] = { + -- ["1969-7-20T20:11:5"] = { -- Type = "StaticRotation", -- Rotation = {-1.2274, -0.0054, -0.0048} -- }, - -- ['1969-7-20T20:11:6'] = { + -- ["1969-7-20T20:11:6"] = { -- Type = "StaticRotation", -- Rotation = {-1.2218, -0.0042, -0.0056} -- }, - -- ['1969-7-20T20:11:7'] = { + -- ["1969-7-20T20:11:7"] = { -- Type = "StaticRotation", -- Rotation = {-1.2047, 0.0010, -0.0065} -- }, - -- ['1969-7-20T20:11:7'] = { + -- ["1969-7-20T20:11:7"] = { -- Type = "StaticRotation", -- Rotation = {-1.2042, -0.0054, -0.0069} -- }, - -- ['1969-7-20T20:11:9'] = { + -- ["1969-7-20T20:11:9"] = { -- Type = "StaticRotation", -- Rotation = {-1.2007, -0.0100, -0.0077} -- }, - -- ['1969-7-20T20:11:11'] = { + -- ["1969-7-20T20:11:11"] = { -- Type = "StaticRotation", -- Rotation = {-1.2136, -0.0173, -0.0077} -- }, - -- ['1969-7-20T20:11:11'] = { + -- ["1969-7-20T20:11:11"] = { -- Type = "StaticRotation", -- Rotation = {-1.2013, -0.0021, -0.0077} -- }, - -- ['1969-7-20T20:11:13'] = { + -- ["1969-7-20T20:11:13"] = { -- Type = "StaticRotation", -- Rotation = {-1.1928, 0.0102, -0.0056} -- }, - -- ['1969-7-20T20:11:13'] = { + -- ["1969-7-20T20:11:13"] = { -- Type = "StaticRotation", -- Rotation = {-1.1854, 0.0090, -0.0057} -- }, - -- ['1969-7-20T20:11:15'] = { + -- ["1969-7-20T20:11:15"] = { -- Type = "StaticRotation", -- Rotation = {-1.1856, -0.0075, -0.0044} -- }, - -- ['1969-7-20T20:11:17'] = { + -- ["1969-7-20T20:11:17"] = { -- Type = "StaticRotation", -- Rotation = {-1.1670, -0.0157, -0.0023} -- }, - -- ['1969-7-20T20:11:17'] = { + -- ["1969-7-20T20:11:17"] = { -- Type = "StaticRotation", -- Rotation = {-1.1599, -0.0149, 0.0012} -- }, - -- ['1969-7-20T20:11:19'] = { + -- ["1969-7-20T20:11:19"] = { -- Type = "StaticRotation", -- Rotation = {-1.1514, -0.0119, 0.0012} -- }, - -- ['1969-7-20T20:11:19'] = { + -- ["1969-7-20T20:11:19"] = { -- Type = "StaticRotation", -- Rotation = {-1.1465, -0.0094, 0.0040} -- }, - -- ['1969-7-20T20:11:21'] = { + -- ["1969-7-20T20:11:21"] = { -- Type = "StaticRotation", -- Rotation = {-1.1593, -0.0176, 0.0063} -- }, - -- ['1969-7-20T20:11:23'] = { + -- ["1969-7-20T20:11:23"] = { -- Type = "StaticRotation", -- Rotation = {-1.1712, -0.0144, 0.0132} -- }, - -- ['1969-7-20T20:11:24'] = { + -- ["1969-7-20T20:11:24"] = { -- Type = "StaticRotation", -- Rotation = {-1.1727, -0.0052, 0.0176} -- }, - -- ['1969-7-20T20:11:25'] = { + -- ["1969-7-20T20:11:25"] = { -- Type = "StaticRotation", -- Rotation = {-1.1652, 0.0083, 0.0190} -- }, - -- ['1969-7-20T20:11:26'] = { + -- ["1969-7-20T20:11:26"] = { -- Type = "StaticRotation", -- Rotation = {-1.1827, -0.0044, 0.0178} -- }, - -- ['1969-7-20T20:11:27'] = { + -- ["1969-7-20T20:11:27"] = { -- Type = "StaticRotation", -- Rotation = {-1.1942, -0.0172, 0.0180} -- }, - -- ['1969-7-20T20:11:29'] = { + -- ["1969-7-20T20:11:29"] = { -- Type = "StaticRotation", -- Rotation = {-1.1788, -0.0071, 0.0188} -- }, - -- ['1969-7-20T20:11:30'] = { + -- ["1969-7-20T20:11:30"] = { -- Type = "StaticRotation", -- Rotation = {-1.1639, 0.0035, 0.0176} -- }, - -- ['1969-7-20T20:11:31'] = { + -- ["1969-7-20T20:11:31"] = { -- Type = "StaticRotation", -- Rotation = {-1.1614, 0.0048, 0.0178} -- }, - -- ['1969-7-20T20:11:31'] = { + -- ["1969-7-20T20:11:31"] = { -- Type = "StaticRotation", -- Rotation = {-1.1551, 0.0083, 0.0169} -- }, - -- ['1969-7-20T20:11:33'] = { + -- ["1969-7-20T20:11:33"] = { -- Type = "StaticRotation", -- Rotation = {-1.1643, 0.0060, 0.0175} -- }, - -- ['1969-7-20T20:11:35'] = { + -- ["1969-7-20T20:11:35"] = { -- Type = "StaticRotation", -- Rotation = {-1.1746, 0.0006, 0.0173} -- }, - -- ['1969-7-20T20:11:35'] = { + -- ["1969-7-20T20:11:35"] = { -- Type = "StaticRotation", -- Rotation = {-1.1679, -0.0008, 0.0178} -- }, - -- ['1969-7-20T20:11:37'] = { + -- ["1969-7-20T20:11:37"] = { -- Type = "StaticRotation", -- Rotation = {-1.1735, -0.0127, 0.0173} -- }, - -- ['1969-7-20T20:11:37'] = { + -- ["1969-7-20T20:11:37"] = { -- Type = "StaticRotation", -- Rotation = {-1.1599, -0.0044, 0.0186} -- }, - -- ['1969-7-20T20:11:39'] = { + -- ["1969-7-20T20:11:39"] = { -- Type = "StaticRotation", -- Rotation = {-1.1545, 0.0012, 0.0167} -- }, - -- ['1969-7-20T20:11:39'] = { + -- ["1969-7-20T20:11:39"] = { -- Type = "StaticRotation", -- Rotation = {-1.1461, 0.0075, 0.0169} -- }, - -- ['1969-7-20T20:11:41'] = { + -- ["1969-7-20T20:11:41"] = { -- Type = "StaticRotation", -- Rotation = {-1.1470, 0.0012, 0.0155} -- }, - -- ['1969-7-20T20:11:41'] = { + -- ["1969-7-20T20:11:41"] = { -- Type = "StaticRotation", -- Rotation = {-1.1442, -0.0086, 0.0148} -- }, - -- ['1969-7-20T20:11:43'] = { + -- ["1969-7-20T20:11:43"] = { -- Type = "StaticRotation", -- Rotation = {-1.1411, -0.0236, 0.0142} -- }, - -- ['1969-7-20T20:11:43'] = { + -- ["1969-7-20T20:11:43"] = { -- Type = "StaticRotation", -- Rotation = {-1.1302, -0.0240, 0.0131} -- }, - -- ['1969-7-20T20:11:45'] = { + -- ["1969-7-20T20:11:45"] = { -- Type = "StaticRotation", -- Rotation = {-1.1098, -0.0115, 0.0140} -- }, - -- ['1969-7-20T20:11:45'] = { + -- ["1969-7-20T20:11:45"] = { -- Type = "StaticRotation", -- Rotation = {-1.1043, -0.0088, 0.0134} -- }, - -- ['1969-7-20T20:11:47'] = { + -- ["1969-7-20T20:11:47"] = { -- Type = "StaticRotation", -- Rotation = {-1.0979, -0.0025, 0.0144} -- }, - -- ['1969-7-20T20:11:47'] = { + -- ["1969-7-20T20:11:47"] = { -- Type = "StaticRotation", -- Rotation = {-1.1092, -0.0125, 0.0144} -- }, - -- ['1969-7-20T20:11:49'] = { + -- ["1969-7-20T20:11:49"] = { -- Type = "StaticRotation", -- Rotation = {-1.1175, -0.0205, 0.0146} -- }, - -- ['1969-7-20T20:11:49'] = { + -- ["1969-7-20T20:11:49"] = { -- Type = "StaticRotation", -- Rotation = {-1.1230, -0.0249, 0.0157} -- }, - -- ['1969-7-20T20:11:51'] = { + -- ["1969-7-20T20:11:51"] = { -- Type = "StaticRotation", -- Rotation = {-1.1099, -0.0119, 0.0161} -- }, - -- ['1969-7-20T20:11:51'] = { + -- ["1969-7-20T20:11:51"] = { -- Type = "StaticRotation", -- Rotation = {-1.1056, -0.0071, 0.0167} -- }, - -- ['1969-7-20T20:11:53'] = { + -- ["1969-7-20T20:11:53"] = { -- Type = "StaticRotation", -- Rotation = {-1.0916, 0.0044, 0.0131} -- }, - -- ['1969-7-20T20:11:53'] = { + -- ["1969-7-20T20:11:53"] = { -- Type = "StaticRotation", -- Rotation = {-1.0901, 0.0073, 0.0111} -- }, - -- ['1969-7-20T20:11:55'] = { + -- ["1969-7-20T20:11:55"] = { -- Type = "StaticRotation", -- Rotation = {-1.0839, 0.0040, 0.0075} -- }, - -- ['1969-7-20T20:11:55'] = { + -- ["1969-7-20T20:11:55"] = { -- Type = "StaticRotation", -- Rotation = {-1.0832, 0.0015, 0.0050} -- }, - -- ['1969-7-20T20:11:57'] = { + -- ["1969-7-20T20:11:57"] = { -- Type = "StaticRotation", -- Rotation = {-1.0831, -0.0109, 0.0003} -- }, - -- ['1969-7-20T20:11:57'] = { + -- ["1969-7-20T20:11:57"] = { -- Type = "StaticRotation", -- Rotation = {-1.0812, -0.0147, -0.0009} -- }, - -- ['1969-7-20T20:11:59'] = { + -- ["1969-7-20T20:11:59"] = { -- Type = "StaticRotation", -- Rotation = {-1.0814, -0.0278, -0.0031} -- }, - -- ['1969-7-20T20:11:59'] = { + -- ["1969-7-20T20:11:59"] = { -- Type = "StaticRotation", -- Rotation = {-1.0696, -0.0224, -0.0050} -- }, - -- ['1969-7-20T20:12:1'] = { + -- ["1969-7-20T20:12:1"] = { -- Type = "StaticRotation", -- Rotation = {-1.0617, -0.0242, -0.0067} -- }, - -- ['1969-7-20T20:12:1'] = { + -- ["1969-7-20T20:12:1"] = { -- Type = "StaticRotation", -- Rotation = {-1.0508, -0.0174, -0.0075} -- }, - -- ['1969-7-20T20:12:3'] = { + -- ["1969-7-20T20:12:3"] = { -- Type = "StaticRotation", -- Rotation = {-1.0523, -0.0174, -0.0094} -- }, - -- ['1969-7-20T20:12:3'] = { + -- ["1969-7-20T20:12:3"] = { -- Type = "StaticRotation", -- Rotation = {-1.0466, -0.0117, -0.0094} -- }, - -- ['1969-7-20T20:12:5'] = { + -- ["1969-7-20T20:12:5"] = { -- Type = "StaticRotation", -- Rotation = {-1.0565, -0.0107, -0.0109} -- }, - -- ['1969-7-20T20:12:5'] = { + -- ["1969-7-20T20:12:5"] = { -- Type = "StaticRotation", -- Rotation = {-1.0559, -0.0080, -0.0109} -- }, - -- ['1969-7-20T20:12:7'] = { + -- ["1969-7-20T20:12:7"] = { -- Type = "StaticRotation", -- Rotation = {-1.0686, -0.0065, -0.0113} -- }, - -- ['1969-7-20T20:12:7'] = { + -- ["1969-7-20T20:12:7"] = { -- Type = "StaticRotation", -- Rotation = {-1.0692, -0.0082, -0.0115} -- }, - -- ['1969-7-20T20:12:9'] = { + -- ["1969-7-20T20:12:9"] = { -- Type = "StaticRotation", -- Rotation = {-1.0722, -0.0075, -0.0107} -- }, - -- ['1969-7-20T20:12:9'] = { + -- ["1969-7-20T20:12:9"] = { -- Type = "StaticRotation", -- Rotation = {-1.0707, -0.0144, -0.0113} -- }, - -- ['1969-7-20T20:12:11'] = { + -- ["1969-7-20T20:12:11"] = { -- Type = "StaticRotation", -- Rotation = {-1.0630, -0.0153, -0.0103} -- }, - -- ['1969-7-20T20:12:11'] = { + -- ["1969-7-20T20:12:11"] = { -- Type = "StaticRotation", -- Rotation = {-1.0605, -0.0261, -0.0102} -- }, - -- ['1969-7-20T20:12:13'] = { + -- ["1969-7-20T20:12:13"] = { -- Type = "StaticRotation", -- Rotation = {-1.0441, -0.0305, -0.0096} -- }, - -- ['1969-7-20T20:12:13'] = { + -- ["1969-7-20T20:12:13"] = { -- Type = "StaticRotation", -- Rotation = {-1.0427, -0.0410, -0.0086} -- }, - -- ['1969-7-20T20:12:15'] = { + -- ["1969-7-20T20:12:15"] = { -- Type = "StaticRotation", -- Rotation = {-1.0283, -0.0228, -0.0075} -- }, - -- ['1969-7-20T20:12:15'] = { + -- ["1969-7-20T20:12:15"] = { -- Type = "StaticRotation", -- Rotation = {-1.0329, -0.0178, -0.0050} -- }, - -- ['1969-7-20T20:12:17'] = { + -- ["1969-7-20T20:12:17"] = { -- Type = "StaticRotation", -- Rotation = {-1.0260, -0.0009, -0.0027} -- }, - -- ['1969-7-20T20:12:17'] = { + -- ["1969-7-20T20:12:17"] = { -- Type = "StaticRotation", -- Rotation = {-1.0404, -0.0059, -0.0004} -- }, - -- ['1969-7-20T20:12:19'] = { + -- ["1969-7-20T20:12:19"] = { -- Type = "StaticRotation", -- Rotation = {-1.0467, -0.0140, 0.0023} -- }, - -- ['1969-7-20T20:12:19'] = { + -- ["1969-7-20T20:12:19"] = { -- Type = "StaticRotation", -- Rotation = {-1.0584, -0.0220, 0.0044} -- }, - -- ['1969-7-20T20:12:21'] = { + -- ["1969-7-20T20:12:21"] = { -- Type = "StaticRotation", -- Rotation = {-1.0416, -0.0176, 0.0088} -- }, - -- ['1969-7-20T20:12:21'] = { + -- ["1969-7-20T20:12:21"] = { -- Type = "StaticRotation", -- Rotation = {-1.0370, -0.0102, 0.0104} -- }, - -- ['1969-7-20T20:12:23'] = { + -- ["1969-7-20T20:12:23"] = { -- Type = "StaticRotation", -- Rotation = {-1.0222, -0.0063, 0.0121} -- }, - -- ['1969-7-20T20:12:23'] = { + -- ["1969-7-20T20:12:23"] = { -- Type = "StaticRotation", -- Rotation = {-1.0193, 0.0006, 0.0108} -- }, - -- ['1969-7-20T20:12:25'] = { + -- ["1969-7-20T20:12:25"] = { -- Type = "StaticRotation", -- Rotation = {-1.0166, -0.0059, 0.0098} -- }, - -- ['1969-7-20T20:12:25'] = { + -- ["1969-7-20T20:12:25"] = { -- Type = "StaticRotation", -- Rotation = {-1.0164, -0.0038, 0.0092} -- }, - -- ['1969-7-20T20:12:27'] = { + -- ["1969-7-20T20:12:27"] = { -- Type = "StaticRotation", -- Rotation = {-1.0237, -0.0188, 0.0081} -- }, - -- ['1969-7-20T20:12:27'] = { + -- ["1969-7-20T20:12:27"] = { -- Type = "StaticRotation", -- Rotation = {-1.0249, -0.0199, 0.0081} -- }, - -- ['1969-7-20T20:12:29'] = { + -- ["1969-7-20T20:12:29"] = { -- Type = "StaticRotation", -- Rotation = {-1.0329, -0.0330, 0.0077} -- }, - -- ['1969-7-20T20:12:29'] = { + -- ["1969-7-20T20:12:29"] = { -- Type = "StaticRotation", -- Rotation = {-1.0209, -0.0255, 0.0079} -- }, - -- ['1969-7-20T20:12:31'] = { + -- ["1969-7-20T20:12:31"] = { -- Type = "StaticRotation", -- Rotation = {-1.0157, -0.0205, 0.0084} -- }, - -- ['1969-7-20T20:12:31'] = { + -- ["1969-7-20T20:12:31"] = { -- Type = "StaticRotation", -- Rotation = {-1.0034, -0.0159, 0.0092} -- }, - -- ['1969-7-20T20:12:33'] = { + -- ["1969-7-20T20:12:33"] = { -- Type = "StaticRotation", -- Rotation = {-1.0044, -0.0136, 0.0106} -- }, - -- ['1969-7-20T20:12:33'] = { + -- ["1969-7-20T20:12:33"] = { -- Type = "StaticRotation", -- Rotation = {-0.9963, -0.0161, 0.0096} -- }, - -- ['1969-7-20T20:12:35'] = { + -- ["1969-7-20T20:12:35"] = { -- Type = "StaticRotation", -- Rotation = {-1.0036, -0.0180, 0.0084} -- }, - -- ['1969-7-20T20:12:35'] = { + -- ["1969-7-20T20:12:35"] = { -- Type = "StaticRotation", -- Rotation = {-0.9998, -0.0253, 0.0073} -- }, - -- ['1969-7-20T20:12:37'] = { + -- ["1969-7-20T20:12:37"] = { -- Type = "StaticRotation", -- Rotation = {-1.0088, -0.0265, 0.0065} -- }, - -- ['1969-7-20T20:12:37'] = { + -- ["1969-7-20T20:12:37"] = { -- Type = "StaticRotation", -- Rotation = {-1.0105, -0.0339, 0.0065} -- }, - -- ['1969-7-20T20:12:39'] = { + -- ["1969-7-20T20:12:39"] = { -- Type = "StaticRotation", -- Rotation = {-1.0230, -0.0280, 0.0060} -- }, - -- ['1969-7-20T20:12:39'] = { + -- ["1969-7-20T20:12:39"] = { -- Type = "StaticRotation", -- Rotation = {-1.0253, -0.0282, 0.0067} -- }, - -- ['1969-7-20T20:12:41'] = { + -- ["1969-7-20T20:12:41"] = { -- Type = "StaticRotation", -- Rotation = {-1.0216, -0.0071, 0.0067} -- }, - -- ['1969-7-20T20:12:42'] = { + -- ["1969-7-20T20:12:42"] = { -- Type = "StaticRotation", -- Rotation = {-1.0118, -0.0115, 0.0079} -- }, - -- ['1969-7-20T20:12:43'] = { + -- ["1969-7-20T20:12:43"] = { -- Type = "StaticRotation", -- Rotation = {-0.9946, -0.0098, 0.0077} -- }, - -- ['1969-7-20T20:12:43'] = { + -- ["1969-7-20T20:12:43"] = { -- Type = "StaticRotation", -- Rotation = {-0.9927, -0.0172, 0.0081} -- }, - -- ['1969-7-20T20:12:45'] = { + -- ["1969-7-20T20:12:45"] = { -- Type = "StaticRotation", -- Rotation = {-0.9890, -0.0147, 0.0094} -- }, - -- ['1969-7-20T20:12:45'] = { + -- ["1969-7-20T20:12:45"] = { -- Type = "StaticRotation", -- Rotation = {-1.0046, -0.0125, 0.0094} -- }, - -- ['1969-7-20T20:12:47'] = { + -- ["1969-7-20T20:12:47"] = { -- Type = "StaticRotation", -- Rotation = {-1.0109, -0.0048, 0.0104} -- }, - -- ['1969-7-20T20:12:47'] = { + -- ["1969-7-20T20:12:47"] = { -- Type = "StaticRotation", -- Rotation = {-1.0186, -0.0057, 0.0083} -- }, - -- ['1969-7-20T20:12:49'] = { + -- ["1969-7-20T20:12:49"] = { -- Type = "StaticRotation", -- Rotation = {-0.9940, -0.0226, 0.0048} -- }, - -- ['1969-7-20T20:12:49'] = { + -- ["1969-7-20T20:12:49"] = { -- Type = "StaticRotation", -- Rotation = {-0.9861, -0.0278, 0.0023} -- }, - -- ['1969-7-20T20:12:51'] = { + -- ["1969-7-20T20:12:51"] = { -- Type = "StaticRotation", -- Rotation = {-0.9712, -0.0301, 0.0000} -- }, - -- ['1969-7-20T20:12:51'] = { + -- ["1969-7-20T20:12:51"] = { -- Type = "StaticRotation", -- Rotation = {-0.9768, -0.0176, -0.0013} -- }, - -- ['1969-7-20T20:12:53'] = { + -- ["1969-7-20T20:12:53"] = { -- Type = "StaticRotation", -- Rotation = {-0.9791, -0.0088, -0.0025} -- }, - -- ['1969-7-20T20:12:53'] = { + -- ["1969-7-20T20:12:53"] = { -- Type = "StaticRotation", -- Rotation = {-0.9890, -0.0017, -0.0036} -- }, - -- ['1969-7-20T20:12:55'] = { + -- ["1969-7-20T20:12:55"] = { -- Type = "StaticRotation", -- Rotation = {-0.9906, -0.0245, -0.0056} -- }, - -- ['1969-7-20T20:12:55'] = { + -- ["1969-7-20T20:12:55"] = { -- Type = "StaticRotation", -- Rotation = {-0.9892, -0.0303, -0.0067} -- }, - -- ['1969-7-20T20:12:57'] = { + -- ["1969-7-20T20:12:57"] = { -- Type = "StaticRotation", -- Rotation = {-0.9852, -0.0470, -0.0086} -- }, - -- ['1969-7-20T20:12:57'] = { + -- ["1969-7-20T20:12:57"] = { -- Type = "StaticRotation", -- Rotation = {-0.9837, -0.0307, -0.0088} -- }, - -- ['1969-7-20T20:12:59'] = { + -- ["1969-7-20T20:12:59"] = { -- Type = "StaticRotation", -- Rotation = {-0.9873, -0.0128, -0.0090} -- }, - -- ['1969-7-20T20:12:59'] = { + -- ["1969-7-20T20:12:59"] = { -- Type = "StaticRotation", -- Rotation = {-0.9861, 0.0010, -0.0088} -- }, - -- ['1969-7-20T20:13:1'] = { + -- ["1969-7-20T20:13:1"] = { -- Type = "StaticRotation", -- Rotation = {-0.9944, -0.0117, -0.0094} -- }, - -- ['1969-7-20T20:13:1'] = { + -- ["1969-7-20T20:13:1"] = { -- Type = "StaticRotation", -- Rotation = {-0.9900, -0.0194, -0.0100} -- }, - -- ['1969-7-20T20:13:3'] = { + -- ["1969-7-20T20:13:3"] = { -- Type = "StaticRotation", -- Rotation = {-0.9917, -0.0355, -0.0103} -- }, - -- ['1969-7-20T20:13:3'] = { + -- ["1969-7-20T20:13:3"] = { -- Type = "StaticRotation", -- Rotation = {-0.9856, -0.0395, -0.0105} -- }, - -- ['1969-7-20T20:13:5'] = { + -- ["1969-7-20T20:13:5"] = { -- Type = "StaticRotation", -- Rotation = {-0.9969, -0.0299, -0.0096} -- }, - -- ['1969-7-20T20:13:5'] = { + -- ["1969-7-20T20:13:5"] = { -- Type = "StaticRotation", -- Rotation = {-0.9965, -0.0228, -0.0088} -- }, - -- ['1969-7-20T20:13:7'] = { + -- ["1969-7-20T20:13:7"] = { -- Type = "StaticRotation", -- Rotation = {-1.0015, -0.0073, -0.0075} -- }, - -- ['1969-7-20T20:13:7'] = { + -- ["1969-7-20T20:13:7"] = { -- Type = "StaticRotation", -- Rotation = {-0.9908, -0.0098, -0.0067} -- }, - -- ['1969-7-20T20:13:9'] = { + -- ["1969-7-20T20:13:9"] = { -- Type = "StaticRotation", -- Rotation = {-0.9814, -0.0034, -0.0057} -- }, - -- ['1969-7-20T20:13:9'] = { + -- ["1969-7-20T20:13:9"] = { -- Type = "StaticRotation", -- Rotation = {-0.9729, -0.0071, -0.0044} -- }, - -- ['1969-7-20T20:13:11'] = { + -- ["1969-7-20T20:13:11"] = { -- Type = "StaticRotation", -- Rotation = {-0.9716, -0.0002, -0.0029} -- }, - -- ['1969-7-20T20:13:11'] = { + -- ["1969-7-20T20:13:11"] = { -- Type = "StaticRotation", -- Rotation = {-0.9729, -0.0044, -0.0013} -- }, - -- ['1969-7-20T20:13:13'] = { + -- ["1969-7-20T20:13:13"] = { -- Type = "StaticRotation", -- Rotation = {-0.9793, 0.0010, 0.0006} -- }, - -- ['1969-7-20T20:13:14'] = { + -- ["1969-7-20T20:13:14"] = { -- Type = "StaticRotation", -- Rotation = {-0.9869, -0.0040, 0.0031} -- }, - -- ['1969-7-20T20:13:15'] = { + -- ["1969-7-20T20:13:15"] = { -- Type = "StaticRotation", -- Rotation = {-0.9938, -0.0031, 0.0048} -- }, - -- ['1969-7-20T20:13:15'] = { + -- ["1969-7-20T20:13:15"] = { -- Type = "StaticRotation", -- Rotation = {-0.9978, -0.0134, 0.0067} -- }, - -- ['1969-7-20T20:13:17'] = { + -- ["1969-7-20T20:13:17"] = { -- Type = "StaticRotation", -- Rotation = {-0.9881, -0.0334, 0.0048} -- }, - -- ['1969-7-20T20:13:17'] = { + -- ["1969-7-20T20:13:17"] = { -- Type = "StaticRotation", -- Rotation = {-0.9881, -0.0449, 0.0023} -- }, - -- ['1969-7-20T20:13:19'] = { + -- ["1969-7-20T20:13:19"] = { -- Type = "StaticRotation", -- Rotation = {-0.9756, -0.0447, -0.0015} -- }, - -- ['1969-7-20T20:13:19'] = { + -- ["1969-7-20T20:13:19"] = { -- Type = "StaticRotation", -- Rotation = {-0.9804, -0.0351, -0.0034} -- }, - -- ['1969-7-20T20:13:21'] = { + -- ["1969-7-20T20:13:21"] = { -- Type = "StaticRotation", -- Rotation = {-0.9769, -0.0269, -0.0052} -- }, - -- ['1969-7-20T20:13:21'] = { + -- ["1969-7-20T20:13:21"] = { -- Type = "StaticRotation", -- Rotation = {-0.9816, -0.0182, -0.0073} -- }, - -- ['1969-7-20T20:13:23'] = { + -- ["1969-7-20T20:13:23"] = { -- Type = "StaticRotation", -- Rotation = {-0.9783, -0.0192, -0.0084} -- }, - -- ['1969-7-20T20:13:23'] = { + -- ["1969-7-20T20:13:23"] = { -- Type = "StaticRotation", -- Rotation = {-0.9808, -0.0149, -0.0103} -- }, - -- ['1969-7-20T20:13:25'] = { + -- ["1969-7-20T20:13:25"] = { -- Type = "StaticRotation", -- Rotation = {-0.9771, -0.0197, -0.0117} -- }, - -- ['1969-7-20T20:13:25'] = { + -- ["1969-7-20T20:13:25"] = { -- Type = "StaticRotation", -- Rotation = {-0.9748, -0.0171, -0.0127} -- }, - -- ['1969-7-20T20:13:27'] = { + -- ["1969-7-20T20:13:27"] = { -- Type = "StaticRotation", -- Rotation = {-0.9710, -0.0197, -0.0144} -- }, - -- ['1969-7-20T20:13:27'] = { + -- ["1969-7-20T20:13:27"] = { -- Type = "StaticRotation", -- Rotation = {-0.9643, -0.0186, -0.0146} -- }, - -- ['1969-7-20T20:13:29'] = { + -- ["1969-7-20T20:13:29"] = { -- Type = "StaticRotation", -- Rotation = {-0.9616, -0.0165, -0.0159} -- }, - -- ['1969-7-20T20:13:29'] = { + -- ["1969-7-20T20:13:29"] = { -- Type = "StaticRotation", -- Rotation = {-0.9534, -0.0163, -0.0159} -- }, - -- ['1969-7-20T20:13:31'] = { + -- ["1969-7-20T20:13:31"] = { -- Type = "StaticRotation", -- Rotation = {-0.9605, -0.0096, -0.0165} -- }, - -- ['1969-7-20T20:13:41'] = { + -- ["1969-7-20T20:13:41"] = { -- Type = "StaticRotation", -- Rotation = {-0.8092, -0.0297, -0.0155} -- }, - -- ['1969-7-20T20:13:41'] = { + -- ["1969-7-20T20:13:41"] = { -- Type = "StaticRotation", -- Rotation = {-0.8097, -0.0389, -0.0149} -- }, - -- ['1969-7-20T20:13:43'] = { + -- ["1969-7-20T20:13:43"] = { -- Type = "StaticRotation", -- Rotation = {-0.7923, -0.0358, -0.0138} -- }, - -- ['1969-7-20T20:13:43'] = { + -- ["1969-7-20T20:13:43"] = { -- Type = "StaticRotation", -- Rotation = {-0.7988, -0.0267, -0.0125} -- }, - -- ['1969-7-20T20:13:45'] = { + -- ["1969-7-20T20:13:45"] = { -- Type = "StaticRotation", -- Rotation = {-0.7909, -0.0128, -0.0094} -- }, - -- ['1969-7-20T20:13:45'] = { + -- ["1969-7-20T20:13:45"] = { -- Type = "StaticRotation", -- Rotation = {-0.7967, -0.0061, -0.0080} -- }, - -- ['1969-7-20T20:13:47'] = { + -- ["1969-7-20T20:13:47"] = { -- Type = "StaticRotation", -- Rotation = {-0.7748, -0.0207, -0.0056} -- }, - -- ['1969-7-20T20:13:47'] = { + -- ["1969-7-20T20:13:47"] = { -- Type = "StaticRotation", -- Rotation = {-0.7681, -0.0278, -0.0048} -- }, - -- ['1969-7-20T20:13:49'] = { + -- ["1969-7-20T20:13:49"] = { -- Type = "StaticRotation", -- Rotation = {-0.7574, -0.0426, -0.0027} -- }, - -- ['1969-7-20T20:13:49'] = { + -- ["1969-7-20T20:13:49"] = { -- Type = "StaticRotation", -- Rotation = {-0.7582, -0.0364, -0.0004} -- }, - -- ['1969-7-20T20:13:51'] = { + -- ["1969-7-20T20:13:51"] = { -- Type = "StaticRotation", -- Rotation = {-0.7699, -0.0324, 0.0036} -- }, - -- ['1969-7-20T20:13:51'] = { + -- ["1969-7-20T20:13:51"] = { -- Type = "StaticRotation", -- Rotation = {-0.7676, -0.0245, 0.0040} -- }, - -- ['1969-7-20T20:13:53'] = { + -- ["1969-7-20T20:13:53"] = { -- Type = "StaticRotation", -- Rotation = {-0.7733, -0.0194, 0.0023} -- }, - -- ['1969-7-20T20:13:53'] = { + -- ["1969-7-20T20:13:53"] = { -- Type = "StaticRotation", -- Rotation = {-0.7574, -0.0207, 0.0008} -- }, - -- ['1969-7-20T20:13:55'] = { + -- ["1969-7-20T20:13:55"] = { -- Type = "StaticRotation", -- Rotation = {-0.7440, -0.0310, -0.0017} -- }, - -- ['1969-7-20T20:13:55'] = { + -- ["1969-7-20T20:13:55"] = { -- Type = "StaticRotation", -- Rotation = {-0.7405, -0.0569, -0.0044} -- }, - -- ['1969-7-20T20:13:57'] = { + -- ["1969-7-20T20:13:57"] = { -- Type = "StaticRotation", -- Rotation = {-0.7549, -0.0587, -0.0054} -- }, - -- ['1969-7-20T20:13:57'] = { + -- ["1969-7-20T20:13:57"] = { -- Type = "StaticRotation", -- Rotation = {-0.7518, -0.0326, -0.0046} -- }, - -- ['1969-7-20T20:13:59'] = { + -- ["1969-7-20T20:13:59"] = { -- Type = "StaticRotation", -- Rotation = {-0.7465, 0.0040, -0.0050} -- }, - -- ['1969-7-20T20:13:59'] = { + -- ["1969-7-20T20:13:59"] = { -- Type = "StaticRotation", -- Rotation = {-0.7465, 0.0113, -0.0050} -- }, - -- ['1969-7-20T20:14:1'] = { + -- ["1969-7-20T20:14:1"] = { -- Type = "StaticRotation", -- Rotation = {-0.6939, 0.0029, -0.0063} -- }, - -- ['1969-7-20T20:14:2'] = { + -- ["1969-7-20T20:14:2"] = { -- Type = "StaticRotation", -- Rotation = {-0.6912, 0.0079, -0.0079} -- }, - -- ['1969-7-20T20:14:3'] = { + -- ["1969-7-20T20:14:3"] = { -- Type = "StaticRotation", -- Rotation = {-0.6793, 0.0048, -0.0077} -- }, - -- ['1969-7-20T20:14:4'] = { + -- ["1969-7-20T20:14:4"] = { -- Type = "StaticRotation", -- Rotation = {-0.6817, 0.0090, -0.0098} -- }, - -- ['1969-7-20T20:14:5'] = { + -- ["1969-7-20T20:14:5"] = { -- Type = "StaticRotation", -- Rotation = {-0.6730, 0.0117, -0.0090} -- }, - -- ['1969-7-20T20:14:6'] = { + -- ["1969-7-20T20:14:6"] = { -- Type = "StaticRotation", -- Rotation = {-0.6684, 0.0102, -0.0096} -- }, - -- ['1969-7-20T20:14:7'] = { + -- ["1969-7-20T20:14:7"] = { -- Type = "StaticRotation", -- Rotation = {-0.6604, 0.0115, -0.0109} -- }, - -- ['1969-7-20T20:14:7'] = { + -- ["1969-7-20T20:14:7"] = { -- Type = "StaticRotation", -- Rotation = {-0.6418, 0.0006, -0.0098} -- }, - -- ['1969-7-20T20:14:9'] = { + -- ["1969-7-20T20:14:9"] = { -- Type = "StaticRotation", -- Rotation = {-0.6301, -0.0067, -0.0121} -- }, - -- ['1969-7-20T20:14:10'] = { + -- ["1969-7-20T20:14:10"] = { -- Type = "StaticRotation", -- Rotation = {-0.6128, -0.0142, -0.0119} -- }, - -- ['1969-7-20T20:14:11'] = { + -- ["1969-7-20T20:14:11"] = { -- Type = "StaticRotation", -- Rotation = {-0.6180, -0.0134, -0.0119} -- }, - -- ['1969-7-20T20:14:12'] = { + -- ["1969-7-20T20:14:12"] = { -- Type = "StaticRotation", -- Rotation = {-0.6249, -0.0057, -0.0121} -- }, - -- ['1969-7-20T20:14:13'] = { + -- ["1969-7-20T20:14:13"] = { -- Type = "StaticRotation", -- Rotation = {-0.6299, -0.0057, -0.0098} -- }, - -- ['1969-7-20T20:14:14'] = { + -- ["1969-7-20T20:14:14"] = { -- Type = "StaticRotation", -- Rotation = {-0.6437, -0.0009, -0.0100} -- }, - -- ['1969-7-20T20:14:15'] = { + -- ["1969-7-20T20:14:15"] = { -- Type = "StaticRotation", -- Rotation = {-0.6328, -0.0105, -0.0100} -- }, - -- ['1969-7-20T20:14:16'] = { + -- ["1969-7-20T20:14:16"] = { -- Type = "StaticRotation", -- Rotation = {-0.6285, -0.0232, -0.0088} -- }, - -- ['1969-7-20T20:14:17'] = { + -- ["1969-7-20T20:14:17"] = { -- Type = "StaticRotation", -- Rotation = {-0.6195, -0.0291, -0.0117} -- }, - -- ['1969-7-20T20:14:18'] = { + -- ["1969-7-20T20:14:18"] = { -- Type = "StaticRotation", -- Rotation = {-0.6073, -0.0374, -0.0127} -- }, - -- ['1969-7-20T20:14:19'] = { + -- ["1969-7-20T20:14:19"] = { -- Type = "StaticRotation", -- Rotation = {-0.6027, -0.0362, -0.0132} -- }, - -- ['1969-7-20T20:14:20'] = { + -- ["1969-7-20T20:14:20"] = { -- Type = "StaticRotation", -- Rotation = {-0.5892, -0.0314, -0.0147} -- }, - -- ['1969-7-20T20:14:21'] = { + -- ["1969-7-20T20:14:21"] = { -- Type = "StaticRotation", -- Rotation = {-0.5829, -0.0096, -0.0157} -- }, - -- ['1969-7-20T20:14:23'] = { + -- ["1969-7-20T20:14:23"] = { -- Type = "StaticRotation", -- Rotation = {-0.5674, 0.0119, -0.0263} -- }, - -- ['1969-7-20T20:14:23'] = { + -- ["1969-7-20T20:14:23"] = { -- Type = "StaticRotation", -- Rotation = {-0.5674, 0.0261, -0.0324} -- }, - -- ['1969-7-20T20:14:25'] = { + -- ["1969-7-20T20:14:25"] = { -- Type = "StaticRotation", -- Rotation = {-0.5637, 0.0232, -0.0439} -- }, - -- ['1969-7-20T20:14:26'] = { + -- ["1969-7-20T20:14:26"] = { -- Type = "StaticRotation", -- Rotation = {-0.5670, 0.0081, -0.0525} -- }, - -- ['1969-7-20T20:14:27'] = { + -- ["1969-7-20T20:14:27"] = { -- Type = "StaticRotation", -- Rotation = {-0.5739, 0.0013, -0.0564} -- }, - -- ['1969-7-20T20:14:28'] = { + -- ["1969-7-20T20:14:28"] = { -- Type = "StaticRotation", -- Rotation = {-0.5660, -0.0021, -0.0587} -- }, - -- ['1969-7-20T20:14:29'] = { + -- ["1969-7-20T20:14:29"] = { -- Type = "StaticRotation", -- Rotation = {-0.5603, -0.0025, -0.0604} -- }, - -- ['1969-7-20T20:14:30'] = { + -- ["1969-7-20T20:14:30"] = { -- Type = "StaticRotation", -- Rotation = {-0.5394, 0.0092, -0.0562} -- }, - ['1969-7-20T20:10:00'] = { + ["1969-7-20T20:10:00"] = { Type = "StaticRotation", Rotation = {0, 0, 1.5708} }, - ['1969-7-20T20:12:10'] = { + ["1969-7-20T20:12:10"] = { Type = "StaticRotation", Rotation = {0, 0, 1.5708} }, - ['1969-7-20T20:12:14'] = { + ["1969-7-20T20:12:14"] = { Type = "StaticRotation", Rotation = {0, 0, 1.5708} }, - ['1969-7-20T20:14:30'] = { + ["1969-7-20T20:14:30"] = { Type = "StaticRotation", Rotation = {0, 0, 1.5708} }, - ['1969-7-20T20:14:31'] = { + ["1969-7-20T20:14:31"] = { Type = "StaticRotation", Rotation = {-0.5133, 0.0131, -0.0531} }, - ['1969-7-20T20:14:32'] = { + ["1969-7-20T20:14:32"] = { Type = "StaticRotation", Rotation = {-0.5043, 0.0117, -0.0487} }, - ['1969-7-20T20:14:33'] = { + ["1969-7-20T20:14:33"] = { Type = "StaticRotation", Rotation = {-0.4893, 0.0090, -0.0447} }, - ['1969-7-20T20:14:33'] = { + ["1969-7-20T20:14:33"] = { Type = "StaticRotation", Rotation = {-0.4851, -0.0008, -0.0429} }, - ['1969-7-20T20:14:35'] = { + ["1969-7-20T20:14:35"] = { Type = "StaticRotation", Rotation = {-0.4865, -0.0057, -0.0382} }, - ['1969-7-20T20:14:35'] = { + ["1969-7-20T20:14:35"] = { Type = "StaticRotation", Rotation = {-0.4788, -0.0073, -0.0345} }, - ['1969-7-20T20:14:37'] = { + ["1969-7-20T20:14:37"] = { Type = "StaticRotation", Rotation = {-0.4824, -0.0130, -0.0307} }, - ['1969-7-20T20:14:37'] = { + ["1969-7-20T20:14:37"] = { Type = "StaticRotation", Rotation = {-0.4836, -0.0103, -0.0268} }, - ['1969-7-20T20:14:39'] = { + ["1969-7-20T20:14:39"] = { Type = "StaticRotation", Rotation = {-0.4792, -0.0121, -0.0203} }, - ['1969-7-20T20:14:40'] = { + ["1969-7-20T20:14:40"] = { Type = "StaticRotation", Rotation = {-0.4874, -0.0140, -0.0211} }, - ['1969-7-20T20:14:41'] = { + ["1969-7-20T20:14:41"] = { Type = "StaticRotation", Rotation = {-0.5030, 0.0002, -0.0209} }, - ['1969-7-20T20:14:42'] = { + ["1969-7-20T20:14:42"] = { Type = "StaticRotation", Rotation = {-0.5361, -0.0040, -0.0209} }, - ['1969-7-20T20:14:44'] = { + ["1969-7-20T20:14:44"] = { Type = "StaticRotation", Rotation = {-0.4715, -0.0040, -0.0234} }, - ['1969-7-20T20:14:45'] = { + ["1969-7-20T20:14:45"] = { Type = "StaticRotation", Rotation = {-0.4433, -0.0050, -0.0238} }, - ['1969-7-20T20:14:46'] = { + ["1969-7-20T20:14:46"] = { Type = "StaticRotation", Rotation = {-0.4280, -0.0019, -0.0268} }, - ['1969-7-20T20:14:47'] = { + ["1969-7-20T20:14:47"] = { Type = "StaticRotation", Rotation = {-0.4310, -0.0069, -0.0259} }, - ['1969-7-20T20:14:48'] = { + ["1969-7-20T20:14:48"] = { Type = "StaticRotation", Rotation = {-0.4389, -0.0147, -0.0257} }, - ['1969-7-20T20:14:49'] = { + ["1969-7-20T20:14:49"] = { Type = "StaticRotation", Rotation = {-0.4519, -0.0178, -0.0287} }, - ['1969-7-20T20:14:50'] = { + ["1969-7-20T20:14:50"] = { Type = "StaticRotation", Rotation = {-0.4579, -0.0201, -0.0278} }, - ['1969-7-20T20:14:51'] = { + ["1969-7-20T20:14:51"] = { Type = "StaticRotation", Rotation = {-0.4554, -0.0147, -0.0265} }, - ['1969-7-20T20:14:52'] = { + ["1969-7-20T20:14:52"] = { Type = "StaticRotation", Rotation = {-0.4468, -0.0084, -0.0284} }, - ['1969-7-20T20:14:53'] = { + ["1969-7-20T20:14:53"] = { Type = "StaticRotation", Rotation = {-0.4316, -0.0127, -0.0268} }, - ['1969-7-20T20:14:53'] = { + ["1969-7-20T20:14:53"] = { Type = "StaticRotation", Rotation = {-0.4228, -0.0171, -0.0255} }, - ['1969-7-20T20:14:55'] = { + ["1969-7-20T20:14:55"] = { Type = "StaticRotation", Rotation = {-0.4046, -0.0174, -0.0274} }, - ['1969-7-20T20:14:57'] = { + ["1969-7-20T20:14:57"] = { Type = "StaticRotation", Rotation = {-0.3806, -0.0211, -0.0243} }, - ['1969-7-20T20:14:57'] = { + ["1969-7-20T20:14:57"] = { Type = "StaticRotation", Rotation = {-0.3751, -0.0178, -0.0249} }, - ['1969-7-20T20:14:59'] = { + ["1969-7-20T20:14:59"] = { Type = "StaticRotation", Rotation = {-0.3670, -0.0153, -0.0230} }, - ['1969-7-20T20:14:59'] = { + ["1969-7-20T20:14:59"] = { Type = "StaticRotation", Rotation = {-0.3641, -0.0100, -0.0209} }, - ['1969-7-20T20:15:1'] = { + ["1969-7-20T20:15:1"] = { Type = "StaticRotation", Rotation = {-0.3526, -0.0021, -0.0207} }, - ['1969-7-20T20:15:1'] = { + ["1969-7-20T20:15:1"] = { Type = "StaticRotation", Rotation = {-0.3457, -0.0038, -0.0195} }, - ['1969-7-20T20:15:3'] = { + ["1969-7-20T20:15:3"] = { Type = "StaticRotation", Rotation = {-0.3371, -0.0038, -0.0161} }, - ['1969-7-20T20:15:3'] = { + ["1969-7-20T20:15:3"] = { Type = "StaticRotation", Rotation = {-0.3309, -0.0015, -0.0192} }, - ['1969-7-20T20:15:5'] = { + ["1969-7-20T20:15:5"] = { Type = "StaticRotation", Rotation = {-0.3263, -0.0096, -0.0232} }, - ['1969-7-20T20:15:5'] = { + ["1969-7-20T20:15:5"] = { Type = "StaticRotation", Rotation = {-0.3240, 0.0015, -0.0243} }, - ['1969-7-20T20:15:7'] = { + ["1969-7-20T20:15:7"] = { Type = "StaticRotation", Rotation = {-0.3160, 0.0061, -0.0295} }, - ['1969-7-20T20:15:7'] = { + ["1969-7-20T20:15:7"] = { Type = "StaticRotation", Rotation = {-0.3135, 0.0035, -0.0318} }, - ['1969-7-20T20:15:9'] = { + ["1969-7-20T20:15:9"] = { Type = "StaticRotation", Rotation = {-0.3074, 0.0108, -0.0341} }, - ['1969-7-20T20:15:9'] = { + ["1969-7-20T20:15:9"] = { Type = "StaticRotation", Rotation = {-0.3022, 0.0027, -0.0360} }, - ['1969-7-20T20:15:11'] = { + ["1969-7-20T20:15:11"] = { Type = "StaticRotation", Rotation = {-0.2995, -0.0061, -0.0406} }, - ['1969-7-20T20:15:11'] = { + ["1969-7-20T20:15:11"] = { Type = "StaticRotation", Rotation = {-0.2976, -0.0098, -0.0416} }, - ['1969-7-20T20:15:13'] = { + ["1969-7-20T20:15:13"] = { Type = "StaticRotation", Rotation = {-0.2901, -0.0127, -0.0447} }, - ['1969-7-20T20:15:14'] = { + ["1969-7-20T20:15:14"] = { Type = "StaticRotation", Rotation = {-0.2886, -0.0169, -0.0470} }, - ['1969-7-20T20:15:15'] = { + ["1969-7-20T20:15:15"] = { Type = "StaticRotation", Rotation = {-0.2700, -0.0174, -0.0491} }, - ['1969-7-20T20:15:15'] = { + ["1969-7-20T20:15:15"] = { Type = "StaticRotation", Rotation = {-0.2107, -0.0119, -0.0512} }, - ['1969-7-20T20:15:17'] = { + ["1969-7-20T20:15:17"] = { Type = "StaticRotation", Rotation = {-0.1630, -0.0123, -0.0560} }, - ['1969-7-20T20:15:18'] = { + ["1969-7-20T20:15:18"] = { Type = "StaticRotation", Rotation = {-0.1101, -0.0077, -0.0583} }, - ['1969-7-20T20:15:19'] = { + ["1969-7-20T20:15:19"] = { Type = "StaticRotation", Rotation = {-0.0868, -0.0029, -0.0613} }, - ['1969-7-20T20:15:19'] = { + ["1969-7-20T20:15:19"] = { Type = "StaticRotation", Rotation = {-0.0893, -0.0036, -0.0642} }, - ['1969-7-20T20:15:21'] = { + ["1969-7-20T20:15:21"] = { Type = "StaticRotation", Rotation = {-0.0892, -0.0029, -0.0675} }, - ['1969-7-20T20:15:21'] = { + ["1969-7-20T20:15:21"] = { Type = "StaticRotation", Rotation = {-0.0970, -0.0004, -0.0698} }, - ['1969-7-20T20:15:23'] = { + ["1969-7-20T20:15:23"] = { Type = "StaticRotation", Rotation = {-0.1020, -0.0079, -0.0736} }, - ['1969-7-20T20:15:24'] = { + ["1969-7-20T20:15:24"] = { Type = "StaticRotation", Rotation = {-0.0959, -0.0069, -0.0771} }, - ['1969-7-20T20:15:25'] = { + ["1969-7-20T20:15:25"] = { Type = "StaticRotation", Rotation = {-0.0999, -0.0057, -0.0794} }, - ['1969-7-20T20:15:26'] = { + ["1969-7-20T20:15:26"] = { Type = "StaticRotation", Rotation = {-0.1001, -0.0075, -0.0828} }, - ['1969-7-20T20:15:27'] = { + ["1969-7-20T20:15:27"] = { Type = "StaticRotation", Rotation = {-0.0966, -0.0067, -0.0849} }, - ['1969-7-20T20:15:28'] = { + ["1969-7-20T20:15:28"] = { Type = "StaticRotation", Rotation = {-0.1039, -0.0050, -0.0876} }, - ['1969-7-20T20:15:29'] = { + ["1969-7-20T20:15:29"] = { Type = "StaticRotation", Rotation = {-0.1055, -0.0059, -0.0893} }, - ['1969-7-20T20:15:30'] = { + ["1969-7-20T20:15:30"] = { Type = "StaticRotation", Rotation = {-0.1010, -0.0050, -0.0909} }, - ['1969-7-20T20:15:31'] = { + ["1969-7-20T20:15:31"] = { Type = "StaticRotation", Rotation = {-0.1066, -0.0036, -0.0903} }, - ['1969-7-20T20:15:32'] = { + ["1969-7-20T20:15:32"] = { Type = "StaticRotation", Rotation = {-0.1106, -0.0032, -0.0882} }, - ['1969-7-20T20:15:33'] = { + ["1969-7-20T20:15:33"] = { Type = "StaticRotation", Rotation = {-0.1074, -0.0019, -0.0874} }, - ['1969-7-20T20:15:34'] = { + ["1969-7-20T20:15:34"] = { Type = "StaticRotation", Rotation = {-0.1131, 0.0021, -0.0857} }, - ['1969-7-20T20:15:35'] = { + ["1969-7-20T20:15:35"] = { Type = "StaticRotation", Rotation = {-0.1193, 0.0036, -0.0842} }, - ['1969-7-20T20:15:36'] = { + ["1969-7-20T20:15:36"] = { Type = "StaticRotation", Rotation = {-0.1193, 0.0083, -0.0819} }, - ['1969-7-20T20:15:37'] = { + ["1969-7-20T20:15:37"] = { Type = "StaticRotation", Rotation = {-0.1233, 0.0129, -0.0809} }, - ['1969-7-20T20:15:38'] = { + ["1969-7-20T20:15:38"] = { Type = "StaticRotation", Rotation = {-0.1365, 0.0194, -0.0786} }, - ['1969-7-20T20:15:39'] = { + ["1969-7-20T20:15:39"] = { Type = "StaticRotation", Rotation = {-0.1334, 0.0230, -0.0765} }, - ['1969-7-20T20:15:40'] = { + ["1969-7-20T20:15:40"] = { Type = "StaticRotation", Rotation = {-0.1267, 0.0257, -0.0744} }, - ['1969-7-20T20:15:41'] = { + ["1969-7-20T20:15:41"] = { Type = "StaticRotation", Rotation = {-0.1271, 0.0288, -0.0732} }, - ['1969-7-20T20:15:42'] = { + ["1969-7-20T20:15:42"] = { Type = "StaticRotation", Rotation = {-0.1206, 0.0272, -0.0700} }, - ['1969-7-20T20:15:43'] = { + ["1969-7-20T20:15:43"] = { Type = "StaticRotation", Rotation = {-0.1465, 0.0244, -0.0692} }, - ['1969-7-20T20:15:44'] = { + ["1969-7-20T20:15:44"] = { Type = "StaticRotation", Rotation = {-0.1931, 0.0217, -0.0692} }, - ['1969-7-20T20:15:45'] = { + ["1969-7-20T20:15:45"] = { Type = "StaticRotation", Rotation = {-0.1981, 0.0205, -0.0679} }, - ['1969-7-20T20:15:46'] = { + ["1969-7-20T20:15:46"] = { Type = "StaticRotation", Rotation = {-0.2048, 0.0173, -0.0656} }, - ['1969-7-20T20:15:47'] = { + ["1969-7-20T20:15:47"] = { Type = "StaticRotation", Rotation = {-0.2151, 0.0169, -0.0650} }, - ['1969-7-20T20:15:48'] = { + ["1969-7-20T20:15:48"] = { Type = "StaticRotation", Rotation = {-0.2385, 0.0132, -0.0633} }, - ['1969-7-20T20:15:49'] = { + ["1969-7-20T20:15:49"] = { Type = "StaticRotation", Rotation = {-0.2590, 0.0092, -0.0623} }, - ['1969-7-20T20:15:50'] = { + ["1969-7-20T20:15:50"] = { Type = "StaticRotation", Rotation = {-0.2607, 0.0077, -0.0608} }, - ['1969-7-20T20:15:51'] = { + ["1969-7-20T20:15:51"] = { Type = "StaticRotation", Rotation = {-0.2646, 0.0056, -0.0600} }, - ['1969-7-20T20:15:52'] = { + ["1969-7-20T20:15:52"] = { Type = "StaticRotation", Rotation = {-0.2680, 0.0004, -0.0575} }, - ['1969-7-20T20:15:53'] = { + ["1969-7-20T20:15:53"] = { Type = "StaticRotation", Rotation = {-0.2682, -0.0011, -0.0560} }, - ['1969-7-20T20:15:54'] = { + ["1969-7-20T20:15:54"] = { Type = "StaticRotation", Rotation = {-0.2742, -0.0044, -0.0543} }, - ['1969-7-20T20:15:55'] = { + ["1969-7-20T20:15:55"] = { Type = "StaticRotation", Rotation = {-0.2757, -0.0061, -0.0522} }, - ['1969-7-20T20:15:56'] = { + ["1969-7-20T20:15:56"] = { Type = "StaticRotation", Rotation = {-0.2727, -0.0065, -0.0491} }, - ['1969-7-20T20:15:57'] = { + ["1969-7-20T20:15:57"] = { Type = "StaticRotation", Rotation = {-0.2724, -0.0063, -0.0474} }, - ['1969-7-20T20:15:58'] = { + ["1969-7-20T20:15:58"] = { Type = "StaticRotation", Rotation = {-0.2732, -0.0077, -0.0445} }, - ['1969-7-20T20:15:59'] = { + ["1969-7-20T20:15:59"] = { Type = "StaticRotation", Rotation = {-0.2709, -0.0092, -0.0420} }, - ['1969-7-20T20:16:0'] = { + ["1969-7-20T20:16:0"] = { Type = "StaticRotation", Rotation = {-0.2690, -0.0102, -0.0387} }, - ['1969-7-20T20:16:1'] = { + ["1969-7-20T20:16:1"] = { Type = "StaticRotation", Rotation = {-0.2704, -0.0115, -0.0368} }, - ['1969-7-20T20:16:2'] = { + ["1969-7-20T20:16:2"] = { Type = "StaticRotation", Rotation = {-0.2704, -0.0142, -0.0332} }, - ['1969-7-20T20:16:3'] = { + ["1969-7-20T20:16:3"] = { Type = "StaticRotation", Rotation = {-0.2700, -0.0153, -0.0305} }, - ['1969-7-20T20:16:4'] = { + ["1969-7-20T20:16:4"] = { Type = "StaticRotation", Rotation = {-0.2736, -0.0176, -0.0268} }, - ['1969-7-20T20:16:5'] = { + ["1969-7-20T20:16:5"] = { Type = "StaticRotation", Rotation = {-0.2752, -0.0199, -0.0243} }, - ['1969-7-20T20:16:6'] = { + ["1969-7-20T20:16:6"] = { Type = "StaticRotation", Rotation = {-0.2752, -0.0238, -0.0207} }, - ['1969-7-20T20:16:7'] = { + ["1969-7-20T20:16:7"] = { Type = "StaticRotation", Rotation = {-0.2702, -0.0245, -0.0205} }, - ['1969-7-20T20:16:8'] = { + ["1969-7-20T20:16:8"] = { Type = "StaticRotation", Rotation = {-0.1841, -0.0217, -0.0219} }, - ['1969-7-20T20:16:9'] = { + ["1969-7-20T20:16:9"] = { Type = "StaticRotation", Rotation = {-0.1632, -0.0217, -0.0226} }, - ['1969-7-20T20:16:26'] = { + ["1969-7-20T20:16:26"] = { Type = "StaticRotation", Rotation = {-0.0989, -0.0184, -0.0391} }, - ['1969-7-20T20:16:27'] = { + ["1969-7-20T20:16:27"] = { Type = "StaticRotation", Rotation = {-0.0968, -0.0167, -0.0393} }, - ['1969-7-20T20:16:28'] = { + ["1969-7-20T20:16:28"] = { Type = "StaticRotation", Rotation = {-0.0171, -0.0103, -0.0406} }, - ['1969-7-20T20:16:29'] = { + ["1969-7-20T20:16:29"] = { Type = "StaticRotation", Rotation = {-0.0157, -0.0105, -0.0412} }, - ['1969-7-20T20:16:30'] = { + ["1969-7-20T20:16:30"] = { Type = "StaticRotation", Rotation = {0.0127, -0.0103, -0.0427} }, - ['1969-7-20T20:16:31'] = { + ["1969-7-20T20:16:31"] = { Type = "StaticRotation", Rotation = {0.0134, -0.0147, -0.0433} }, - ['1969-7-20T20:16:32'] = { + ["1969-7-20T20:16:32"] = { Type = "StaticRotation", Rotation = {0.0042, -0.0370, -0.0470} }, - ['1969-7-20T20:16:33'] = { + ["1969-7-20T20:16:33"] = { Type = "StaticRotation", Rotation = {0.0092, -0.0506, -0.0487} }, - ['1969-7-20T20:16:34'] = { + ["1969-7-20T20:16:34"] = { Type = "StaticRotation", Rotation = {0.0244, -0.0512, -0.0510} }, - ['1969-7-20T20:16:35'] = { + ["1969-7-20T20:16:35"] = { Type = "StaticRotation", Rotation = {0.0042, -0.0546, -0.0512} }, - ['1969-7-20T20:16:36'] = { + ["1969-7-20T20:16:36"] = { Type = "StaticRotation", Rotation = {-0.0006, -0.0558, -0.0533} }, - ['1969-7-20T20:16:37'] = { + ["1969-7-20T20:16:37"] = { Type = "StaticRotation", Rotation = {0.0050, -0.0522, -0.0543} }, - ['1969-7-20T20:16:38'] = { + ["1969-7-20T20:16:38"] = { Type = "StaticRotation", Rotation = {0.0077, -0.0343, -0.0548} }, - ['1969-7-20T20:16:39'] = { + ["1969-7-20T20:16:39"] = { Type = "StaticRotation", Rotation = {-0.0004, -0.0155, -0.0550} }, - ['1969-7-20T20:16:40'] = { + ["1969-7-20T20:16:40"] = { Type = "StaticRotation", Rotation = {0.0036, -0.0105, -0.0571} }, - ['1969-7-20T20:16:41'] = { + ["1969-7-20T20:16:41"] = { Type = "StaticRotation", Rotation = {-0.0080, -0.0086, -0.0579} }, - ['1969-7-20T20:16:42'] = { + ["1969-7-20T20:16:42"] = { Type = "StaticRotation", Rotation = {-0.0698, -0.0140, -0.0604} }, - ['1969-7-20T20:16:43'] = { + ["1969-7-20T20:16:43"] = { Type = "StaticRotation", Rotation = {-0.0579, -0.0134, -0.0623} }, - ['1969-7-20T20:16:44'] = { + ["1969-7-20T20:16:44"] = { Type = "StaticRotation", Rotation = {-0.0462, -0.0090, -0.0648} }, - ['1969-7-20T20:16:45'] = { + ["1969-7-20T20:16:45"] = { Type = "StaticRotation", Rotation = {-0.0466, -0.0067, -0.0665} }, - ['1969-7-20T20:16:46'] = { + ["1969-7-20T20:16:46"] = { Type = "StaticRotation", Rotation = {-0.0529, -0.0027, -0.0694} }, - ['1969-7-20T20:16:47'] = { + ["1969-7-20T20:16:47"] = { Type = "StaticRotation", Rotation = {-0.0518, 0.0079, -0.0707} }, - ['1969-7-20T20:16:48'] = { + ["1969-7-20T20:16:48"] = { Type = "StaticRotation", Rotation = {-0.0602, 0.0299, -0.0729} }, - ['1969-7-20T20:16:49'] = { + ["1969-7-20T20:16:49"] = { Type = "StaticRotation", Rotation = {-0.0510, 0.0562, -0.0729} }, - ['1969-7-20T20:16:50'] = { + ["1969-7-20T20:16:50"] = { Type = "StaticRotation", Rotation = {-0.0539, 0.0562, -0.0765} }, - ['1969-7-20T20:16:51'] = { + ["1969-7-20T20:16:51"] = { Type = "StaticRotation", Rotation = {-0.0928, 0.0545, -0.0813} }, - ['1969-7-20T20:16:52'] = { + ["1969-7-20T20:16:52"] = { Type = "StaticRotation", Rotation = {-0.0886, 0.0560, -0.0844} }, - ['1969-7-20T20:16:53'] = { + ["1969-7-20T20:16:53"] = { Type = "StaticRotation", Rotation = {-0.0832, 0.0552, -0.0865} }, - ['1969-7-20T20:16:54'] = { + ["1969-7-20T20:16:54"] = { Type = "StaticRotation", Rotation = {-0.0805, 0.0573, -0.0899} }, - ['1969-7-20T20:16:55'] = { + ["1969-7-20T20:16:55"] = { Type = "StaticRotation", Rotation = {-0.0784, 0.0614, -0.0924} }, - ['1969-7-20T20:16:56'] = { + ["1969-7-20T20:16:56"] = { Type = "StaticRotation", Rotation = {-0.0729, 0.0635, -0.0945} }, - ['1969-7-20T20:16:57'] = { + ["1969-7-20T20:16:57"] = { Type = "StaticRotation", Rotation = {-0.0792, 0.0627, -0.0976} }, - ['1969-7-20T20:17:7'] = { + ["1969-7-20T20:17:7"] = { Type = "StaticRotation", Rotation = {-0.1056, -0.0366, -0.1402} }, - ['1969-7-20T20:17:7'] = { + ["1969-7-20T20:17:7"] = { Type = "StaticRotation", Rotation = {-0.1053, -0.0395, -0.1428} }, - ['1969-7-20T20:17:9'] = { + ["1969-7-20T20:17:9"] = { Type = "StaticRotation", Rotation = {-0.0725, -0.0314, -0.1503} }, - ['1969-7-20T20:17:9'] = { + ["1969-7-20T20:17:9"] = { Type = "StaticRotation", Rotation = {-0.0259, -0.0270, -0.1542} }, - ['1969-7-20T20:17:11'] = { + ["1969-7-20T20:17:11"] = { Type = "StaticRotation", Rotation = {0.0874, -0.0059, -0.1614} }, - ['1969-7-20T20:17:12'] = { + ["1969-7-20T20:17:12"] = { Type = "StaticRotation", Rotation = {0.0769, -0.0096, -0.1678} }, - ['1969-7-20T20:17:13'] = { + ["1969-7-20T20:17:13"] = { Type = "StaticRotation", Rotation = {0.0740, -0.0270, -0.1743} }, - ['1969-7-20T20:17:14'] = { + ["1969-7-20T20:17:14"] = { Type = "StaticRotation", Rotation = {0.0673, -0.0458, -0.1810} }, - ['1969-7-20T20:17:15'] = { + ["1969-7-20T20:17:15"] = { Type = "StaticRotation", Rotation = {0.0550, -0.0506, -0.1860} }, - ['1969-7-20T20:17:16'] = { + ["1969-7-20T20:17:16"] = { Type = "StaticRotation", Rotation = {0.0449, -0.0577, -0.1931} }, - ['1969-7-20T20:17:17'] = { + ["1969-7-20T20:17:17"] = { Type = "StaticRotation", Rotation = {0.0437, -0.0617, -0.1967} }, - ['1969-7-20T20:17:18'] = { + ["1969-7-20T20:17:18"] = { Type = "StaticRotation", Rotation = {0.0297, -0.0650, -0.2027} }, - ['1969-7-20T20:17:19'] = { + ["1969-7-20T20:17:19"] = { Type = "StaticRotation", Rotation = {0.0203, -0.0518, -0.2061} }, - ['1969-7-20T20:17:20'] = { + ["1969-7-20T20:17:20"] = { Type = "StaticRotation", Rotation = {0.0211, -0.0201, -0.2109} }, - ['1969-7-20T20:17:21'] = { + ["1969-7-20T20:17:21"] = { Type = "StaticRotation", Rotation = {0.0228, -0.0197, -0.2159} }, - ['1969-7-20T20:17:22'] = { + ["1969-7-20T20:17:22"] = { Type = "StaticRotation", Rotation = {-0.0201, -0.0257, -0.2230} }, - ['1969-7-20T20:17:23'] = { + ["1969-7-20T20:17:23"] = { Type = "StaticRotation", Rotation = {-0.0299, -0.0125, -0.2287} }, - ['1969-7-20T20:17:24'] = { + ["1969-7-20T20:17:24"] = { Type = "StaticRotation", Rotation = {-0.0368, -0.0025, -0.2355} }, - ['1969-7-20T20:17:25'] = { + ["1969-7-20T20:17:25"] = { Type = "StaticRotation", Rotation = {-0.0464, 0.0209, -0.2408} }, - ['1969-7-20T20:17:26'] = { + ["1969-7-20T20:17:26"] = { Type = "StaticRotation", Rotation = {-0.0548, 0.0474, -0.2472} }, - ['1969-7-20T20:17:27'] = { + ["1969-7-20T20:17:27"] = { Type = "StaticRotation", Rotation = {-0.0535, 0.0464, -0.2481} }, - ['1969-7-20T20:17:28'] = { + ["1969-7-20T20:17:28"] = { Type = "StaticRotation", Rotation = {-0.0512, 0.0508, -0.2491} }, - ['1969-7-20T20:17:29'] = { + ["1969-7-20T20:17:29"] = { Type = "StaticRotation", Rotation = {-0.0625, 0.0781, -0.2504} }, - ['1969-7-20T20:17:30'] = { + ["1969-7-20T20:17:30"] = { Type = "StaticRotation", Rotation = {-0.0811, 0.0711, -0.2531} }, - ['1969-7-20T20:17:31'] = { + ["1969-7-20T20:17:31"] = { Type = "StaticRotation", Rotation = {-0.0855, 0.0692, -0.2544} }, - ['1969-7-20T20:17:32'] = { + ["1969-7-20T20:17:32"] = { Type = "StaticRotation", Rotation = {-0.0940, 0.0673, -0.2569} }, - ['1969-7-20T20:17:33'] = { + ["1969-7-20T20:17:33"] = { Type = "StaticRotation", Rotation = {-0.0963, 0.0648, -0.2587} }, - ['1969-7-20T20:17:34'] = { + ["1969-7-20T20:17:34"] = { Type = "StaticRotation", Rotation = {-0.0909, 0.0619, -0.2587} }, - ['1969-7-20T20:17:35'] = { + ["1969-7-20T20:17:35"] = { Type = "StaticRotation", Rotation = {-0.0832, 0.0602, -0.2585} }, - ['1969-7-20T20:17:36'] = { + ["1969-7-20T20:17:36"] = { Type = "StaticRotation", Rotation = {-0.0761, 0.0326, -0.2602} }, - ['1969-7-20T20:17:37'] = { + ["1969-7-20T20:17:37"] = { Type = "StaticRotation", Rotation = {-0.0612, 0.0013, -0.2635} }, - ['1969-7-20T20:17:38'] = { + ["1969-7-20T20:17:38"] = { Type = "StaticRotation", Rotation = {-0.0274, -0.0079, -0.2727} }, - ['1969-7-20T20:17:39'] = { + ["1969-7-20T20:17:39"] = { Type = "StaticRotation", Rotation = {-0.0061, -0.0470, -0.2732} }, - ['1969-7-20T20:17:40'] = { + ["1969-7-20T20:17:40"] = { Type = "StaticRotation", Rotation = {-0.0794, -0.0088, -0.2447} - }, + } }) diff --git a/data/assets/scene/solarsystem/missions/apollo/11/lem_flipbook.asset b/data/assets/scene/solarsystem/missions/apollo/11/lem_flipbook.asset index 29972a0ab0..3172e6c417 100644 --- a/data/assets/scene/solarsystem/missions/apollo/11/lem_flipbook.asset +++ b/data/assets/scene/solarsystem/missions/apollo/11/lem_flipbook.asset @@ -1,5 +1,5 @@ -local helper = asset.require('util/vrt_flipbook_helper') -local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') +local helper = asset.require("util/vrt_flipbook_helper") +local moon_asset = asset.require("scene/solarsystem/planets/earth/moon/moon") local assetPrefix = "A11flip"; local assetGlobe = moon_asset.Moon.Identifier; diff --git a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset index 2db01fb2e5..b45c0086e5 100644 --- a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset +++ b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local moon_transforms = asset.require('scene/solarsystem/planets/earth/moon/moon') -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local moon_transforms = asset.require("scene/solarsystem/planets/earth/moon/moon") +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +asset.require("spice/base") local models = asset.syncedResource({ Name = "Apollo Models", @@ -10,7 +10,7 @@ local models = asset.syncedResource({ Version = 4 }) -local kernels = asset.require('scene/solarsystem/missions/apollo/15/kernels').kernels +local kernels = asset.require("scene/solarsystem/missions/apollo/15/kernels").kernels -- local models = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/missions/apollo/15/kernels.asset b/data/assets/scene/solarsystem/missions/apollo/15/kernels.asset index 841c3a5589..320adc553e 100644 --- a/data/assets/scene/solarsystem/missions/apollo/15/kernels.asset +++ b/data/assets/scene/solarsystem/missions/apollo/15/kernels.asset @@ -8,15 +8,15 @@ local folder = asset.syncedResource({ local kernels = { folder .. "apollo15.0001.tsc", - -- folder .. 'AS15-P_v01.bc', - folder .. 'apollo15.0001.tf', - folder .. 'apollo15MetricAddendum002.ti', - -- folder .. 'apollo15PanoramicAddendum001.ti', - folder .. 'apollo15_metric.0002.ti', - -- folder .. 'apollo15_panoramic.0001.ti', - folder .. 'apollo15-1.bsp', - folder .. 'AS15-M_v01.bc', - -- folder .. 'AS15-M_v01.bsp', + -- folder .. "AS15-P_v01.bc", + folder .. "apollo15.0001.tf", + folder .. "apollo15MetricAddendum002.ti", + -- folder .. "apollo15PanoramicAddendum001.ti", + folder .. "apollo15_metric.0002.ti", + -- folder .. "apollo15_panoramic.0001.ti", + folder .. "apollo15-1.bsp", + folder .. "AS15-M_v01.bc", + -- folder .. "AS15-M_v01.bsp", } -- local kernels = { diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset index 2e561f2980..1a5c6aedd1 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset @@ -1,6 +1,6 @@ -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local asset_helper = asset.require('util/asset_helper') -local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +local asset_helper = asset.require("util/asset_helper") +local moon_asset = asset.require("scene/solarsystem/planets/earth/moon/moon") local models = asset.syncedResource({ Name = "Apollo Boulders Models", diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset index 48de6a578f..becc0e2811 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset @@ -1,6 +1,6 @@ -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local asset_helper = asset.require('util/asset_helper') -local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +local asset_helper = asset.require("util/asset_helper") +local moon_asset = asset.require("scene/solarsystem/planets/earth/moon/moon") local models = asset.syncedResource({ Name = "Apollo Boulders Models", diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset index 4ae286344b..4fa8b779f7 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset @@ -1,6 +1,6 @@ -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local asset_helper = asset.require('util/asset_helper') -local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +local asset_helper = asset.require("util/asset_helper") +local moon_asset = asset.require("scene/solarsystem/planets/earth/moon/moon") local models = asset.syncedResource({ Name = "Apollo Boulders Models", diff --git a/data/assets/scene/solarsystem/missions/apollo/17/lem.asset b/data/assets/scene/solarsystem/missions/apollo/17/lem.asset index 59a7306d61..16512ded45 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/lem.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/lem.asset @@ -1,6 +1,6 @@ -local asset_helper = asset.require('util/asset_helper') -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local moon_asset = asset.require('scene/solarsystem/planets/earth/moon/moon') +local asset_helper = asset.require("util/asset_helper") +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +local moon_asset = asset.require("scene/solarsystem/planets/earth/moon/moon") local model = asset.syncedResource({ Name = "Apollo Lem Models", diff --git a/data/assets/scene/solarsystem/missions/apollo/8/apollo8.asset b/data/assets/scene/solarsystem/missions/apollo/8/apollo8.asset index 4b2a8777a1..cf491145b7 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/apollo8.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/apollo8.asset @@ -1,3 +1,3 @@ -asset.require('./model') -asset.require('./launch_model') -asset.require('./trails') +asset.require("./model") +asset.require("./launch_model") +asset.require("./trails") diff --git a/data/assets/scene/solarsystem/missions/apollo/8/kernels.asset b/data/assets/scene/solarsystem/missions/apollo/8/kernels.asset index 82fb855db5..9995423e1d 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/kernels.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/kernels.asset @@ -9,9 +9,9 @@ local kernels = { kernelsFolder .. "moon_080317.tf", kernelsFolder .. "apollo8.tf", kernelsFolder .. "moon_pa_de421_1900-2050.bpc", - kernelsFolder .. 'apollo8.tsc', - kernelsFolder .. 'apollo8.bsp', - kernelsFolder .. 'apollo8_earthrise.bc' + kernelsFolder .. "apollo8.tsc", + kernelsFolder .. "apollo8.bsp", + kernelsFolder .. "apollo8_earthrise.bc" } -asset.export('kernels', kernels) +asset.export("kernels", kernels) diff --git a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset index aafb1edfc3..598ee1d5e2 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset @@ -1,7 +1,7 @@ -local asset_helper = asset.require('util/asset_helper') -local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local kernels = asset.require('./kernels').kernels +local asset_helper = asset.require("util/asset_helper") +local earth_transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +local kernels = asset.require("./kernels").kernels local models = asset.syncedResource({ Name = "Apollo Models", @@ -46,7 +46,7 @@ local Apollo8LaunchModel = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = {0.0, 0.0, -3.1415 / 2} + Rotation = {0.0, 0.0, -math.pi / 2} } }, Renderable = { diff --git a/data/assets/scene/solarsystem/missions/apollo/8/model.asset b/data/assets/scene/solarsystem/missions/apollo/8/model.asset index 714285b568..ad3ec538b6 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/model.asset @@ -1,7 +1,7 @@ -local asset_helper = asset.require('util/asset_helper') -local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sun_transforms = asset.require('scene/solarsystem/sun/transforms') -local kernels = asset.require('./kernels').kernels +local asset_helper = asset.require("util/asset_helper") +local earth_transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sun_transforms = asset.require("scene/solarsystem/sun/transforms") +local kernels = asset.require("./kernels").kernels local models = asset.syncedResource({ Name = "Apollo Models", @@ -58,7 +58,7 @@ local Apollo8Model = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = {0.0, 0.0, -3.1415 / 2} + Rotation = {0.0, 0.0, -math.pi / 2} } }, Renderable = { diff --git a/data/assets/scene/solarsystem/missions/apollo/8/trails.asset b/data/assets/scene/solarsystem/missions/apollo/8/trails.asset index dfe3d02b88..3ef9b58431 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/trails.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/trails.asset @@ -1,8 +1,8 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") -local earth_transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local moon_transforms = asset.require('scene/solarsystem/planets/earth/moon/moon') -local kernels = asset.require('./kernels').kernels +local earth_transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local moon_transforms = asset.require("scene/solarsystem/planets/earth/moon/moon") +local kernels = asset.require("./kernels").kernels local apolloSpiceId = "-908" diff --git a/data/assets/scene/solarsystem/missions/apollo/apollo_globebrowsing.asset b/data/assets/scene/solarsystem/missions/apollo/apollo_globebrowsing.asset index d32a695d9f..93e7be48ca 100644 --- a/data/assets/scene/solarsystem/missions/apollo/apollo_globebrowsing.asset +++ b/data/assets/scene/solarsystem/missions/apollo/apollo_globebrowsing.asset @@ -1,5 +1,4 @@ ---apollo_globebrowsing.asset -local moon_transforms = asset.require('scene/solarsystem/planets/earth/moon/moon') +local moon_transforms = asset.require("scene/solarsystem/planets/earth/moon/moon") local heightmaps = asset.syncedResource({ Name = "Apollo Globebrowsing Heightmaps", diff --git a/data/assets/scene/solarsystem/missions/apollo/insignias_map.asset b/data/assets/scene/solarsystem/missions/apollo/insignias_map.asset index f7ec75bb7c..050bb1eb61 100644 --- a/data/assets/scene/solarsystem/missions/apollo/insignias_map.asset +++ b/data/assets/scene/solarsystem/missions/apollo/insignias_map.asset @@ -2,7 +2,7 @@ -- The insignias are invisible by default, but can be enabled using shown or hidden using -- the exported functions `showInsignias(interpolationDuration)` and `hideInsignias(interpolationDuration)`. -local asset_helper = asset.require('util/asset_helper') +local asset_helper = asset.require("util/asset_helper") local insigniasPath = asset.syncedResource({ Name = "Apollo Insignias", @@ -10,7 +10,7 @@ local insigniasPath = asset.syncedResource({ Identifier = "apollo_insignias", Version = 1 }) -local moon = asset.require('scene/solarsystem/planets/earth/moon/moon') +local moon = asset.require("scene/solarsystem/planets/earth/moon/moon") local landingData = { { @@ -88,7 +88,7 @@ end local show_apollo_labels = { Identifier = "apollo_insignias.show_insignias", Name = "Show Apollo Landing Labels", - Command = "openspace.setPropertyValue('Scene.Apollo*Insignia.Renderable.Opacity', 1, 0.5)", + Command = [[openspace.setPropertyValue("Scene.Apollo*Insignia.Renderable.Opacity", 1, 0.5)]], Documentation = "Show patches of the Apollo missions on their respective landing sites", GuiPath = "/Missions/Apollo", IsLocal = true @@ -97,7 +97,7 @@ local show_apollo_labels = { local hide_apollo_labels = { Identifier = "apollo_insignias.hide_insignias", Name = "Hide Apollo Landing Labels", - Command = "openspace.setPropertyValue('Scene.Apollo*Insignia.Renderable.Opacity', 0, 0.5)", + Command = [[openspace.setPropertyValue("Scene.Apollo*Insignia.Renderable.Opacity", 0, 0.5)]], Documentation = "Hide patches of the Apollo missions on their respective landing sites", GuiPath = "/Missions/Apollo", IsLocal = true @@ -113,19 +113,19 @@ asset.onDeinitialize(function () openspace.action.removeAction(hide_apollo_labels.Identifier) end) -asset.export('showInsignia', function (missinNumber, interpolationDuration) +asset.export("showInsignia", function (missinNumber, interpolationDuration) openspace.setPropertyValue("Scene.Apollo" .. missionNumber .. "Insignia.Renderable.Opacity", 1, interpolationDuration) end) -asset.export('hideInsignia', function (missinNumber, interpolationDuration) +asset.export("hideInsignia", function (missinNumber, interpolationDuration) openspace.setPropertyValue("Scene.Apollo" .. missionNumber .. "Insignia.Renderable.Opacity", 0, interpolationDuration) end) -asset.export('showInsignias', function (interpolationDuration) +asset.export("showInsignias", function (interpolationDuration) openspace.setPropertyValue("Scene.Apollo*Insignia.Renderable.Opacity", 1, interpolationDuration) end) -asset.export('hideInsignias', function (interpolationDuration) +asset.export("hideInsignias", function (interpolationDuration) openspace.setPropertyValue("Scene.Apollo*Insignia.Renderable.Opacity", 0, interpolationDuration) end) diff --git a/data/assets/scene/solarsystem/missions/dawn/ceres.asset b/data/assets/scene/solarsystem/missions/dawn/ceres.asset index 08f9cbec17..1f8419b17f 100644 --- a/data/assets/scene/solarsystem/missions/dawn/ceres.asset +++ b/data/assets/scene/solarsystem/missions/dawn/ceres.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") diff --git a/data/assets/scene/solarsystem/missions/dawn/dawn.asset b/data/assets/scene/solarsystem/missions/dawn/dawn.asset index 40d97c409d..51c19451ce 100644 --- a/data/assets/scene/solarsystem/missions/dawn/dawn.asset +++ b/data/assets/scene/solarsystem/missions/dawn/dawn.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local kernels = asset.syncedResource({ @@ -705,7 +705,7 @@ local DawnSolarArray2 = { -- } Rotation = { Type = "StaticRotation", - Rotation = { 3.1415, 1.57075, 0.0 } + Rotation = { math.pi, math.pi/2, 0.0 } } }, Renderable = { diff --git a/data/assets/scene/solarsystem/missions/dawn/vesta.asset b/data/assets/scene/solarsystem/missions/dawn/vesta.asset index 1e2d2031db..371157dd98 100644 --- a/data/assets/scene/solarsystem/missions/dawn/vesta.asset +++ b/data/assets/scene/solarsystem/missions/dawn/vesta.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") local kernels = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/missions/gaia/dashboard.asset b/data/assets/scene/solarsystem/missions/gaia/dashboard.asset index 73f1c54413..841db1d58e 100644 --- a/data/assets/scene/solarsystem/missions/gaia/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/gaia/dashboard.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") assetHelper.registerDashboardItems(asset, { { Type = "DashboardItemDistance", diff --git a/data/assets/scene/solarsystem/missions/gaia/gaia.asset b/data/assets/scene/solarsystem/missions/gaia/gaia.asset index 179ae4d995..014f1a01c3 100644 --- a/data/assets/scene/solarsystem/missions/gaia/gaia.asset +++ b/data/assets/scene/solarsystem/missions/gaia/gaia.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local model = asset.syncedResource({ Name = "Gaia Model", diff --git a/data/assets/scene/solarsystem/missions/gaia/trail.asset b/data/assets/scene/solarsystem/missions/gaia/trail.asset index 13b06318a9..59cfc6b8e3 100644 --- a/data/assets/scene/solarsystem/missions/gaia/trail.asset +++ b/data/assets/scene/solarsystem/missions/gaia/trail.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local trail = asset.syncedResource({ Name = "Gaia Trail", diff --git a/data/assets/scene/solarsystem/missions/gaia/transforms.asset b/data/assets/scene/solarsystem/missions/gaia/transforms.asset index 1cc13d306a..80ee2bcfd2 100644 --- a/data/assets/scene/solarsystem/missions/gaia/transforms.asset +++ b/data/assets/scene/solarsystem/missions/gaia/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") local trail = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/missions/insight/edl.asset b/data/assets/scene/solarsystem/missions/insight/edl.asset index a5390a5f1f..073b6345dd 100644 --- a/data/assets/scene/solarsystem/missions/insight/edl.asset +++ b/data/assets/scene/solarsystem/missions/insight/edl.asset @@ -1,6 +1,6 @@ -asset.require('spice/base') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local assetHelper = asset.require('util/asset_helper') +asset.require("spice/base") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local assetHelper = asset.require("util/asset_helper") local models = asset.syncedResource({ Name = "Insight Models Chutes", @@ -65,91 +65,91 @@ local kernelTouchdownTime = "2018 NOV 26 19:45:32.3" local spiceRotationEndTime = "2018 NOV 26 19:51:39" local TranslationKeyframes = { - ['1850 JAN 01 00:00:00'] = { + ["1850 JAN 01 00:00:00"] = { Type = "SpiceTranslation", Target = "INSIGHT", Observer = "MARS", Frame = "IAU_MARS", Kernels = iKernels, - FixedDate = '2018 NOV 26 19:39:03' + FixedDate = "2018 NOV 26 19:39:03" }, - ['2018 NOV 26 19:39:02'] = { + ["2018 NOV 26 19:39:02"] = { Type = "SpiceTranslation", Target = "INSIGHT", Observer = "MARS", Frame = "IAU_MARS", Kernels = iKernels, - FixedDate = '2018 NOV 26 19:39:03' + FixedDate = "2018 NOV 26 19:39:03" }, - ['2018 NOV 26 19:39:03'] = { + ["2018 NOV 26 19:39:03"] = { Type = "SpiceTranslation", Target = "INSIGHT", Observer = "MARS", Frame = "IAU_MARS", Kernels = iKernels }, - ['2018 NOV 26 19:39:04'] = { + ["2018 NOV 26 19:39:04"] = { Type = "SpiceTranslation", Target = "INSIGHT", Observer = "MARS", Frame = "IAU_MARS", Kernels = iKernels }, - ['2018 NOV 26 19:45:34'] = { + ["2018 NOV 26 19:45:34"] = { Type = "SpiceTranslation", Target = "INSIGHT", Observer = "MARS", Frame = "IAU_MARS", Kernels = iKernels }, - ['2018 NOV 26 19:45:35'] = { + ["2018 NOV 26 19:45:35"] = { Type = "SpiceTranslation", Target = "INSIGHT", Observer = "MARS", Frame = "IAU_MARS", Kernels = iKernels, - FixedDate = '2018 NOV 26 19:45:34' + FixedDate = "2018 NOV 26 19:45:34" }, } local RotationKeyframes = { - ['1850 JAN 01 00:00:00'] = { + ["1850 JAN 01 00:00:00"] = { Type = "SpiceRotation", SourceFrame = "INSIGHT_LANDER_CRUISE", DestinationFrame = "IAU_MARS", - FixedDate = '2018 NOV 26 19:39:02', + FixedDate = "2018 NOV 26 19:39:02", Kernels = iKernels }, - ['2018 NOV 26 19:39:02'] = { + ["2018 NOV 26 19:39:02"] = { Type = "SpiceRotation", SourceFrame = "INSIGHT_LANDER_CRUISE", DestinationFrame = "IAU_MARS", - FixedDate = '2018 NOV 26 19:39:02', + FixedDate = "2018 NOV 26 19:39:02", Kernels = iKernels }, - ['2018 NOV 26 19:39:03'] = { + ["2018 NOV 26 19:39:03"] = { Type = "SpiceRotation", SourceFrame = "INSIGHT_LANDER_CRUISE", DestinationFrame = "IAU_MARS", Kernels = iKernels }, - ['2018 NOV 26 19:39:04'] = { + ["2018 NOV 26 19:39:04"] = { Type = "SpiceRotation", SourceFrame = "INSIGHT_LANDER_CRUISE", DestinationFrame = "IAU_MARS", Kernels = iKernels }, - ['2018 NOV 26 19:45:34'] = { + ["2018 NOV 26 19:45:34"] = { Type = "SpiceRotation", SourceFrame = "INSIGHT_LANDER_CRUISE", DestinationFrame = "IAU_MARS", Kernels = iKernels }, - ['2018 NOV 26 19:45:35'] = { + ["2018 NOV 26 19:45:35"] = { Type = "SpiceRotation", SourceFrame = "INSIGHT_LANDER_CRUISE", DestinationFrame = "IAU_MARS", - FixedDate = '2018 NOV 26 19:45:34' + FixedDate = "2018 NOV 26 19:45:34" }, } @@ -186,7 +186,7 @@ local Insight = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = { 0.0, 0.0, -3.1415 } + Rotation = { 0.0, 0.0, -math.pi } } }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/insight/shortcuts.asset b/data/assets/scene/solarsystem/missions/insight/shortcuts.asset index 00d5cbf3c1..0ff2f6217f 100644 --- a/data/assets/scene/solarsystem/missions/insight/shortcuts.asset +++ b/data/assets/scene/solarsystem/missions/insight/shortcuts.asset @@ -2,56 +2,67 @@ local InsightEntryTime = "2018 NOV 26 19:39:03.68" -local insightNavigationState = "{" .. - "Anchor = 'Insight'," .. - "Pitch = 0.567457E-4," .. - "Position = { 1.240506E1,-1.369270E1,-2.423553E0 }," .. - "ReferenceFrame = 'Root',".. - "Up = { 0.441211E0,0.247019E0,0.862737E0 }," .. - "Yaw = -0.446853E-4}" +local insightNavigationState = [[ +{ + Anchor = "Insight", + Pitch = 0.567457E-4, + Position = { 1.240506E1,-1.369270E1,-2.423553E0 }, + ReferenceFrame = "Root", + Up = { 0.441211E0,0.247019E0,0.862737E0 }, + Yaw = -0.446853E-4 +} +]] local Shortcuts = { { - 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);", + 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); + ]], Documentation = "Enable Insight landing height layer offset", Name = "Insight Height Offset", GuiPath = "/Missions/Insight", Local = false }, { - Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0);" .. - "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', 0);", + Command = [[ + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset", 0); + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset", 0); + ]], Documentation = "Disable Insight landing height layer offset", Name = "Default Height Offset", GuiPath = "/Missions/Insight", Local = false }, { - Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true);" .. - "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);", + Command = [[ + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled", true); + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled", true); + ]], Documentation = "Enables HiRISE layer for insight landing", Name = "Enable HiRISE", GuiPath = "/Missions/Insight", Local = false }, { - Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', false);" .. - "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false);", + Command = [[ + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled", false); + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled", false); + ]], Documentation = "Disables HiRISE layer used for insight landing", Name = "Disable HiRISE", GuiPath = "/Missions/Insight", Local = false }, { - Command = "openspace.navigation.setNavigationState(" .. insightNavigationState .. ");", + Command = [[openspace.navigation.setNavigationState(]] .. insightNavigationState .. [[);]], Documentation = "Change the camera state for the start of Insight EDL", Name = "Insight EDL NavigationState", GuiPath = "/Missions/Insight", Local = false }, { - Command = "openspace.time.setPause(true);openspace.time.setTime('" .. InsightEntryTime .. "');", + Command = [[openspace.time.setPause(true);openspace.time.setTime("]] .. InsightEntryTime .. [[");]], Documentation = "Change the time for the start of Insight EDL", Name = "Insight EDL Time", GuiPath = "/Missions/Insight", diff --git a/data/assets/scene/solarsystem/missions/juno/juno.asset b/data/assets/scene/solarsystem/missions/juno/juno.asset index 16ef39a3e3..ac58358871 100644 --- a/data/assets/scene/solarsystem/missions/juno/juno.asset +++ b/data/assets/scene/solarsystem/missions/juno/juno.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/planets/jupiter/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/planets/jupiter/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local model = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/missions/jwst/hudf.asset b/data/assets/scene/solarsystem/missions/jwst/hudf.asset index ef8cc9b4c7..2c67026d85 100644 --- a/data/assets/scene/solarsystem/missions/jwst/hudf.asset +++ b/data/assets/scene/solarsystem/missions/jwst/hudf.asset @@ -1,8 +1,8 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local jwstTransforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local image = asset.require('./image').image +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local jwstTransforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local image = asset.require("./image").image local DISTANCE = 9.2E15; @@ -42,7 +42,7 @@ local HUDFImage = { RadiusAzimuthElevation = { 200.0, 0.5, 0.1 }, UsePerspectiveProjection = false, Opacity = 1.0, - TexturePath = image .. "/Hubble_ultra_deep_field.png", + TexturePath = image .. "Hubble_ultra_deep_field.png", Tag = { "mission_jwst_hudf" }, Description = [[ Image of the Hubble Ultra Deep Field by NASA, ESA, and S. Beckwith (STScI) and diff --git a/data/assets/scene/solarsystem/missions/jwst/image.asset b/data/assets/scene/solarsystem/missions/jwst/image.asset index 4ca58c42f2..31142954ef 100644 --- a/data/assets/scene/solarsystem/missions/jwst/image.asset +++ b/data/assets/scene/solarsystem/missions/jwst/image.asset @@ -5,7 +5,7 @@ local image = asset.syncedResource({ Version = 3 }) -asset.export('image', image) +asset.export("image", image) asset.meta = { Name = "Hubble Ultra Deep Field", diff --git a/data/assets/scene/solarsystem/missions/jwst/jwst.asset b/data/assets/scene/solarsystem/missions/jwst/jwst.asset index 3eec48f1c7..e6c8fe87f2 100644 --- a/data/assets/scene/solarsystem/missions/jwst/jwst.asset +++ b/data/assets/scene/solarsystem/missions/jwst/jwst.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local transforms = asset.require('./transforms') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local transforms = asset.require("./transforms") +asset.require("spice/base") local models = asset.syncedResource({ Name = "JWST Model", diff --git a/data/assets/scene/solarsystem/missions/jwst/timelapse.asset b/data/assets/scene/solarsystem/missions/jwst/timelapse.asset index 8ba9149688..8662fad7ca 100644 --- a/data/assets/scene/solarsystem/missions/jwst/timelapse.asset +++ b/data/assets/scene/solarsystem/missions/jwst/timelapse.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") -- JWST timelapse timeline local timelapse = [[ @@ -10,309 +10,309 @@ local timelapse = [[ -- Mission start openspace.scriptScheduler.loadScheduledScript( "2018 OCT 01 14:06:04", - "openspace.setPropertyValueSingle('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma', 0.7)" .. - "openspace.setPropertyValueSingle('Scene.EarthAtmosphere.Renderable.Enabled', false)", + "openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 0.7)" .. + "openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", false)", "openspace.time.interpolateDeltaTime(-1)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', '')" .. - "openspace.setPropertyValueSingle('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma', 1.0)" .. - "openspace.setPropertyValueSingle('Scene.EarthAtmosphere.Renderable.Enabled', true)" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"\")" .. + "openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 1.0)" .. + "openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", true)" ) openspace.scriptScheduler.loadScheduledScript( "2018 OCT 01 14:06:05", -- 2 sec delay "openspace.time.interpolateDeltaTime(120)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 minutes/second\")", "openspace.time.interpolateDeltaTime(-1)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', '')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"\")" ) openspace.scriptScheduler.loadScheduledScript( "2018 OCT 01 14:10:03", -- 4 min pre delay "", "openspace.time.interpolateDeltaTime(-1)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', '')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"\")" ) -- array deploy, forwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 01 14:35:23", -- 1 min pre delay so time to interpolate "openspace.time.interpolateDeltaTime(1)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 1 second/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 1 second/second\")" ) -- array deploy, backwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 01 14:36:23", "", "openspace.time.interpolateDeltaTime(-120)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 minutes/second\")" ) -- array complete, forwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 01 14:36:45", "openspace.time.interpolateDeltaTime(7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")" ) -- array complete, backwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 01 14:37:55", -- 1 min 10 sec pre delay so time to interpolate "", "openspace.time.interpolateDeltaTime(-1)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -1 second/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -1 second/second\")" ) -- array complete, backwards prepare openspace.scriptScheduler.loadScheduledScript( "2018 OCT 01 15:46:45", -- 1h 10 min delay for interpolation "", "openspace.time.interpolateDeltaTime(-120)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 minutes/second\")" ) -- antenna deploy openspace.scriptScheduler.loadScheduledScript( "2018 OCT 02 08:06:03", "openspace.time.interpolateDeltaTime(1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 minutes/second\")", "openspace.time.interpolateDeltaTime(-7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 hours/second\")" ) -- antenna complete, forwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 02 13:45:03", "openspace.time.interpolateDeltaTime(18000)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 5 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 5 hours/second\")" ) -- antenna complete, backwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 02 14:45:03", -- 1h pre delay so time to interpolate "", "openspace.time.interpolateDeltaTime(-1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 minutes/second\")" ) -- fw palette deploy, forwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 04 06:26:38", -- 2h pre delay so time to interpolate "openspace.time.interpolateDeltaTime(3600)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 1 hour/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 1 hour/second\")" ) -- fw palette deploy, backwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 04 08:26:38", "", "openspace.time.interpolateDeltaTime(-18000)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -5 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -5 hours/second\")" ) -- fw palette complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 04 20:06:03", "openspace.time.interpolateDeltaTime(1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 minutes/second\")", "openspace.time.interpolateDeltaTime(-3600)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -1 hour/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -1 hour/second\")" ) -- r palette deploy openspace.scriptScheduler.loadScheduledScript( "2018 OCT 04 22:57:03", "openspace.time.interpolateDeltaTime(1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 minutes/second\")", "openspace.time.interpolateDeltaTime(-1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 minutes/second\")" ) -- r palette complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 05 02:06:03", "openspace.time.interpolateDeltaTime(120)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 minutes/second\")", "openspace.time.interpolateDeltaTime(-1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 minutes/second\")" ) -- base rise deploy openspace.scriptScheduler.loadScheduledScript( "2018 OCT 05 02:28:03", "openspace.time.interpolateDeltaTime(7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 hours/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")", "openspace.time.interpolateDeltaTime(-120)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 minutes/second\")" ) -- base rise complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 06 07:41:03", "openspace.time.interpolateDeltaTime(1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 minutes/second\")", "openspace.time.interpolateDeltaTime(-7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 hours/second\")" ) -- aft flap deploy openspace.scriptScheduler.loadScheduledScript( "2018 OCT 06 11:06:03", "openspace.time.interpolateDeltaTime(600)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 10 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 10 minutes/second\")", "openspace.time.interpolateDeltaTime(-1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 minutes/second\")" ) -- aft flap complete, forwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 06 15:43:03", "openspace.time.interpolateDeltaTime(3600)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 1 hour/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 1 hour/second\")" ) -- aft flap complete, backwards openspace.scriptScheduler.loadScheduledScript( "2018 OCT 06 16:13:03", -- 30 min pre delay so time to interpolate "", "openspace.time.interpolateDeltaTime(-600)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -10 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -10 minutes/second\")" ) -- mid booms extend openspace.scriptScheduler.loadScheduledScript( "2018 OCT 07 01:35:46", "openspace.time.interpolateDeltaTime(1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 minutes/second\")", "openspace.time.interpolateDeltaTime(-3600)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -1 hour/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -1 hour/second\")" ) -- first boom stop openspace.scriptScheduler.loadScheduledScript( "2018 OCT 07 02:22:19", "openspace.time.interpolateDeltaTime(1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 minutes/second\")", "openspace.time.interpolateDeltaTime(-1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 minutes/second\")" ) -- right boom complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 07 07:48:08", "openspace.time.interpolateDeltaTime(1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 minutes/second\")", "openspace.time.interpolateDeltaTime(-1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 minutes/second\")" ) -- left booms complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 07 12:12:03", "openspace.time.interpolateDeltaTime(30)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 seconds/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 seconds/second\")", "openspace.time.interpolateDeltaTime(-1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 minutes/second\")" ) -- tension sun shield membranes openspace.scriptScheduler.loadScheduledScript( "2018 OCT 07 12:15:17", "openspace.time.interpolateDeltaTime(60)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 1 minute/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 1 minute/second\")", "openspace.time.interpolateDeltaTime(-30)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 seconds/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 seconds/second\")" ) -- membrane tension complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 07 12:26:03", "openspace.time.interpolateDeltaTime(7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 hours/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")", "openspace.time.interpolateDeltaTime(-60)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -1 minute/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -1 minute/second\")" ) -- membranes separate openspace.scriptScheduler.loadScheduledScript( "2018 OCT 08 02:42:52", "openspace.time.interpolateDeltaTime(3600)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 1 hour/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 1 hour/second\")", "openspace.time.interpolateDeltaTime(-7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 hours/second\")" ) -- secondary mirror deploy openspace.scriptScheduler.loadScheduledScript( "2018 OCT 08 14:06:03", "openspace.time.interpolateDeltaTime(18000)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 5 hours/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 5 hours/second\")", "openspace.time.interpolateDeltaTime(-3600)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -1 hour/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -1 hour/second\")" ) -- secondary mirror complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 13 00:39:03", "openspace.time.interpolateDeltaTime(1200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 20 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 20 minutes/second\")", "openspace.time.interpolateDeltaTime(-18000)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -5 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -5 hours/second\")" ) -- aft radiator deploy openspace.scriptScheduler.loadScheduledScript( "2018 OCT 13 02:26:51", "openspace.time.interpolateDeltaTime(1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 30 minutes/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 30 minutes/second\")", "openspace.time.interpolateDeltaTime(-1200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -20 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -20 minutes/second\")" ) -- aft radiator complete, forward openspace.scriptScheduler.loadScheduledScript( "2018 OCT 13 06:11:03", "openspace.time.interpolateDeltaTime(7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")" ) -- aft radiator complete, backward openspace.scriptScheduler.loadScheduledScript( "2018 OCT 13 07:11:03", -- 1h pre delay so time to interpolate "", "openspace.time.interpolateDeltaTime(-1800)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -30 minutes/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -30 minutes/second\")" ) -- rt cord fold wings deploy openspace.scriptScheduler.loadScheduledScript( "2018 OCT 13 23:36:03", "openspace.time.interpolateDeltaTime(7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 hours/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")", "openspace.time.interpolateDeltaTime(-7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 hours/second\")" ) -- rt cord fold wings complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 15 02:46:51", "openspace.time.interpolateDeltaTime(7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 hours/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")", "openspace.time.interpolateDeltaTime(-7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 hours/second\")" ) -- lft cord fold wings deploy openspace.scriptScheduler.loadScheduledScript( "2018 OCT 15 13:06:03", "openspace.time.interpolateDeltaTime(7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: 2 hours/second')", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: 2 hours/second\")", "openspace.time.interpolateDeltaTime(-7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 hours/second')" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 hours/second\")" ) -- lft cord fold wings complete openspace.scriptScheduler.loadScheduledScript( "2018 OCT 16 09:06:03", "openspace.time.interpolateDeltaTime(1)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', '')" .. - "openspace.setPropertyValueSingle('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma', 1.0)" .. - "openspace.setPropertyValueSingle('Scene.EarthAtmosphere.Renderable.Enabled', true)", + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"\")" .. + "openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 1.0)" .. + "openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", true)", "openspace.time.interpolateDeltaTime(-7200)" .. - "openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', 'Time speed: -2 hours/second')" .. - "openspace.setPropertyValueSingle('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma', 0.7)" .. - "openspace.setPropertyValueSingle('Scene.EarthAtmosphere.Renderable.Enabled', false)" + "openspace.setPropertyValueSingle(\"Dashboard.JWSTStateText.Text\", \"Time speed: -2 hours/second\")" .. + "openspace.setPropertyValueSingle(\"Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma\", 0.7)" .. + "openspace.setPropertyValueSingle(\"Scene.EarthAtmosphere.Renderable.Enabled\", false)" ) openspace.scriptScheduler.loadScheduledScript( @@ -326,9 +326,9 @@ local playForwards = { Name = "Play JWST from start", Command = [[ openspace.scriptScheduler.clear(0); - openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', ''); + openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", ""); openspace.time.setDeltaTime(1); - openspace.time.setTime('2018 OCT 01 14:06:03'); + openspace.time.setTime("2018 OCT 01 14:06:03"); ]] .. timelapse .. [[ ]], Documentation = "Jump to the JWST launch time and play the timelapse of deployment forward", @@ -341,9 +341,9 @@ local playBackwards = { Name = "Play JWST from end", Command = [[ openspace.scriptScheduler.clear(0); - openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', ''); + openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", ""); openspace.time.setDeltaTime(-1); - openspace.time.setTime('2018 OCT 16 09:06:04'); + openspace.time.setTime("2018 OCT 16 09:06:04"); ]] .. timelapse .. [[ ]], Documentation = "Jump to the end of JWST deployment time and play the timelapse of deployment in reverse", @@ -356,9 +356,9 @@ local clearPlay = { Name = "Clear JWST timelapse", Command = [[ openspace.scriptScheduler.clear(0); - openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', ''); - openspace.setPropertyValueSingle('Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma', 1.0) - openspace.setPropertyValueSingle('Scene.EarthAtmosphere.Renderable.Enabled', true) + openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", ""); + openspace.setPropertyValueSingle("Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Settings.Gamma", 1.0) + openspace.setPropertyValueSingle("Scene.EarthAtmosphere.Renderable.Enabled", true) local deltaTime = openspace.time.deltaTime(); if deltaTime > 0 then openspace.time.setDeltaTime(1); @@ -380,17 +380,17 @@ local togglePlayDirection = { openspace.time.setDeltaTime(-deltaTime); -- Update the dashboard text - local text = openspace.getPropertyValue('Dashboard.JWSTStateText.Text'); + local text = openspace.getPropertyValue("Dashboard.JWSTStateText.Text"); if(string.len(text) > 14) then - local newText = '' - if(text:sub(13, 13) == '-') then + local newText = "" + if(text:sub(13, 13) == "-") then newText = text:sub(1,12) .. text:sub(14) else - newText = text:sub(1,12) .. '-' .. text:sub(13) + newText = text:sub(1,12) .. "-" .. text:sub(13) end - openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', tostring(newText)); + openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", tostring(newText)); else - openspace.setPropertyValueSingle('Dashboard.JWSTStateText.Text', ''); + openspace.setPropertyValueSingle("Dashboard.JWSTStateText.Text", ""); end ]], Documentation = "Toggle deployment timelapse direction between forwards and backwards", diff --git a/data/assets/scene/solarsystem/missions/jwst/trail.asset b/data/assets/scene/solarsystem/missions/jwst/trail.asset index ae404a0f1a..65c900abfb 100644 --- a/data/assets/scene/solarsystem/missions/jwst/trail.asset +++ b/data/assets/scene/solarsystem/missions/jwst/trail.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/planets/earth/lagrange_points/L2') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/planets/earth/lagrange_points/L2") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") local horizons = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/missions/jwst/transforms.asset b/data/assets/scene/solarsystem/missions/jwst/transforms.asset index 86eb461cd7..8d1858bbef 100644 --- a/data/assets/scene/solarsystem/missions/jwst/transforms.asset +++ b/data/assets/scene/solarsystem/missions/jwst/transforms.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +asset.require("spice/base") local horizons = asset.syncedResource({ Name = "JWST Horizons", @@ -18,11 +18,11 @@ local JWSTPosition = { Type = "TimelineTranslation", ShouldInterpolate = false, Keyframes = { - ['2018 OCT 01 14:06:03'] = { + ["2018 OCT 01 14:06:03"] = { Type = "HorizonsTranslation", HorizonsTextFile = horizons .. "horizons_jwst_launch.dat", }, - ['2018 NOV 01 00:00:00'] = { + ["2018 NOV 01 00:00:00"] = { Type = "HorizonsTranslation", HorizonsTextFile = horizons .. "horizons_jwst_orbit.dat", } @@ -67,8 +67,8 @@ local JWSTRotation = { asset.onInitialize(function() openspace.scriptScheduler.loadScheduledScript( "2018 NOV 01 00:00:00", - "openspace.setParent('JWSTPosition', 'L2')", - "openspace.setParent('JWSTPosition', 'EarthCenter')", + [[openspace.setParent("JWSTPosition", "L2")]], + [[openspace.setParent("JWSTPosition", "EarthCenter")]], "", 1 -- Not default group, never clear this script ) diff --git a/data/assets/scene/solarsystem/missions/messenger/dashboard.asset b/data/assets/scene/solarsystem/missions/messenger/dashboard.asset index d38410c140..0dc3362949 100644 --- a/data/assets/scene/solarsystem/missions/messenger/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/messenger/dashboard.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") assetHelper.registerDashboardItems(asset, { { diff --git a/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset b/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset index 1a5ec0123a..1425f5d5f5 100644 --- a/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset +++ b/data/assets/scene/solarsystem/missions/messenger/mercurymagnetosphere.asset @@ -1,6 +1,6 @@ -- mercurymagnetosphere.asset -local assetHelper = asset.require('util/asset_helper') -local mercuryTransforms = asset.require('scene/solarsystem/planets/mercury/transforms') +local assetHelper = asset.require("util/asset_helper") +local mercuryTransforms = asset.require("scene/solarsystem/planets/mercury/transforms") local localFolder = asset.syncedResource({ Name = "Mercury Magnetosphere", @@ -40,7 +40,7 @@ local Magnetosphere = { SourceFrame = "MERCURYSE", DestinationFrame = "GALACTIC", Kernels = { - localFolder .. "/openspace_mercury.ti" + localFolder .. "openspace_mercury.ti" } }, Scale = { diff --git a/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset b/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset index 42a34e51de..804849fcda 100644 --- a/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset +++ b/data/assets/scene/solarsystem/missions/messenger/messengerSC.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local mercuryTransforms = asset.require('scene/solarsystem/planets/mercury/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local mercuryTransforms = asset.require("scene/solarsystem/planets/mercury/transforms") local models = asset.syncedResource({ @@ -19,35 +19,35 @@ local kernels = asset.syncedResource({ local LocalKernels = { - kernels .. 'messenger_2548.tsc', - kernels .. 'msgr_v231.tf', + kernels .. "messenger_2548.tsc", + kernels .. "msgr_v231.tf", - kernels .. 'de405.bsp', - kernels .. 'msgr_040803_150430_150430_od431sc_2.bsp', - kernels .. 'msgr_antenna_v000.bsp', - kernels .. 'msgr_de405_de423s.bsp', + kernels .. "de405.bsp", + kernels .. "msgr_040803_150430_150430_od431sc_2.bsp", + kernels .. "msgr_antenna_v000.bsp", + kernels .. "msgr_de405_de423s.bsp", - kernels .. 'msgr_epps_v100.ti', - kernels .. 'msgr_grns_v110.ti', - kernels .. 'msgr_mag_v021.ti', - kernels .. 'msgr_mascs_v100.ti', - kernels .. 'msgr_mdis_v160.ti', - kernels .. 'msgr_mla_v010.ti', - kernels .. 'msgr_rs_v111.ti', - kernels .. 'msgr_xrs_v001.ti', + kernels .. "msgr_epps_v100.ti", + kernels .. "msgr_grns_v110.ti", + kernels .. "msgr_mag_v021.ti", + kernels .. "msgr_mascs_v100.ti", + kernels .. "msgr_mdis_v160.ti", + kernels .. "msgr_mla_v010.ti", + kernels .. "msgr_rs_v111.ti", + kernels .. "msgr_xrs_v001.ti", - 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 .. "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 .. 'msgr_1103_v02.bc', - kernels .. 'msgr_1104_v02.bc', - kernels .. 'msgr_1105_v02.bc', - kernels .. 'msgr_1106_v02.bc', + kernels .. "msgr_1103_v02.bc", + kernels .. "msgr_1104_v02.bc", + kernels .. "msgr_1105_v02.bc", + kernels .. "msgr_1106_v02.bc" } diff --git a/data/assets/scene/solarsystem/missions/newhorizons/charon.asset b/data/assets/scene/solarsystem/missions/newhorizons/charon.asset index 285cb9bded..7ec0ea178a 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/charon.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/charon.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") diff --git a/data/assets/scene/solarsystem/missions/newhorizons/dashboard.asset b/data/assets/scene/solarsystem/missions/newhorizons/dashboard.asset index e64ee000ed..c922ccbfbc 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/dashboard.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") assetHelper.registerDashboardItems(asset, { { diff --git a/data/assets/scene/solarsystem/missions/newhorizons/fov.asset b/data/assets/scene/solarsystem/missions/newhorizons/fov.asset index 5bdaef3e93..7766d509d6 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/fov.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/fov.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") @@ -355,7 +355,7 @@ local Rex = { Transform = { Rotation = { Type = "StaticRotation", - Rotation = {-3.141502/2, 0, -3.141502/2} + Rotation = { -math.pi/2, 0.0, -math.pi/2 } }, Translation = { Type = "StaticTranslation", diff --git a/data/assets/scene/solarsystem/missions/newhorizons/label.asset b/data/assets/scene/solarsystem/missions/newhorizons/label.asset index 21a9cb8c83..3551b4244d 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/label.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/label.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local transforms = asset.require('./transforms') -local NewHorizonsModel = asset.require('./model') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local transforms = asset.require("./transforms") +local NewHorizonsModel = asset.require("./model") @@ -14,7 +14,7 @@ local Labels = { Renderable = { Type = "RenderableModel", Body = "NEW HORIZONS", - GeometryFile = models .. "/Labels.obj", + GeometryFile = models .. "Labels.obj", AmbientIntensity = 0.8 }, GUI = { diff --git a/data/assets/scene/solarsystem/missions/newhorizons/model.asset b/data/assets/scene/solarsystem/missions/newhorizons/model.asset index 5ac619eaff..b460d0022d 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/model.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/model.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local models = asset.syncedResource({ Name = "New Horizons Model", diff --git a/data/assets/scene/solarsystem/missions/newhorizons/newhorizons.asset b/data/assets/scene/solarsystem/missions/newhorizons/newhorizons.asset index ac7159463c..f51a44d596 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/newhorizons.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/newhorizons.asset @@ -1,12 +1,12 @@ -asset.require('./model') -asset.require('./label') -asset.require('./fov') -asset.require('./trail') +asset.require("./model") +asset.require("./label") +asset.require("./fov") +asset.require("./trail") -asset.require('./pluto') -asset.require('./charon') +asset.require("./pluto") +asset.require("./charon") -asset.require('./othermoons') +asset.require("./othermoons") local mission = asset.localResource("newhorizons.mission") local missionName diff --git a/data/assets/scene/solarsystem/missions/newhorizons/othermoons.asset b/data/assets/scene/solarsystem/missions/newhorizons/othermoons.asset index 0f8251822b..931ca930e5 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/othermoons.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/othermoons.asset @@ -1,8 +1,8 @@ -local Hydra = asset.require('scene/solarsystem/dwarf_planets/pluto/minor/hydra') -local Kerberos = asset.require('scene/solarsystem/dwarf_planets/pluto/minor/kerberos') -local Nix = asset.require('scene/solarsystem/dwarf_planets/pluto/minor/nix') -local Styx = asset.require('scene/solarsystem/dwarf_planets/pluto/minor/styx') -local assetHelper = asset.require('util/asset_helper') +local Hydra = asset.require("scene/solarsystem/dwarf_planets/pluto/minor/hydra") +local Kerberos = asset.require("scene/solarsystem/dwarf_planets/pluto/minor/kerberos") +local Nix = asset.require("scene/solarsystem/dwarf_planets/pluto/minor/nix") +local Styx = asset.require("scene/solarsystem/dwarf_planets/pluto/minor/styx") +local assetHelper = asset.require("util/asset_helper") local hydraTextures = asset.syncedResource({ Name = "Hydra Textures", diff --git a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset index 262830e729..23d31b783a 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/pluto.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local NewHorizonsKernels = asset.require('./kernels').NewHorizonsKernels +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local NewHorizonsKernels = asset.require("./kernels").NewHorizonsKernels local assets = asset.syncedResource({ Name = "Pluto Assets", diff --git a/data/assets/scene/solarsystem/missions/newhorizons/trail.asset b/data/assets/scene/solarsystem/missions/newhorizons/trail.asset index 2f6dbb45b8..f1735b381e 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/trail.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") diff --git a/data/assets/scene/solarsystem/missions/newhorizons/transforms.asset b/data/assets/scene/solarsystem/missions/newhorizons/transforms.asset index ff3965ba14..c136a5d82c 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/transforms.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/transforms.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local kernels = asset.require('./kernels') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local kernels = asset.require("./kernels") local PlutoBarycenterAccurate = { Identifier = "PlutoBarycenterAccurate", diff --git a/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset b/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset index 9d1c359f70..cd4cee476d 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/bennu.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local models = asset.syncedResource({ Name = "Bennu Models", diff --git a/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset b/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset index 90bb81eb24..b3eca5f6c6 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/bennu_projection.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local models = asset.syncedResource({ Name = "Bennu Models", diff --git a/data/assets/scene/solarsystem/missions/osirisrex/dashboard.asset b/data/assets/scene/solarsystem/missions/osirisrex/dashboard.asset index 44c0b86cb5..e009935284 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/dashboard.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") assetHelper.registerDashboardItems(asset, { { diff --git a/data/assets/scene/solarsystem/missions/osirisrex/imageplane.asset b/data/assets/scene/solarsystem/missions/osirisrex/imageplane.asset index 93a4a681d1..808b9e121a 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/imageplane.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/imageplane.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") local textures = asset.syncedResource({ Name = "Bennu Textures", diff --git a/data/assets/scene/solarsystem/missions/osirisrex/kernels.asset b/data/assets/scene/solarsystem/missions/osirisrex/kernels.asset index d11e8e2f0c..b7f113fef8 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/kernels.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/kernels.asset @@ -88,4 +88,4 @@ local OsirisRexKernels = { kernels .. "orx_210509_231025_210119_od298-R-ADM1-P-DB1_v1.bsp" } -asset.export('kernels', OsirisRexKernels) +asset.export("kernels", OsirisRexKernels) diff --git a/data/assets/scene/solarsystem/missions/osirisrex/model.asset b/data/assets/scene/solarsystem/missions/osirisrex/model.asset index d2ff92c41f..c8ab8466bc 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/model.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/model.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") -local OsirisRexKernels = asset.require('./kernels').kernels +local OsirisRexKernels = asset.require("./kernels").kernels local models = asset.syncedResource({ Name = "Osiris Rex Models", diff --git a/data/assets/scene/solarsystem/missions/osirisrex/osirisrex.asset b/data/assets/scene/solarsystem/missions/osirisrex/osirisrex.asset index 0ba307b51d..389b3d1103 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/osirisrex.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/osirisrex.asset @@ -1,12 +1,12 @@ -asset.require('./bennu') -asset.require('./bennu_projection') -asset.require('./model') -asset.require('./trail') -asset.require('scene/solarsystem/sun/marker') +asset.require("./bennu") +asset.require("./bennu_projection") +asset.require("./model") +asset.require("./trail") +asset.require("scene/solarsystem/sun/marker") -asset.require('./script_schedule') +asset.require("./script_schedule") -local mission = asset.localResource('osirisrex.mission') +local mission = asset.localResource("osirisrex.mission") local missionName asset.onInitialize(function() diff --git a/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset b/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset index b187e8968e..c2d4049f7e 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset @@ -1,15 +1,15 @@ -local scriptSchedulerHelper = asset.require('util/script_scheduler_helper') +local scriptSchedulerHelper = asset.require("util/script_scheduler_helper") asset.onInitialize(function () - scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "Scene.OsirisRexTrailSolarSystem", false) - scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "Scene.OsirisRexTrailBennu", false) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 08 23:05:01", "Scene.OsirisRexTrailEarth", true) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 00:00:00", "Scene.OsirisRexTrailSolarSystem", true) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 02:00:00", "Scene.OsirisRexTrailEarth", false) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 11 00:00:00", "Scene.OsirisRexTrailBennu", true) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 15 00:00:00", "Scene.OsirisRexTrailSolarSystem", false) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "Scene.OsirisRexTrailSolarSystem", true) - scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "Scene.OsirisRexTrailBennu", false) + scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "Scene.OsirisRexTrailSolarSystem", false) + scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "Scene.OsirisRexTrailBennu", false) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 08 23:05:01", "Scene.OsirisRexTrailEarth", true) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 00:00:00", "Scene.OsirisRexTrailSolarSystem", true) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 02:00:00", "Scene.OsirisRexTrailEarth", false) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 11 00:00:00", "Scene.OsirisRexTrailBennu", true) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 15 00:00:00", "Scene.OsirisRexTrailSolarSystem", false) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "Scene.OsirisRexTrailSolarSystem", true) + scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "Scene.OsirisRexTrailBennu", false) end) diff --git a/data/assets/scene/solarsystem/missions/osirisrex/trail.asset b/data/assets/scene/solarsystem/missions/osirisrex/trail.asset index 01b33183bc..0d92f79a0d 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/trail.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/trail.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") diff --git a/data/assets/scene/solarsystem/missions/osirisrex/transforms.asset b/data/assets/scene/solarsystem/missions/osirisrex/transforms.asset index ca481d5b1b..db898123fa 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/transforms.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") diff --git a/data/assets/scene/solarsystem/missions/perseverance/model.asset b/data/assets/scene/solarsystem/missions/perseverance/model.asset index 4a77fa808b..1c020618e3 100644 --- a/data/assets/scene/solarsystem/missions/perseverance/model.asset +++ b/data/assets/scene/solarsystem/missions/perseverance/model.asset @@ -1,9 +1,8 @@ ---perseverance/model.asset -local assetHelper = asset.require('util/asset_helper') -local trail = asset.require('./trail') -local marsTransforms = asset.require('scene/solarsystem/planets/mars/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') --- asset.require('./fov') +local assetHelper = asset.require("util/asset_helper") +local trail = asset.require("./trail") +local marsTransforms = asset.require("scene/solarsystem/planets/mars/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +-- asset.require("./fov") local LightSources = { { diff --git a/data/assets/scene/solarsystem/missions/perseverance/perseverance.asset b/data/assets/scene/solarsystem/missions/perseverance/perseverance.asset index f1e3b55cd7..0e9df57fa6 100644 --- a/data/assets/scene/solarsystem/missions/perseverance/perseverance.asset +++ b/data/assets/scene/solarsystem/missions/perseverance/perseverance.asset @@ -1,3 +1,2 @@ ---perseverance.asset -asset.require('./model') -asset.require('./trail') +asset.require("./model") +asset.require("./trail") diff --git a/data/assets/scene/solarsystem/missions/perseverance/shortcuts.asset b/data/assets/scene/solarsystem/missions/perseverance/shortcuts.asset index b2c162fd09..8159a8da8e 100644 --- a/data/assets/scene/solarsystem/missions/perseverance/shortcuts.asset +++ b/data/assets/scene/solarsystem/missions/perseverance/shortcuts.asset @@ -1,44 +1,53 @@ ---perseverance/shortcuts.asset - local PerseveranceLaunchTime = "2020 JUL 17 13:56:42" local PerseveranceLandingTime = "2021 FEB 18 20:32:16" -local PerseveranceNavigationState = "{" .. - "Anchor = 'Perseverance'," .. - "Pitch = 0.567457E-4," .. - "Position = { 1.240506E1,-1.369270E1,-2.423553E0 }," .. - "ReferenceFrame = 'Root',".. - "Up = { 0.441211E0,0.247019E0,0.862737E0 }," .. - "Yaw = -0.446853E-4}" +local PerseveranceNavigationState = [[ +{ + Anchor = "Perseverance", + Pitch = 0.567457E-4, + Position = { 1.240506E1,-1.369270E1,-2.423553E0 }, + ReferenceFrame = "Root", + Up = { 0.441211E0,0.247019E0,0.862737E0 }, + Yaw = -0.446853E-4 +} +]] local Shortcuts = { { - Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -1677.088867);" .. - "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', -1677.088867);", + Command = [[ + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset", -1677.088867); + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset", -1677.088867); + ]], Documentation = "Enable height layer offset for Perseverance landing trail", Name = "Perseverance Height Offset", GuiPath = "/Missions/Insight", Local = false }, { - Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0);" .. - "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', 0);", + Command = [[ + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset", 0); + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset", 0); + ]], Documentation = "Disable Perseverance landing height layer offset", Name = "Default Height Offset", GuiPath = "/Missions/Insight", Local = false }, { - Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true);" .. - "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);", + Command = [[ + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled", true); + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled", true); + ]], Documentation = "Enables HiRISE layer for Perseverance", Name = "Enable HiRISE", GuiPath = "/Missions/Insight", Local = false }, { - Command = "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', false);" .. - "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false);", + Command = [[ + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled", false); + openspace.setPropertyValueSingle("Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled", false); + ]], Documentation = "Disables HiRISE layer used for Perseverance", Name = "Disable HiRISE", GuiPath = "/Missions/Insight", @@ -52,14 +61,14 @@ local Shortcuts = { Local = false }, { - Command = "openspace.time.setPause(true);openspace.time.setTime('" .. PerseveranceLaunchTime .. "');", + Command = [[openspace.time.setPause(true);openspace.time.setTime("]] .. PerseveranceLaunchTime .. [[");]], Documentation = "Change the time for Perseverance launch", Name = "Perseverance launch time", GuiPath = "/Missions/Perseverance", Local = false }, { - Command = "openspace.time.setPause(true);openspace.time.setTime('" .. PerseveranceLandingTime .. "');", + Command = [[openspace.time.setPause(true);openspace.time.setTime("]] .. PerseveranceLandingTime .. [[");]], Documentation = "Change the time for when Perseverance has landed", Name = "Perseverance landed time", GuiPath = "/Missions/Perseverance", diff --git a/data/assets/scene/solarsystem/missions/perseverance/trail.asset b/data/assets/scene/solarsystem/missions/perseverance/trail.asset index d11d3fd2cc..7dd964578c 100644 --- a/data/assets/scene/solarsystem/missions/perseverance/trail.asset +++ b/data/assets/scene/solarsystem/missions/perseverance/trail.asset @@ -1,7 +1,6 @@ ---trail.asset -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local marsTransforms = asset.require('scene/solarsystem/planets/mars/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local marsTransforms = asset.require("scene/solarsystem/planets/mars/transforms") local kernels = asset.syncedResource({ Name = "Mars 2020 Kernels", diff --git a/data/assets/scene/solarsystem/missions/pioneer/pioneer10.asset b/data/assets/scene/solarsystem/missions/pioneer/pioneer10.asset index f94bd066c4..d0b5b6ab23 100644 --- a/data/assets/scene/solarsystem/missions/pioneer/pioneer10.asset +++ b/data/assets/scene/solarsystem/missions/pioneer/pioneer10.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local model = asset.require("scene/solarsystem/missions/pioneer/pioneermodel") @@ -10,7 +10,7 @@ local kernelsFolder = asset.syncedResource({ Version = 1 }) -local kernelsList = {kernelsFolder .. 'p10-a.bsp'} +local kernelsList = { kernelsFolder .. "p10-a.bsp" } local Pioneer10NAIF = "-23" diff --git a/data/assets/scene/solarsystem/missions/pioneer/pioneer11.asset b/data/assets/scene/solarsystem/missions/pioneer/pioneer11.asset index 05d1db1743..4a7ea159b1 100644 --- a/data/assets/scene/solarsystem/missions/pioneer/pioneer11.asset +++ b/data/assets/scene/solarsystem/missions/pioneer/pioneer11.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local model = asset.require("scene/solarsystem/missions/pioneer/pioneermodel") @@ -11,8 +11,8 @@ local kernelsFolder = asset.syncedResource({ }) local kernelsList = { - kernelsFolder .. 'p11-a.bsp', - kernelsFolder .. 'p11_sat336.bsp' + kernelsFolder .. "p11-a.bsp", + kernelsFolder .. "p11_sat336.bsp" } local Pioneer11NAIF = "-24" diff --git a/data/assets/scene/solarsystem/missions/pioneer/pioneermodel.asset b/data/assets/scene/solarsystem/missions/pioneer/pioneermodel.asset index 29115ec61b..c9934e52a6 100644 --- a/data/assets/scene/solarsystem/missions/pioneer/pioneermodel.asset +++ b/data/assets/scene/solarsystem/missions/pioneer/pioneermodel.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local modelFolder = asset.syncedResource({ Name = "Pioneer 10/11 Models", diff --git a/data/assets/scene/solarsystem/missions/rosetta/67p.asset b/data/assets/scene/solarsystem/missions/rosetta/67p.asset index b0bb61d15b..e9510a26e0 100644 --- a/data/assets/scene/solarsystem/missions/rosetta/67p.asset +++ b/data/assets/scene/solarsystem/missions/rosetta/67p.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") diff --git a/data/assets/scene/solarsystem/missions/rosetta/dashboard.asset b/data/assets/scene/solarsystem/missions/rosetta/dashboard.asset index 93b85fcef2..70ee5c7107 100644 --- a/data/assets/scene/solarsystem/missions/rosetta/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/rosetta/dashboard.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") assetHelper.registerDashboardItems(asset, { { diff --git a/data/assets/scene/solarsystem/missions/rosetta/rosetta.asset b/data/assets/scene/solarsystem/missions/rosetta/rosetta.asset index 1e777d44c1..0f023708f6 100644 --- a/data/assets/scene/solarsystem/missions/rosetta/rosetta.asset +++ b/data/assets/scene/solarsystem/missions/rosetta/rosetta.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') -local transforms = asset.require('./67p') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") +local transforms = asset.require("./67p") local models = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/missions/voyager/dashboard.asset b/data/assets/scene/solarsystem/missions/voyager/dashboard.asset index 8a0967ea71..757fe3524d 100644 --- a/data/assets/scene/solarsystem/missions/voyager/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/voyager/dashboard.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") assetHelper.registerDashboardItems(asset, { { diff --git a/data/assets/scene/solarsystem/missions/voyager/voyager1.asset b/data/assets/scene/solarsystem/missions/voyager/voyager1.asset index 5180d150f4..3ee11e611d 100644 --- a/data/assets/scene/solarsystem/missions/voyager/voyager1.asset +++ b/data/assets/scene/solarsystem/missions/voyager/voyager1.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local models = asset.syncedResource({ Name = "Voyager Model", @@ -16,14 +16,14 @@ local kernels = asset.syncedResource({ }) local Kernels = { - kernels .. 'vg1_v02.tf', - kernels .. 'vg100019.tsc', - kernels .. 'Voyager_1.a54206u_V0.2_merged.bsp', - kernels .. 'voyager_1.ST+1991_a54418u.merged.bsp', - kernels .. 'vgr1_jup230.bsp', - kernels .. 'vgr1_sat337.bsp', - kernels .. 'vgr1_super.bc', - kernels .. 'vgr1_super_v2.bc' + kernels .. "vg1_v02.tf", + kernels .. "vg100019.tsc", + kernels .. "Voyager_1.a54206u_V0.2_merged.bsp", + kernels .. "voyager_1.ST+1991_a54418u.merged.bsp", + kernels .. "vgr1_jup230.bsp", + kernels .. "vgr1_sat337.bsp", + kernels .. "vgr1_super.bc", + kernels .. "vgr1_super_v2.bc" } local RotationMatrix = { diff --git a/data/assets/scene/solarsystem/missions/voyager/voyager2.asset b/data/assets/scene/solarsystem/missions/voyager/voyager2.asset index 04125eff56..62c53d508b 100644 --- a/data/assets/scene/solarsystem/missions/voyager/voyager2.asset +++ b/data/assets/scene/solarsystem/missions/voyager/voyager2.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local models = asset.syncedResource({ @@ -17,16 +17,16 @@ local kernels = asset.syncedResource({ }) local Kernels = { - kernels .. 'vg2_v02.tf', - kernels .. 'vg200022.tsc', - kernels .. 'Voyager_2.m05016u.merged.bsp', - kernels .. 'voyager_2.ST+1992_m05208u.merged.bsp', - kernels .. 'vgr2_jup230.bsp', - kernels .. 'vgr2_sat337.bsp', - kernels .. 'vgr2_ura083.bsp', - kernels .. 'vgr2_nep081.bsp', - kernels .. 'vgr2_super.bc', - kernels .. 'vgr2_super_v2.bc' + kernels .. "vg2_v02.tf", + kernels .. "vg200022.tsc", + kernels .. "Voyager_2.m05016u.merged.bsp", + kernels .. "voyager_2.ST+1992_m05208u.merged.bsp", + kernels .. "vgr2_jup230.bsp", + kernels .. "vgr2_sat337.bsp", + kernels .. "vgr2_ura083.bsp", + kernels .. "vgr2_nep081.bsp", + kernels .. "vgr2_super.bc", + kernels .. "vgr2_super_v2.bc" } local RotationMatrix = { diff --git a/data/assets/scene/solarsystem/missions/voyagerpioneer/voyager1_2__pioneer10_11.asset b/data/assets/scene/solarsystem/missions/voyagerpioneer/voyager1_2__pioneer10_11.asset index a464240511..6a2527f094 100644 --- a/data/assets/scene/solarsystem/missions/voyagerpioneer/voyager1_2__pioneer10_11.asset +++ b/data/assets/scene/solarsystem/missions/voyagerpioneer/voyager1_2__pioneer10_11.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local sampleInterval = 24*60*60 diff --git a/data/assets/scene/solarsystem/planets/default_layers.asset b/data/assets/scene/solarsystem/planets/default_layers.asset index acfe25579b..2aae0ad044 100644 --- a/data/assets/scene/solarsystem/planets/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/default_layers.asset @@ -1,33 +1,33 @@ -asset.require('./earth/default_layers') -asset.require('./earth/moon/default_layers') +asset.require("./earth/default_layers") +asset.require("./earth/moon/default_layers") -asset.require('./jupiter/default_layers') -asset.require('./jupiter/callisto/default_layers') -asset.require('./jupiter/europa/default_layers') -asset.require('./jupiter/ganymede/default_layers') -asset.require('./jupiter/io/default_layers') +asset.require("./jupiter/default_layers") +asset.require("./jupiter/callisto/default_layers") +asset.require("./jupiter/europa/default_layers") +asset.require("./jupiter/ganymede/default_layers") +asset.require("./jupiter/io/default_layers") -asset.require('./mars/default_layers') -asset.require('./mars/moons/layers/colorlayers/deimos_viking') -asset.require('./mars/moons/layers/colorlayers/phobos_viking') +asset.require("./mars/default_layers") +asset.require("./mars/moons/layers/colorlayers/deimos_viking") +asset.require("./mars/moons/layers/colorlayers/phobos_viking") -asset.require('./mercury/default_layers') +asset.require("./mercury/default_layers") -asset.require('./neptune/default_layers') +asset.require("./neptune/default_layers") -asset.require('./saturn/default_layers') -asset.require('./saturn/dione/default_layers') -asset.require('./saturn/enceladus/default_layers') -asset.require('./saturn/hyperion/default_layers') -asset.require('./saturn/iapetus/default_layers') -asset.require('./saturn/mimas/default_layers') -asset.require('./saturn/rhea/default_layers') -asset.require('./saturn/tethys/default_layers') -asset.require('./saturn/titan/default_layers') +asset.require("./saturn/default_layers") +asset.require("./saturn/dione/default_layers") +asset.require("./saturn/enceladus/default_layers") +asset.require("./saturn/hyperion/default_layers") +asset.require("./saturn/iapetus/default_layers") +asset.require("./saturn/mimas/default_layers") +asset.require("./saturn/rhea/default_layers") +asset.require("./saturn/tethys/default_layers") +asset.require("./saturn/titan/default_layers") -asset.require('./uranus/default_layers') +asset.require("./uranus/default_layers") -asset.require('./venus/default_layers') +asset.require("./venus/default_layers") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/atmosphere.asset b/data/assets/scene/solarsystem/planets/earth/atmosphere.asset index 5a7f937fb0..9c464b1519 100644 --- a/data/assets/scene/solarsystem/planets/earth/atmosphere.asset +++ b/data/assets/scene/solarsystem/planets/earth/atmosphere.asset @@ -1,5 +1,5 @@ -local transforms = asset.require('./earth') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./earth") +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/solarsystem/planets/earth/default_layers.asset b/data/assets/scene/solarsystem/planets/earth/default_layers.asset index 15834a073f..9ac40e0280 100644 --- a/data/assets/scene/solarsystem/planets/earth/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/earth/default_layers.asset @@ -1,41 +1,35 @@ -local colorLayersPath = "./layers/colorlayers" -local heightLayersPath = "./layers/heightlayers" -local nightLayersPath = "./layers/nightlayers" -local overlaysPath = "./layers/overlays" -local waterMasksPath = "./layers/watermasks" - -- Color layers -local colorLayer = asset.require(colorLayersPath .. "/esri_viirs_combo") -asset.require(colorLayersPath .. "/esri_world_imagery") -asset.require(colorLayersPath .. "/esri_imagery_world_2D") -asset.require(colorLayersPath .. "/viirs_snpp_temporal") -asset.require(colorLayersPath .. "/aqua_modis_temporal") -asset.require(colorLayersPath .. "/terra_modis_temporal") -asset.require(colorLayersPath .. "/bmng_utah") -asset.require(colorLayersPath .. "/bmng_sweden") -asset.require(colorLayersPath .. "/amsr2_gcom_w1_sea_ice_concentration_temporal") -asset.require(colorLayersPath .. "/modis_terra_chlorophyll_a_temporal") -asset.require(colorLayersPath .. "/ghrsst_l4_g1sst_sea_surface_temperature_temporal") -asset.require(colorLayersPath .. "/ghrsst_l4_mur_sea_surface_temperature_temporal") +local colorLayer = asset.require("./layers/colorlayers/esri_viirs_combo") +asset.require("./layers/colorlayers/esri_world_imagery") +asset.require("./layers/colorlayers/esri_imagery_world_2D") +asset.require("./layers/colorlayers/viirs_snpp_temporal") +asset.require("./layers/colorlayers/aqua_modis_temporal") +asset.require("./layers/colorlayers/terra_modis_temporal") +asset.require("./layers/colorlayers/bmng_utah") +asset.require("./layers/colorlayers/bmng_sweden") +asset.require("./layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal") +asset.require("./layers/colorlayers/modis_terra_chlorophyll_a_temporal") +asset.require("./layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal") +asset.require("./layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal") -- Height layers -local heightLayer = asset.require(heightLayersPath .. "/terrain_tileset") +local heightLayer = asset.require("./layers/heightlayers/terrain_tileset") -- Night layers -local nightLayer = asset.require(nightLayersPath .. "/earth_at_night_2012") -asset.require(nightLayersPath .. "/earth_at_night_temporal") +local nightLayer = asset.require("./layers/nightlayers/earth_at_night_2012") +asset.require("./layers/nightlayers/earth_at_night_temporal") -- Overlays -asset.require(overlaysPath .. "/coastlines") -asset.require(overlaysPath .. "/reference_features") -asset.require(overlaysPath .. "/reference_labels") -asset.require(overlaysPath .. "/tile_indices") -asset.require(overlaysPath .. "/size_reference") +asset.require("./layers/overlays/coastlines") +asset.require("./layers/overlays/reference_features") +asset.require("./layers/overlays/reference_labels") +asset.require("./layers/overlays/tile_indices") +asset.require("./layers/overlays/size_reference") -- Watermasks -asset.require(waterMasksPath .. "/gebco_sweden") -asset.require(waterMasksPath .. "/gebco_utah") -local watermask = asset.require(waterMasksPath .. "/modis_water_mask") +asset.require("./layers/watermasks/gebco_sweden") +asset.require("./layers/watermasks/gebco_utah") +local watermask = asset.require("./layers/watermasks/modis_water_mask") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index 5ffbc7d5a9..3cee780b96 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -1,5 +1,5 @@ -local transforms = asset.require('./transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./transforms") +local assetHelper = asset.require("util/asset_helper") local labelsPath = asset.syncedResource({ Name = "Earth Labels", diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset index 03741477fd..e4591244db 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L1.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +asset.require("spice/base") local circle = asset.syncedResource({ Name = "Circle", diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset index 9675194cdb..bf7eecb072 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L2.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +asset.require("spice/base") local circle = asset.syncedResource({ Name = "Circle", @@ -50,7 +50,7 @@ local L2 = { RenderableType = "Opaque", Billboard = true, Size = 700E5, - Texture = circle .. "/circle.png", + Texture = circle .. "circle.png", BlendMode = "Additive" }, Transform = { @@ -58,7 +58,7 @@ local L2 = { Type = "SpiceTranslation", Target = "392", -- L2 Observer = "SSB", - Kernels = kernels .. "/L2_de431.bsp" + Kernels = kernels .. "L2_de431.bsp" } }, Tag = { "lagrange_points_earth", "lagrange_points_earth_l2" }, diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset index fecfac343d..3ff07dd9c1 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L4.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +asset.require("spice/base") local circle = asset.syncedResource({ Name = "Circle", diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset index bf95efa496..5de0504897 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/L5.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +asset.require("spice/base") local circle = asset.syncedResource({ Name = "Circle", diff --git a/data/assets/scene/solarsystem/planets/earth/lagrange_points/lagrange_points.asset b/data/assets/scene/solarsystem/planets/earth/lagrange_points/lagrange_points.asset index 8c4d507ca0..a995d9ae6d 100644 --- a/data/assets/scene/solarsystem/planets/earth/lagrange_points/lagrange_points.asset +++ b/data/assets/scene/solarsystem/planets/earth/lagrange_points/lagrange_points.asset @@ -1,4 +1,4 @@ -asset.require('scene/solarsystem/planets/earth/lagrange_points/L1') -asset.require('scene/solarsystem/planets/earth/lagrange_points/L2') -asset.require('scene/solarsystem/planets/earth/lagrange_points/L4') -asset.require('scene/solarsystem/planets/earth/lagrange_points/L5') +asset.require("scene/solarsystem/planets/earth/lagrange_points/L1") +asset.require("scene/solarsystem/planets/earth/lagrange_points/L2") +asset.require("scene/solarsystem/planets/earth/lagrange_points/L4") +asset.require("scene/solarsystem/planets/earth/lagrange_points/L5") diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal.asset index ef294487f1..60af47fdec 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "AMSR2_GCOM_W1_Sea_Ice_Concentration_Temporal", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/aqua_modis_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/aqua_modis_temporal.asset index 7e6e085717..61b122ca64 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/aqua_modis_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/aqua_modis_temporal.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "Aqua_Modis_Temporal", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.asset index 92ebc494fd..f64c9def7d 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "BMNG_Sweden", Name = "BMNG [Sweden]", - FilePath = mapServiceConfigsPath .. "/LiU/Bmng.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Bmng.wms"), Description = [[ Web loaded full resolution map of Blue Marble Next Generation. This map is hosted on the OpenSpace servers in Sweden]], } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.asset index a49d173df5..7dc75f3878 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "BMNG_Utah", Name = "BMNG [Utah]", - FilePath = mapServiceConfigsPath .. "/Utah/Bmng.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Bmng.wms"), Description = [[ Web loaded full resolution map of Blue Marble Next Generation. This map is hosted on the OpenSpace servers in Utah]], } diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_imagery_world_2D.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_imagery_world_2D.asset index 50434a2e16..a5bfd77127 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_imagery_world_2D.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_imagery_world_2D.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "ESRI_Imagery_World_2D", Name = "ESRI Imagery World 2D", - FilePath = mapServiceConfigsPath .. "/ESRI/ESRI_Imagery_World_2D.wms", + FilePath = asset.localResource("../../map_service_configs/ESRI/ESRI_Imagery_World_2D.wms"), Description = [[This map presents low-resolution imagery for the world and high-resolution imagery for the United States and other metropolitan areas around the world. The map includes NASA Blue Marble: Next Generation 500m resolution diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo.asset index ace6f96a5d..e3838e8147 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_viirs_combo.asset @@ -1,5 +1,4 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local fallBackLayer = asset.require("./fallbacks/blue_marble").layer @@ -30,7 +29,7 @@ local layer = { TileProvider = { Identifier = "ESRI_World_Imagery", Name = "ESRI World Imagery", - FilePath = mapServiceConfigsPath .. "/ESRI/World_Imagery.wms", + FilePath = asset.localResource("../../map_service_configs/ESRI/World_Imagery.wms"), PadTiles = false } }, diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_world_imagery.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_world_imagery.asset index 6a2f064e8c..6db98733d0 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_world_imagery.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/esri_world_imagery.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "ESRI_World_Imagery", Name = "ESRI World Imagery", - FilePath = mapServiceConfigsPath .. "/ESRI/World_Imagery.wms", + FilePath = asset.localResource("../../map_service_configs/ESRI/World_Imagery.wms"), Description = [[World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset index d335bcd44a..e1051ce567 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/fallbacks/blue_marble.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../../earth").Earth.Identifier local texturesPath = asset.syncedResource({ Name = "Earth Textures", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal.asset index bb8330360e..876fd0199e 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_g1sst_sea_surface_temperature_temporal.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "GHRSST_L4_G1SST_Sea_Surface_Temperature_Temporal", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal.asset index e0ba5eba41..0225ddc0c0 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "GHRSST_L4_MUR_Sea_Surface_Temperature_Temporal", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/modis_terra_chlorophyll_a_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/modis_terra_chlorophyll_a_temporal.asset index 750e4910bf..186d771ad0 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/modis_terra_chlorophyll_a_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/modis_terra_chlorophyll_a_temporal.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "MODIS_Terra_Chlorophyll_A_Temporal", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal.asset index 0eddfc5711..2324d3a9ea 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/terra_modis_temporal.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "Terra_Modis_Temporal", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/viirs_snpp_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/viirs_snpp_temporal.asset index 311347f2de..b52e86a434 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/viirs_snpp_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/viirs_snpp_temporal.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "VIIRS_SNPP_Temporal", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/terrain_tileset.asset b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/terrain_tileset.asset index 6cdfc6367b..8bdf1a7136 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/terrain_tileset.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/heightlayers/terrain_tileset.asset @@ -1,12 +1,11 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local fallBackLayer = asset.require("./fallbacks/blue_marble_height").layer local layer = { Identifier = "Terrain_tileset", Name = "Terrain tileset", - FilePath = mapServiceConfigsPath .. "/ESRI/Terrain.wms", + FilePath = asset.localResource("../../map_service_configs/ESRI/Terrain.wms"), TilePixelSize = 64, Fallback = fallBackLayer, Description = [[This globe layer presents elevation data at approximately 90m or 1km diff --git a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012.asset b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012.asset index 77a5ec4fd4..0fe8a1204c 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_2012.asset @@ -1,12 +1,11 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local fallBackLayer = asset.require("./fallbacks/earth_night_texture").layer local layer = { Identifier = "Earth_at_Night_2012", Name = "Earth at Night 2012", - FilePath = mapServiceConfigsPath .. "/GIBS/night/VIIRS_CityLights_2012.wms", + FilePath = asset.localResource("../../map_service_configs/GIBS/night/VIIRS_CityLights_2012.wms"), Fallback = fallBackLayer, Description = [[ The lights of cities and villages trace the outlines of civilization in this global view. ]], diff --git a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_temporal.asset b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_temporal.asset index f74bf463f4..fa0a192e23 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_temporal.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/nightlayers/earth_at_night_temporal.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "Earth_at_Night_Temporal", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/overlays/coastlines.asset b/data/assets/scene/solarsystem/planets/earth/layers/overlays/coastlines.asset index 8ae8338119..076443d67c 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/overlays/coastlines.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/overlays/coastlines.asset @@ -1,9 +1,8 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "Coastlines", - FilePath = mapServiceConfigsPath .. "/GIBS/overlays/Coastlines.wms" + FilePath = asset.localResource("../../map_service_configs/GIBS/overlays/Coastlines.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/layers/overlays/coastlines_enabled.asset b/data/assets/scene/solarsystem/planets/earth/layers/overlays/coastlines_enabled.asset index 0260ed6ae3..45ecf910d7 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/overlays/coastlines_enabled.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/overlays/coastlines_enabled.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = asset.require("./coastlines").layer layer.Enabled = true diff --git a/data/assets/scene/solarsystem/planets/earth/layers/overlays/reference_features.asset b/data/assets/scene/solarsystem/planets/earth/layers/overlays/reference_features.asset index 6862852dfd..77175cb343 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/overlays/reference_features.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/overlays/reference_features.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "Reference_Features", Name = "Reference Features", - FilePath = mapServiceConfigsPath .. "/GIBS/overlays/Reference_Features.wms" + FilePath = asset.localResource("../../map_service_configs/GIBS/overlays/Reference_Features.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/layers/overlays/reference_labels.asset b/data/assets/scene/solarsystem/planets/earth/layers/overlays/reference_labels.asset index d998889fe7..cd6d73f3b9 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/overlays/reference_labels.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/overlays/reference_labels.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "Reference_Labels", Name = "Reference Labels", - FilePath = mapServiceConfigsPath .. "/GIBS/overlays/Reference_Labels.wms" + FilePath = asset.localResource("../../map_service_configs/GIBS/overlays/Reference_Labels.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/layers/overlays/size_reference.asset b/data/assets/scene/solarsystem/planets/earth/layers/overlays/size_reference.asset index 0be0291ada..b208fa7e69 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/overlays/size_reference.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/overlays/size_reference.asset @@ -1,4 +1,4 @@ -local earthAsset = asset.require("./../../earth").Earth +local earthAsset = asset.require("../../earth").Earth local globeIdentifier = earthAsset.Identifier local layer ={ diff --git a/data/assets/scene/solarsystem/planets/earth/layers/overlays/tile_indices.asset b/data/assets/scene/solarsystem/planets/earth/layers/overlays/tile_indices.asset index 96b2fde089..b19df9addd 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/overlays/tile_indices.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/overlays/tile_indices.asset @@ -1,5 +1,4 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "Tile_Indices", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_sweden.asset b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_sweden.asset index 12d24ab479..b836292b21 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Name = "Gebco [Sweden]", Identifier = "Gebco_Sweden", - FilePath = mapServiceConfigsPath .. "/LiU/Gebco.wms" + FilePath = asset.localResource("../../map_service_configs/LiU/Gebco.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_utah.asset b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_utah.asset index c7743814a5..a7d088530a 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Name = "Gebco [Utah]", Identifier = "Gebco_Utah", - FilePath = mapServiceConfigsPath .. "/Utah/Gebco.wms" + FilePath = asset.localResource("../../map_service_configs/Utah/Gebco.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/modis_water_mask.asset b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/modis_water_mask.asset index c46c102b7c..a7ded02502 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/modis_water_mask.asset +++ b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/modis_water_mask.asset @@ -1,10 +1,9 @@ -local mapServiceConfigsPath = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../earth").Earth.Identifier +local globeIdentifier = asset.require("../../earth").Earth.Identifier local layer = { Identifier = "MODIS_Water_Mask", Name = "MODIS Water Mask", - FilePath = mapServiceConfigsPath .. "/GIBS/water/MODIS_Water_Mask.wms", + FilePath = asset.localResource("../../map_service_configs/GIBS/water/MODIS_Water_Mask.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/magnetosphere/magnetosphere.asset b/data/assets/scene/solarsystem/planets/earth/magnetosphere/magnetosphere.asset index eb9a36404b..757b7eb718 100644 --- a/data/assets/scene/solarsystem/planets/earth/magnetosphere/magnetosphere.asset +++ b/data/assets/scene/solarsystem/planets/earth/magnetosphere/magnetosphere.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms_magnetosphere') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms_magnetosphere") local transferFunction = asset.localResource("./CMR-illuminance2.txt") local fieldlinesDirectory = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/planets/earth/magnetosphere/transforms_magnetosphere.asset b/data/assets/scene/solarsystem/planets/earth/magnetosphere/transforms_magnetosphere.asset index 3ceb18be2e..d39e7abd5d 100644 --- a/data/assets/scene/solarsystem/planets/earth/magnetosphere/transforms_magnetosphere.asset +++ b/data/assets/scene/solarsystem/planets/earth/magnetosphere/transforms_magnetosphere.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") asset.require("spice/base") local GSMKernel = asset.localResource("../kernels/GSM.ti") diff --git a/data/assets/scene/solarsystem/planets/earth/markers.asset b/data/assets/scene/solarsystem/planets/earth/markers.asset index f65c1fb8dc..4625701381 100644 --- a/data/assets/scene/solarsystem/planets/earth/markers.asset +++ b/data/assets/scene/solarsystem/planets/earth/markers.asset @@ -1,5 +1,5 @@ -local transforms = asset.require('./transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./transforms") +local assetHelper = asset.require("util/asset_helper") local texturesPath = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/planets/earth/moon/default_layers.asset b/data/assets/scene/solarsystem/planets/earth/moon/default_layers.asset index a3e6183411..add0650eb8 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/default_layers.asset @@ -1,23 +1,20 @@ -local colorLayersPath = "./layers/colorlayers" -local heightLayersPath = "./layers/heightlayers" - -- Color layers -local colorLayer = asset.require(colorLayersPath .. "/wac_utah") -asset.require(colorLayersPath .. "/wac_sweden") -asset.require(colorLayersPath .. "/clemuvvis_utah") -asset.require(colorLayersPath .. "/clemuvvis_sweden") -asset.require(colorLayersPath .. "/uvvishybrid_utah") -asset.require(colorLayersPath .. "/uvvishybrid_sweden") -asset.require(colorLayersPath .. "/kaguya_utah") -asset.require(colorLayersPath .. "/kaguya_sweden") -asset.require(colorLayersPath .. "/lola_clr_shade_utah") -asset.require(colorLayersPath .. "/lola_clr_shade_sweden") -asset.require(colorLayersPath .. "/lola_shade_utah") -asset.require(colorLayersPath .. "/lola_shade_sweden") +local colorLayer = asset.require("./layers/colorlayers/wac_utah") +asset.require("./layers/colorlayers/wac_sweden") +asset.require("./layers/colorlayers/clemuvvis_utah") +asset.require("./layers/colorlayers/clemuvvis_sweden") +asset.require("./layers/colorlayers/uvvishybrid_utah") +asset.require("./layers/colorlayers/uvvishybrid_sweden") +asset.require("./layers/colorlayers/kaguya_utah") +asset.require("./layers/colorlayers/kaguya_sweden") +asset.require("./layers/colorlayers/lola_clr_shade_utah") +asset.require("./layers/colorlayers/lola_clr_shade_sweden") +asset.require("./layers/colorlayers/lola_shade_utah") +asset.require("./layers/colorlayers/lola_shade_sweden") -- Height layers -local heightLayer = asset.require(heightLayersPath .. "/loladem_utah") -asset.require(heightLayersPath .. "/loladem_sweden") +local heightLayer = asset.require("./layers/heightlayers/loladem_utah") +asset.require("./layers/heightlayers/loladem_sweden") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_sweden.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_sweden.asset index da78621a3d..127c207d13 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "ClemUvvis_Sweden", Name = "Clem Uvvis [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Clem_Uvvis.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Clem_Uvvis.wms"), Settings = { Gamma = 1.14, Multiplier = 1.4 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_utah.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_utah.asset index 6373dc4567..4575110c0f 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "ClemUvvis_Utah", Name = "Clem Uvvis [Utah]", - FilePath = mapServiceConfigs .. "/Utah/ClemUvvis.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/ClemUvvis.wms"), Settings = { Gamma = 1.14, Multiplier = 1.4 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_sweden.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_sweden.asset index 0189128dfa..8ab968a425 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "Kaguya_Sweden", Name = "Kaguya [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Kaguya.vrt", + FilePath = asset.localResource("../../map_service_configs/LiU/Kaguya.vrt"), Settings = { Gamma = 1.0, Multiplier = 1.23 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_utah.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_utah.asset index 3b9b74da33..bd11a6f42c 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "Kaguya_Utah", Name = "Kaguya [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Kaguya.vrt", + FilePath = asset.localResource("../../map_service_configs/Utah/Kaguya.vrt"), Settings = { Gamma = 1.0, Multiplier = 1.23 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_sweden.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_sweden.asset index 4fc3c33dca..81af5926fd 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "Lola_Clr_Shade_Sweden", Name = "Lola Color Shade [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Lola_Clr_Shade.wms" + FilePath = asset.localResource("../../map_service_configs/LiU/Lola_Clr_Shade.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_utah.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_utah.asset index 6601a28585..492ae50ef2 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "Lola_Clr_Shade_Utah", Name = "Lola Color Shade [Utah]", - FilePath = mapServiceConfigs .. "/Utah/LolaClrShade.wms" + FilePath = asset.localResource("../../map_service_configs/Utah/LolaClrShade.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_sweden.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_sweden.asset index 142eb0a519..5695aa5538 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "Lola_Shade_Sweden", Name = "Lola Shade [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Lola_Shade.wms" + FilePath = asset.localResource("../../map_service_configs/LiU/Lola_Shade.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_utah.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_utah.asset index 90495dffed..60950ae1d3 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "Lola_Shade_Utah", Name = "Lola Shade [Utah]", - FilePath = mapServiceConfigs .. "/Utah/LolaShade.wms" + FilePath = asset.localResource("../../map_service_configs/Utah/LolaShade.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_sweden.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_sweden.asset index 8cd547ae5b..14bb717533 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "UvvisHybrid_Sweden", Name = "Uvvis Hybrid [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Uvvis_Hybrid.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Uvvis_Hybrid.wms"), Settings = { Gamma = 0.52, Multiplier = 0.65 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_utah.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_utah.asset index 998b0e229f..0b184abd81 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "UvvisHybrid_Utah", Name = "Uvvis Hybrid [Utah]", - FilePath = mapServiceConfigs .. "/Utah/UvvisHybrid.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/UvvisHybrid.wms"), Settings = { Gamma = 0.52, Multiplier = 0.65 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_sweden.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_sweden.asset index 7dd38504d2..82332f5cf6 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_sweden.asset @@ -1,10 +1,10 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local mapServiceConfigs = asset.localResource("../../map_service_configs/LiU/WAC.wms") +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "WAC_Sweden", Name = "WAC [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/WAC.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/WAC.wms"), Settings = { Gamma = 0.84 } } diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_utah.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_utah.asset index cbdae49b2b..d47f0aa4d8 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "WAC_Utah", Name = "WAC [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Wac.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Wac.wms"), Settings = { Gamma = 0.84 } } diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_sweden.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_sweden.asset index bd26c272f3..02d6f12112 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_sweden.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "LolaDem_Sweden", Name = "Lola DEM [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Lola_DEM.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Lola_DEM.wms"), TilePixelSize = 64, Settings = { Multiplier = 0.5 } } diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_utah.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_utah.asset index 9eea498607..bdaaad5d62 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_utah.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../moon").Moon.Identifier +local globeIdentifier = asset.require("../../moon").Moon.Identifier local layer = { Identifier = "LolaDem_Utah", Name = "Lola DEM [Utah]", - FilePath = mapServiceConfigs .. "/Utah/LolaDem.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/LolaDem.wms"), TilePixelSize = 64, Settings = { Multiplier = 0.5 } } diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/overlays/size_reference.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/overlays/size_reference.asset index bea21e595a..4ac336a5ab 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/overlays/size_reference.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/overlays/size_reference.asset @@ -1,4 +1,4 @@ -local moonAsset = asset.require("./../../moon").Moon +local moonAsset = asset.require("../../moon").Moon local globeIdentifier = moonAsset.Identifier local layer = { diff --git a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset index 084c9bd401..83fd4e7898 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/moon.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/moon.asset @@ -1,8 +1,8 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sunAsset = asset.require('scene/solarsystem/sun/sun') -local earthAsset = asset.require('../earth') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sunAsset = asset.require("scene/solarsystem/sun/sun") +local earthAsset = asset.require("../earth") +asset.require("spice/base") local labelsPath = asset.syncedResource({ Name = "Moon Labels", diff --git a/data/assets/scene/solarsystem/planets/earth/moon/trail.asset b/data/assets/scene/solarsystem/planets/earth/moon/trail.asset index 18d859d9ba..6ebdb7020b 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/trail.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/trail.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('../transforms') -asset.require('spice/base') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("../transforms") +asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/amateur.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/amateur.asset index b1d6370b17..9c8f44f122 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/amateur.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/amateur.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Amateur Radio", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/experimental.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/experimental.asset index d094eb3bd3..f25d5f3b80 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/experimental.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/experimental.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Experimental", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/geostationary.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/geostationary.asset index aa17c4c902..c24a94946d 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/geostationary.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/geostationary.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Geostationary", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/globalstar.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/globalstar.asset index 45057138bc..8e626b9b5f 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/globalstar.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/globalstar.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "GlobalStar", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/gorizont.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/gorizont.asset index 5369ef8ad7..dc7e2b9dd0 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/gorizont.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/gorizont.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Gorizont", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/intelsat.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/intelsat.asset index e40a150e55..98f3f7637f 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/intelsat.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/intelsat.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Intelsat", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium.asset index 5d8708142f..04c2f689b9 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Iridium", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium_next.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium_next.asset index f37747ea8f..011b5ce518 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium_next.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium_next.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Iridium NEXT", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/molniya.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/molniya.asset index ed6e25b49a..055fac267f 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/molniya.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/molniya.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Molniya", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/orbcomm.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/orbcomm.asset index 9fd8597db8..2542d87397 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/orbcomm.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/orbcomm.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Orbcomm", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/other_comm.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/other_comm.asset index 7c4621d189..4804523303 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/other_comm.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/other_comm.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Other comm", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/raduga.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/raduga.asset index 054816b80c..e42dfa2405 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/raduga.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/raduga.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Raduga", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/ses.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/ses.asset index 6f19efa0ac..141124edaa 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/ses.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/ses.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "SES", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_asat.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_asat.asset index 93df258312..b9dfbfabb4 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_asat.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_asat.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Indian ASAT test Debris", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_breezem.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_breezem.asset index 602f400de3..b4f279913e 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_breezem.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_breezem.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Breeze-M Breakup", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_fengyun.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_fengyun.asset index fe48a9cd20..6ac65f3a8c 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_fengyun.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_fengyun.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Fengyun Debris", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_iridium33.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_iridium33.asset index 1d1235028d..6c22666ef4 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_iridium33.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_iridium33.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Iridium 33 Debris", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_kosmos2251.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_kosmos2251.asset index 6522de59ab..308bc36881 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_kosmos2251.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_kosmos2251.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Kosmos 2251 Debris", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/volume/cartesian_volume.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/volume/cartesian_volume.asset index 1e3b606a76..589dba3a29 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/volume/cartesian_volume.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/volume/cartesian_volume.asset @@ -4,7 +4,7 @@ -- the volume data itself needs to be generated, -- using the task 'data/tasks/volume/debristasks/generate_debris_volume.task' -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("scene/solarsystem/planets/earth/transforms") local maxApogee = 2 * 10946320; diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/volume/spherical_volume.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/volume/spherical_volume.asset index f0e5218cb0..11402ae123 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/volume/spherical_volume.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/volume/spherical_volume.asset @@ -4,7 +4,7 @@ -- the volume data itself needs to be generated, -- using the task 'data/tasks/volume/debristasks/generate_debris_volume.task' -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("scene/solarsystem/planets/earth/transforms") local maxApogee = 10946320; diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/brightest.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/brightest.asset index 9dd6222fc4..c7678ae032 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/brightest.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/brightest.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "100 Brightest", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/cubesats.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/cubesats.asset index 1f9ac6c110..ff5a78c181 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/cubesats.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/cubesats.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "CubeSat", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset index af41474f0a..a699e23fe9 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset @@ -1,7 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local satelliteHelper = asset.require('util/tle_helper') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local satelliteHelper = asset.require("util/tle_helper") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local url = "http://celestrak.com/satcat/tle.php?CATNR=25544" local identifier = "ISS" diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/military.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/military.asset index 8b159fdff1..775eb44ee7 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/military.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/military.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Military", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/other.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/other.asset index 3918837b54..1e1d065501 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/other.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/other.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Other", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/radar.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/radar.asset index 9c997c75c3..2591d504a9 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/radar.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/radar.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Radar Calibration", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/spacestations.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/spacestations.asset index bcd888013c..354454729b 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/spacestations.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/spacestations.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "SpaceStations", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/tle-new.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/tle-new.asset index 81ada563fc..188ab00641 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/tle-new.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/tle-new.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Last 30 Days", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/beidou.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/beidou.asset index d5ccf64db5..33e253e6d6 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/beidou.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/beidou.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Beidou", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/galileo.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/galileo.asset index bf1d460a7e..2348eb8b67 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/galileo.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/galileo.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Galileo", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/glosnass.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/glosnass.asset index 550b895287..3274c7fdcb 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/glosnass.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/glosnass.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Glosnass", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/gps.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/gps.asset index ba3f603851..39b87c733d 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/gps.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/gps.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "GPS", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/musson.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/musson.asset index 50a0792a4e..01dcc0b947 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/musson.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/musson.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Russian LEO Navigation", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/nnss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/nnss.asset index 0085bbffda..4a3bd8f81a 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/nnss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/nnss.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Navy Navigation Satellite System", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/sbas.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/sbas.asset index a63ef7b565..5e30251ea3 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/sbas.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/sbas.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Satellite Based Augmentation System", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites.asset index 601b4033f4..acb2faf5e5 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites.asset @@ -1 +1 @@ -asset.require('./satellites_interesting') +asset.require("./satellites_interesting") diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_all.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_all.asset index ea203b1ca0..ecb92357e0 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_all.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_all.asset @@ -1,11 +1,11 @@ -asset.require('./satellites_communications') +asset.require("./satellites_communications") -- The debris contains a **lot** of nodes, so we disable it on default --- asset.require('./satellites_debris') -asset.require('./satellites_interesting') -asset.require('./satellites_misc') -asset.require('./satellites_navigation') -asset.require('./satellites_science') -asset.require('./satellites_weather') +-- asset.require("./satellites_debris") +asset.require("./satellites_interesting") +asset.require("./satellites_misc") +asset.require("./satellites_navigation") +asset.require("./satellites_science") +asset.require("./satellites_weather") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_communications.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_communications.asset index be723c02ee..b5c6871dc8 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_communications.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_communications.asset @@ -1,16 +1,16 @@ -asset.require('./communications/geostationary') -asset.require('./communications/intelsat') -asset.require('./communications/ses') -asset.require('./communications/iridium') -asset.require('./communications/iridium_next') -asset.require('./communications/orbcomm') -asset.require('./communications/globalstar') -asset.require('./communications/amateur') -asset.require('./communications/experimental') -asset.require('./communications/other_comm') -asset.require('./communications/gorizont') -asset.require('./communications/raduga') -asset.require('./communications/molniya') +asset.require("./communications/geostationary") +asset.require("./communications/intelsat") +asset.require("./communications/ses") +asset.require("./communications/iridium") +asset.require("./communications/iridium_next") +asset.require("./communications/orbcomm") +asset.require("./communications/globalstar") +asset.require("./communications/amateur") +asset.require("./communications/experimental") +asset.require("./communications/other_comm") +asset.require("./communications/gorizont") +asset.require("./communications/raduga") +asset.require("./communications/molniya") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_debris.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_debris.asset index ad84683154..7a0e81da0d 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_debris.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_debris.asset @@ -1,8 +1,8 @@ -asset.require('./debris/debris_asat') -asset.require('./debris/debris_breezem') -asset.require('./debris/debris_fengyun') -asset.require('./debris/debris_iridium33') -asset.require('./debris/debris_kosmos2251') +asset.require("./debris/debris_asat") +asset.require("./debris/debris_breezem") +asset.require("./debris/debris_fengyun") +asset.require("./debris/debris_iridium33") +asset.require("./debris/debris_kosmos2251") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_interesting.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_interesting.asset index afc723d4a8..81d86836e5 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_interesting.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_interesting.asset @@ -1,9 +1,9 @@ -asset.require('./misc/brightest') -asset.require('./communications/geostationary') -asset.require('./navigation/gps') -asset.require('./misc/spacestations') -asset.require('./misc/iss') -asset.require('./misc/tle-new') +asset.require("./misc/brightest") +asset.require("./communications/geostationary") +asset.require("./navigation/gps") +asset.require("./misc/spacestations") +asset.require("./misc/iss") +asset.require("./misc/tle-new") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_misc.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_misc.asset index 7e82acabf8..76fb2afaed 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_misc.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_misc.asset @@ -1,7 +1,7 @@ -asset.require('./misc/military') -asset.require('./misc/radar') -asset.require('./misc/cubesats') -asset.require('./misc/other') +asset.require("./misc/military") +asset.require("./misc/radar") +asset.require("./misc/cubesats") +asset.require("./misc/other") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_navigation.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_navigation.asset index 473013b07b..0539825a0e 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_navigation.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_navigation.asset @@ -1,10 +1,10 @@ -asset.require('./navigation/beidou') -asset.require('./navigation/galileo') -asset.require('./navigation/glosnass') -asset.require('./navigation/gps') -asset.require('./navigation/musson') -asset.require('./navigation/nnss') -asset.require('./navigation/sbas') +asset.require("./navigation/beidou") +asset.require("./navigation/galileo") +asset.require("./navigation/glosnass") +asset.require("./navigation/gps") +asset.require("./navigation/musson") +asset.require("./navigation/nnss") +asset.require("./navigation/sbas") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_science.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_science.asset index d235eda9e1..8e11bd7e66 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_science.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_science.asset @@ -1,7 +1,7 @@ -asset.require('./science/spaceearth') -asset.require('./science/geodetic') -asset.require('./science/engineering') -asset.require('./science/education') +asset.require("./science/spaceearth") +asset.require("./science/geodetic") +asset.require("./science/engineering") +asset.require("./science/education") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_weather.asset b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_weather.asset index 1a8097a0c8..c8aab8059f 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/satellites_weather.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/satellites_weather.asset @@ -1,13 +1,13 @@ -asset.require('./weather/argos') -asset.require('./weather/dmc') -asset.require('./weather/earth_resources') -asset.require('./weather/goes') -asset.require('./weather/noaa') -asset.require('./weather/planet') -asset.require('./weather/sarsat') -asset.require('./weather/spire') -asset.require('./weather/tdrss') -asset.require('./weather/weather') +asset.require("./weather/argos") +asset.require("./weather/dmc") +asset.require("./weather/earth_resources") +asset.require("./weather/goes") +asset.require("./weather/noaa") +asset.require("./weather/planet") +asset.require("./weather/sarsat") +asset.require("./weather/spire") +asset.require("./weather/tdrss") +asset.require("./weather/weather") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/science/education.asset b/data/assets/scene/solarsystem/planets/earth/satellites/science/education.asset index f9aa07460f..0850296deb 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/science/education.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/science/education.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Education", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/science/engineering.asset b/data/assets/scene/solarsystem/planets/earth/satellites/science/engineering.asset index a59de0b948..b0d22df911 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/science/engineering.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/science/engineering.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Engineering", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/science/geodetic.asset b/data/assets/scene/solarsystem/planets/earth/satellites/science/geodetic.asset index 87daed06dc..e1999224d8 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/science/geodetic.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/science/geodetic.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Geodect", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/science/spaceearth.asset b/data/assets/scene/solarsystem/planets/earth/satellites/science/spaceearth.asset index fad2ab9354..6a18f6f1ad 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/science/spaceearth.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/science/spaceearth.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Space & Earth Science", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset index 0713514a18..0c4f304623 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset @@ -1,7 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local satelliteHelper = asset.require('util/tle_helper') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local satelliteHelper = asset.require("util/tle_helper") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local url = "http://celestrak.com/satcat/tle.php?CATNR=27424" local identifier = "Aqua" diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/argos.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/argos.asset index 332778d5af..e1fb6435cc 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/argos.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/argos.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "ARGOS", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/dmc.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/dmc.asset index 0eb43d7c33..804614312a 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/dmc.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/dmc.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Disaster Monitoring", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/earth_resources.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/earth_resources.asset index 77e3a76d2c..379c6e246f 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/earth_resources.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/earth_resources.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Earth Resources", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/goes.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/goes.asset index 789103e5f4..c4feefd1e8 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/goes.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/goes.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "GOES", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/noaa.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/noaa.asset index 4bac8d1821..b3d5f0e3a8 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/noaa.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/noaa.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "NOAA", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/planet.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/planet.asset index 9e7d126a20..6053428283 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/planet.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/planet.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Planet", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/sarsat.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/sarsat.asset index 56ba2e8f69..0e6fbaf55f 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/sarsat.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/sarsat.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Search & Rescue (SARSAT)", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset index 56a3146324..96c41cf1f6 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset @@ -1,7 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local satelliteHelper = asset.require('util/tle_helper') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local satelliteHelper = asset.require("util/tle_helper") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local url = "http://celestrak.com/satcat/tle.php?CATNR=37849" local identifier = "SNPP" diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/spire.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/spire.asset index a237421533..55c152ca80 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/spire.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/spire.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Spire", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/tdrss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/tdrss.asset index ec271ecb19..ec5303c5e9 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/tdrss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/tdrss.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Tracking and Data Relay Satellite System (TDRSS)", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset index 49c0fc93d1..cdf81c653d 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset @@ -1,7 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local satelliteHelper = asset.require('util/tle_helper') -local transforms = asset.require('scene/solarsystem/planets/earth/transforms') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local satelliteHelper = asset.require("util/tle_helper") +local transforms = asset.require("scene/solarsystem/planets/earth/transforms") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local url = "http://celestrak.com/satcat/tle.php?CATNR=25994" local identifier = "Terra" diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/weather.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/weather.asset index e1448013e5..1c9afa8c8c 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/weather.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/weather.asset @@ -1,5 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') -local shared = asset.require('util/tle_helper') +local shared = asset.require("util/tle_helper") local group = { Title = "Weather", diff --git a/data/assets/scene/solarsystem/planets/earth/trail.asset b/data/assets/scene/solarsystem/planets/earth/trail.asset index 2f91712bde..444dd149a7 100644 --- a/data/assets/scene/solarsystem/planets/earth/trail.asset +++ b/data/assets/scene/solarsystem/planets/earth/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/earth/transforms.asset b/data/assets/scene/solarsystem/planets/earth/transforms.asset index d08a74058f..f784b7aa15 100644 --- a/data/assets/scene/solarsystem/planets/earth/transforms.asset +++ b/data/assets/scene/solarsystem/planets/earth/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset index ddeb635c01..1a070de460 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/callisto.asset @@ -1,8 +1,8 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -asset.require('./trail') -local kernel = asset.require('../kernels').jup310 +asset.require("./trail") +local kernel = asset.require("../kernels").jup310 local labelsPath = asset.syncedResource({ Name = "Jupiter Labels", diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/default_layers.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/default_layers.asset index 2aa008311f..e76b4e01b9 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/callisto_texture") +local colorLayer = asset.require("./layers/colorlayers/callisto_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset index 922f837387..e8645189be 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/layers/colorlayers/callisto_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../callisto").Callisto.Identifier +local globeIdentifier = asset.require("../../callisto").Callisto.Identifier local texturesPath = asset.syncedResource({ Name = "Callisto Textures", diff --git a/data/assets/scene/solarsystem/planets/jupiter/callisto/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/callisto/trail.asset index 898bb93374..fcca4c1af0 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/callisto/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/callisto/trail.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -local kernel = asset.require('../kernels').jup310 +local kernel = asset.require("../kernels").jup310 diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset index 9d410ab75e..aef595b55b 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/europa.asset @@ -1,8 +1,8 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -asset.require('./trail') -local kernel = asset.require('../kernels').jup310 +asset.require("./trail") +local kernel = asset.require("../kernels").jup310 local labelsPath = asset.syncedResource({ Name = "Jupiter Labels", diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset index 1022dd7536..9b4ff9e14b 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/europa_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../europa").Europa.Identifier +local globeIdentifier = asset.require("../../europa").Europa.Identifier local texturesPath = asset.syncedResource({ Name = "Europa Textures", diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic.asset index 2fc9a355b5..4e7f923955 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic.asset @@ -1,10 +1,9 @@ -local map_service_configs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../europa").Europa.Identifier +local globeIdentifier = asset.require("../../europa").Europa.Identifier local layer = { Identifier = "Voyager_Global_Mosaic", Name = "Voyager Global Mosaic [Sweden]", - FilePath = map_service_configs .. "/LiU/Voyager_GalileoSSI_global_mosaic_500m.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Voyager_GalileoSSI_global_mosaic_500m.wms"), BlendMode = "Color", } diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset index 7a4265a51c..7a4ce49342 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_local.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../europa").Europa.Identifier +local globeIdentifier = asset.require("../../europa").Europa.Identifier local texturesPath = asset.syncedResource({ Name = "Europa Textures", diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/trail.asset index 3ceac18c53..3bb96d5e41 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/trail.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -local kernel = asset.require('../kernels').jup310 +local kernel = asset.require("../kernels").jup310 diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset index 18a6765f99..43ef9e2098 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/ganymede.asset @@ -1,8 +1,8 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -asset.require('./trail') -local kernel = asset.require('../kernels').jup310 +asset.require("./trail") +local kernel = asset.require("../kernels").jup310 local labelsPath = asset.syncedResource({ Name = "Jupiter Labels", diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset index 677569d2a8..1fcee46112 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/layers/colorlayers/ganymede_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../ganymede").Ganymede.Identifier +local globeIdentifier = asset.require("../../ganymede").Ganymede.Identifier local texturesPath = asset.syncedResource({ Name = "Ganymede Textures", diff --git a/data/assets/scene/solarsystem/planets/jupiter/ganymede/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/ganymede/trail.asset index c8b3a37e20..46f091bf79 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/ganymede/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/ganymede/trail.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -local kernel = asset.require('../kernels').jup310 +local kernel = asset.require("../kernels").jup310 diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset index 63b3d0d44d..f1db4cf69d 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/io.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/io.asset @@ -1,8 +1,8 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -asset.require('./trail') -local kernel = asset.require('../kernels').jup310 +asset.require("./trail") +local kernel = asset.require("../kernels").jup310 local labelsPath = asset.syncedResource({ Name = "Jupiter Labels", diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset index 5caebacd1c..9b1cc66f0b 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/layers/colorlayers/io_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../io").Io.Identifier +local globeIdentifier = asset.require("../../io").Io.Identifier local texturesPath = asset.syncedResource({ Name = "Io Textures", diff --git a/data/assets/scene/solarsystem/planets/jupiter/io/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/io/trail.asset index 63dcfd15d5..f61e88f68d 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/io/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/io/trail.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -local kernel = asset.require('../kernels').jup310 +local kernel = asset.require("../kernels").jup310 diff --git a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset index a7941b8f18..9e273566d7 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/jupiter.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('./transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -asset.require('./trail') +asset.require("./trail") local Jupiter = { Identifier = "Jupiter", diff --git a/data/assets/scene/solarsystem/planets/jupiter/kernels.asset b/data/assets/scene/solarsystem/planets/jupiter/kernels.asset index 5496ff308a..c71295f94e 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/kernels.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/kernels.asset @@ -5,8 +5,8 @@ local Kernels = asset.syncedResource({ Version = 1 }) -asset.export("jup310", Kernels .. 'jup310.bsp') -asset.export("jup341", Kernels .. 'jup341.bsp') +asset.export("jup310", Kernels .. "jup310.bsp") +asset.export("jup341", Kernels .. "jup341.bsp") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset b/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset index a3abb622ce..f66313ab79 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/layers/colorlayers/jupiter_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../jupiter").Jupiter.Identifier +local globeIdentifier = asset.require("../../jupiter").Jupiter.Identifier local texturesPath = asset.syncedResource({ Name = "Jupiter Textures", diff --git a/data/assets/scene/solarsystem/planets/jupiter/major_moons.asset b/data/assets/scene/solarsystem/planets/jupiter/major_moons.asset index 196e4d4209..bb87200aea 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/major_moons.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/major_moons.asset @@ -1,7 +1,7 @@ -asset.require('./callisto/callisto') -asset.require('./europa/europa') -asset.require('./ganymede/ganymede') -asset.require('./io/io') +asset.require("./callisto/callisto") +asset.require("./europa/europa") +asset.require("./ganymede/ganymede") +asset.require("./io/io") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor/ananke_group.asset b/data/assets/scene/solarsystem/planets/jupiter/minor/ananke_group.asset index d26e384b3e..4b9c98e2ee 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor/ananke_group.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor/ananke_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').jup341 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").jup341 diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor/carme_group.asset b/data/assets/scene/solarsystem/planets/jupiter/minor/carme_group.asset index 32f0c3b067..8e85cc0c8c 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor/carme_group.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor/carme_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').jup341 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").jup341 diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor/carpo_group.asset b/data/assets/scene/solarsystem/planets/jupiter/minor/carpo_group.asset index 0731ce60ba..ac662c73c0 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor/carpo_group.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor/carpo_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').jup341 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").jup341 diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor/himalia_group.asset b/data/assets/scene/solarsystem/planets/jupiter/minor/himalia_group.asset index 2b0619989c..9167001ea5 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor/himalia_group.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor/himalia_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').jup341 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").jup341 diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor/inner_group.asset b/data/assets/scene/solarsystem/planets/jupiter/minor/inner_group.asset index 34f81084ae..edaec35807 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor/inner_group.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor/inner_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').jup341 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").jup341 diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor/other_groups.asset b/data/assets/scene/solarsystem/planets/jupiter/minor/other_groups.asset index c72a04d69f..d6887a75b6 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor/other_groups.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor/other_groups.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').jup341 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").jup341 diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor/pasiphae_group.asset b/data/assets/scene/solarsystem/planets/jupiter/minor/pasiphae_group.asset index 8268262874..39abc8ce93 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor/pasiphae_group.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor/pasiphae_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').jup341 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").jup341 diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor/themisto_group.asset b/data/assets/scene/solarsystem/planets/jupiter/minor/themisto_group.asset index 343eb2c432..c1507dbcff 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor/themisto_group.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor/themisto_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').jup341 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").jup341 diff --git a/data/assets/scene/solarsystem/planets/jupiter/minor_moons.asset b/data/assets/scene/solarsystem/planets/jupiter/minor_moons.asset index f935b5d485..6b87a3618b 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/minor_moons.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/minor_moons.asset @@ -1,11 +1,11 @@ -asset.require('./minor/ananke_group') -asset.require('./minor/carme_group') -asset.require('./minor/carpo_group') -asset.require('./minor/himalia_group') -asset.require('./minor/inner_group') -asset.require('./minor/other_groups') -asset.require('./minor/pasiphae_group') -asset.require('./minor/themisto_group') +asset.require("./minor/ananke_group") +asset.require("./minor/carme_group") +asset.require("./minor/carpo_group") +asset.require("./minor/himalia_group") +asset.require("./minor/inner_group") +asset.require("./minor/other_groups") +asset.require("./minor/pasiphae_group") +asset.require("./minor/themisto_group") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/jupiter/trail.asset b/data/assets/scene/solarsystem/planets/jupiter/trail.asset index ef0ea4dc2a..d55a414ebd 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/trail.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/jupiter/trail_earth.asset b/data/assets/scene/solarsystem/planets/jupiter/trail_earth.asset index e89618469b..59ff6ab042 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/trail_earth.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/jupiter/transforms.asset b/data/assets/scene/solarsystem/planets/jupiter/transforms.asset index 510b1db636..e340a579ed 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/transforms.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sun_transforms_asset = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sun_transforms_asset = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/mars/atmosphere.asset b/data/assets/scene/solarsystem/planets/mars/atmosphere.asset index e76b1afd57..b1832cc1c4 100644 --- a/data/assets/scene/solarsystem/planets/mars/atmosphere.asset +++ b/data/assets/scene/solarsystem/planets/mars/atmosphere.asset @@ -1,5 +1,5 @@ -local transforms = asset.require('./mars') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./mars") +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/solarsystem/planets/mars/default_layers.asset b/data/assets/scene/solarsystem/planets/mars/default_layers.asset index 54354cbafd..3b03f38fce 100644 --- a/data/assets/scene/solarsystem/planets/mars/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/mars/default_layers.asset @@ -1,35 +1,31 @@ -local colorLayersPath = "./layers/colorlayers" -local heightLayersPath = "./layers/heightlayers" -local overlaysPath = "./layers/overlays" - -- Color layer -local colorLayer = asset.require(colorLayersPath .. "/moc_wa_color_utah") -- TODO: fallback -asset.require(colorLayersPath .. "/moc_wa_color_liu") -- TODO: fallback -asset.require(colorLayersPath .. "/viking_mdim_utah") -asset.require(colorLayersPath .. "/viking_mdim_sweden") -asset.require(colorLayersPath .. "/mola_pseudo_color_utah") -asset.require(colorLayersPath .. "/mola_pseudo_color_sweden") -asset.require(colorLayersPath .. "/mola_hrsc_utah") -asset.require(colorLayersPath .. "/mola_hrsc_sweden") -asset.require(colorLayersPath .. "/themis_ir_day_utah") -asset.require(colorLayersPath .. "/themis_ir_day_sweden") -asset.require(colorLayersPath .. "/themis_ir_night_utah") -asset.require(colorLayersPath .. "/themis_ir_night_sweden") -asset.require(colorLayersPath .. "/ctx_mosaic_utah") -asset.require(colorLayersPath .. "/ctx_mosaic_sweden") -asset.require(colorLayersPath .. "/ctx_blended_01") -asset.require(colorLayersPath .. "/hirise") -asset.require(colorLayersPath .. "/hirisels") +local colorLayer = asset.require("./layers/colorlayers/moc_wa_color_utah") -- TODO: fallback +asset.require("./layers/colorlayers/moc_wa_color_liu") -- TODO: fallback +asset.require("./layers/colorlayers/viking_mdim_utah") +asset.require("./layers/colorlayers/viking_mdim_sweden") +asset.require("./layers/colorlayers/mola_pseudo_color_utah") +asset.require("./layers/colorlayers/mola_pseudo_color_sweden") +asset.require("./layers/colorlayers/mola_hrsc_utah") +asset.require("./layers/colorlayers/mola_hrsc_sweden") +asset.require("./layers/colorlayers/themis_ir_day_utah") +asset.require("./layers/colorlayers/themis_ir_day_sweden") +asset.require("./layers/colorlayers/themis_ir_night_utah") +asset.require("./layers/colorlayers/themis_ir_night_sweden") +asset.require("./layers/colorlayers/ctx_mosaic_utah") +asset.require("./layers/colorlayers/ctx_mosaic_sweden") +asset.require("./layers/colorlayers/ctx_blended_01") +asset.require("./layers/colorlayers/hirise") +asset.require("./layers/colorlayers/hirisels") -- Height layers -asset.require(heightLayersPath .. "/mola_europe") -asset.require(heightLayersPath .. "/mola_utah") -local heightLayer = asset.require(heightLayersPath .. "/MDEM200M") -asset.require(heightLayersPath .. "/hirisels") +asset.require("./layers/heightlayers/mola_europe") +asset.require("./layers/heightlayers/mola_utah") +local heightLayer = asset.require("./layers/heightlayers/MDEM200M") +asset.require("./layers/heightlayers/hirisels") -- Overlays -asset.require(overlaysPath .. "/indices") -asset.require(overlaysPath .. "/size_reference") +asset.require("./layers/overlays/indices") +asset.require("./layers/overlays/size_reference") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_blended_01.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_blended_01.asset index bf644867fd..179e938342 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_blended_01.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_blended_01.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "CTX_blended_01", Name = "CTX Blended beta01", - FilePath = mapServiceConfigs .. "/ESRI/CTX/CTXblended.vrt", + FilePath = asset.localResource("../../map_service_configs/ESRI/CTX/CTXblended.vrt"), BlendMode = "Color", Settings = { Gamma = 2.14, diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_sweden.asset index 9b414b1fc3..62cd6931a6 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "CTX_Mosaic_Sweden", Name = "CTX Mosaic [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/CTX.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/CTX.wms"), BlendMode = "Color" } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_utah.asset index 1b7342a8d1..0a9c0c867a 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "CTX_Mosaic_Utah", Name = "CTX Mosaic [Utah]", - FilePath = mapServiceConfigs .. "/Utah/CTX.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/CTX.wms"), BlendMode = "Color" } diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirise.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirise.asset index c3bedbb9a9..5c6a3959cc 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirise.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirise.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "HiRISE-PSP", Name = "HiRISE", - FilePath = mapServiceConfigs .. "/ESRI/HiRISE/HiRISE_PSP.vrt", + FilePath = asset.localResource("../../map_service_configs/ESRI/HiRISE/HiRISE_PSP.vrt"), BlendMode = "Color", Settings = { Gamma = 1.0, diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirisels.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirisels.asset index 5dd9e190c5..6f2e555f2f 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirisels.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/hirisels.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "HiRISE-LS", Name = "HiRISE Local Set", - FilePath = mapServiceConfigs .. "/ESRI/HiRISE/HiRISELS.vrt", + FilePath = asset.localResource("../../map_service_configs/ESRI/HiRISE/HiRISELS.vrt"), BlendMode = "Color", Description = [[ HiRISE (High Resolution Imaging Science Experiment) is the most powerful camera ever sent to another planet, one of six instruments onboard the diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset index d33448f891..45bfc84439 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mars_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local texturesPath = asset.syncedResource({ Name = "Mars Textures", diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_liu.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_liu.asset index 71cf10ad69..b5d115a129 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_liu.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_liu.asset @@ -1,12 +1,11 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local fallbackLayer = asset.require("./fallbacks/mars_texture").layer local layer = { Identifier = "MOC_WA_Color_LiU", Name = "MOC WA Color [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Color.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Color.wms"), Settings = { Gamma = 1.6, Multiplier = 1.07 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.asset index d62edc34ed..3a33d4a99b 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.asset @@ -1,12 +1,11 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local fallbackLayer = asset.require("./fallbacks/mars_texture").layer local layer = { Identifier = "MOC_WA_Color_Utah", Name = "MOC WA Color [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Mars_Color.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Mars_Color.wms"), Settings = { Gamma = 1.6, Multiplier = 1.07 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.asset index d532c11131..3cec671817 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "MOLA_HRSC_Sweden", Name = "MOLA HRSC [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Mola_HRSC.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Mola_HRSC.wms"), Description = [[ This map layer is colorzied based elevation data from MOLA and HRSC. Compared to MOLA Psuedo Color, this layer has no terrain shading, which is suitable for use when combing with other layers. Data Reference: diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.asset index faf06c205d..db565192bb 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "MOLA_HRSC_Utah", Name = "MOLA HRSC [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Mola_HRSC.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Mola_HRSC.wms"), Description = [[ This map layer is colorzied based elevation data from MOLA and HRSC. Compared to MOLA Psuedo Color, this layer has no terrain shading, which is suitable for use when combing with other layers. Data Reference: diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.asset index f2595009a5..af4a3e8d7a 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "MOLA_Pseudo_Color_Sweden", Name = "MOLA Pseudo Color [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Mola_PseudoColor.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Mola_PseudoColor.wms"), Description = [[This map is based on data from the Mars Orbiter Laser Altimeter (MOLA) (Smith, et al., 2001), an instrument on NASA’s Mars Global Surveyor (MGS) spacecraft (Albee, et al., 2001). The image used for the base of this map diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.asset index 06ab2bdca2..c0f71a4dbd 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "MOLA_Pseudo_Color_Utah", Name = "MOLA Pseudo Color [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Mola_PseudoColor.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Mola_PseudoColor.wms"), Description = [[This map is based on data from the Mars Orbiter Laser Altimeter (MOLA) (Smith, et al., 2001), an instrument on NASA’s Mars Global Surveyor (MGS) spacecraft (Albee, et al., 2001). The image used for the base of this map diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.asset index 8f31b54ba7..3e485babf9 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Themis_IR_Day_Sweden", Name = "Themis IR Day [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Themis_IR_Day.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Themis_IR_Day.wms"), BlendMode = "Color", Description = [[This mosaic represents the Thermal Emission Imaging System (THEMIS) -daytime infrared (IR) 100 meter/pixel mosaic (version 12) released in the summer diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.asset index d01800cf9e..491b1fc61d 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Themis_IR_Day_Utah", Name = "Themis IR Day [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Themis_IR_Day.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Themis_IR_Day.wms"), BlendMode = "Color", Description = [[This mosaic represents the Thermal Emission Imaging System (THEMIS) -daytime infrared (IR) 100 meter/pixel mosaic (version 12) released in the summer diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.asset index d4bfd6a9ad..7aa17d33fc 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Themis_IR_Night_Sweden", Name = "Themis IR Night [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Themis_IR_Night.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Themis_IR_Night.wms"), BlendMode = "Color", Description = [[This mosaic represents the Thermal Emission Imaging System (THEMIS) -nighttime infrared (IR) 100 meter/pixel mosaic (version 12) released in the diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.asset index b2f1b72f38..b583d89127 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Themis_IR_Night_Utah", Name = "Themis IR Night [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Themis_IR_Night.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Themis_IR_Night.wms"), BlendMode = "Color", Description = [[This mosaic represents the Thermal Emission Imaging System (THEMIS) -nighttime infrared (IR) 100 meter/pixel mosaic (version 12) released in the diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.asset index dc2d73a5d6..761ddd4ef0 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Viking_MDIM_Sweden", Name = "Viking MDIM [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/MDIM.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/MDIM.wms"), Description = [[This global image map of Mars has a resolution of 256 pixels/degree (scale approximately 232 meters per pixel (m) at the equator). The colorized mosaic was completed by NASA AMES which warped the original Viking colorized diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.asset index d5d9fe3faf..d3db1daf82 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Viking_MDIM_Utah", Name = "Viking MDIM [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Mdim.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Mdim.wms"), Description = [[This global image map of Mars has a resolution of 256 pixels/degree (scale approximately 232 meters per pixel (m) at the equator). The colorized mosaic was completed by NASA AMES which warped the original Viking colorized diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/MDEM200M.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/MDEM200M.asset index fefc177186..181a1e153d 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/MDEM200M.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/MDEM200M.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "MDEM200M", Name = "HRSC MOLA Blended DEM Global 200m v2", - FilePath = mapServiceConfigs .. "/ESRI/MDEM200M.tif", + FilePath = asset.localResource("../../map_service_configs/ESRI/MDEM200M.tif"), Description = [[ Blend of data derived from the Mars Orbiter Laser Altimeter (MOLA, an instrument aboard NASA’s Mars Global Surveyor spacecraft), and data derived from the High-Resolution diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/hirisels.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/hirisels.asset index 795213cff8..b5bee61058 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/hirisels.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/hirisels.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "HiRISE-LS-DEM", Name = "HiRISE Local Set DEM", - FilePath = mapServiceConfigs .. "/ESRI/HiRISE/HiRISE_DEM.dem", + FilePath = asset.localResource("../../map_service_configs/ESRI/HiRISE/HiRISE_DEM.dem"), Description = [[ HiRISE (High Resolution Imaging Science Experiment) is the most powerful camera ever sent to another planet, one of six instruments onboard the Mars Reconnaissance Orbiter. We launched in 2005, arrived at Mars in 2006 and have diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_europe.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_europe.asset index 7943fe4196..f745f41664 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_europe.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_europe.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Mola_Europe", Name = "Mola Elevation [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Mola_Elevation.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Mola_Elevation.wms"), TilePixelSize = 90, Description = [[ This digital elevation model (DEM) is based on data from the Mars Orbiter Laser Altimeter (MOLA; Smith et al., 2001), an instrument on NASA's Mars diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.asset index ed377660bc..a4def6d120 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Mola_Utah", Name = "Mola Elevation [Utah]", - FilePath = mapServiceConfigs .. "/Utah/Mola_Elevation.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/Mola_Elevation.wms"), TilePixelSize = 90, Description = [[ This digital elevation model (DEM) is based on data from the Mars Orbiter Laser Altimeter (MOLA; Smith et al., 2001), an instrument on NASA's Mars diff --git a/data/assets/scene/solarsystem/planets/mars/layers/overlays/indices.asset b/data/assets/scene/solarsystem/planets/mars/layers/overlays/indices.asset index 84a291e4a8..3136ceea89 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/overlays/indices.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/overlays/indices.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../mars").Mars.Identifier +local globeIdentifier = asset.require("../../mars").Mars.Identifier local layer = { Identifier = "Indices", diff --git a/data/assets/scene/solarsystem/planets/mars/layers/overlays/size_reference.asset b/data/assets/scene/solarsystem/planets/mars/layers/overlays/size_reference.asset index 0fa6e5d926..fe6c339349 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/overlays/size_reference.asset +++ b/data/assets/scene/solarsystem/planets/mars/layers/overlays/size_reference.asset @@ -1,4 +1,4 @@ -local marsAsset = asset.require("./../../mars").Mars +local marsAsset = asset.require("../../mars").Mars local globeIdentifier = marsAsset.Identifier local layer ={ diff --git a/data/assets/scene/solarsystem/planets/mars/mars.asset b/data/assets/scene/solarsystem/planets/mars/mars.asset index d1d6babd0f..135de2b5ca 100644 --- a/data/assets/scene/solarsystem/planets/mars/mars.asset +++ b/data/assets/scene/solarsystem/planets/mars/mars.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('./transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -asset.require('./trail') +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Mars Labels", diff --git a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset index f98cd46dc1..14e2b7f7bb 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset @@ -1,5 +1,5 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") local kernels = asset.syncedResource({ Name = "Mars Spice Kernels", @@ -8,7 +8,6 @@ local kernels = asset.syncedResource({ Version = 1 }) - local Deimos = { Identifier = "Deimos", Parent = transforms.MarsBarycenter.Identifier, @@ -17,13 +16,13 @@ local Deimos = { Type = "SpiceRotation", SourceFrame = "IAU_DEIMOS", DestinationFrame = "GALACTIC", - Kernels = kernels .. 'mar097.bsp' + Kernels = kernels .. "mar097.bsp" }, Translation = { Type = "SpiceTranslation", Target = "DEIMOS", Observer = "MARS BARYCENTER", - Kernels = kernels .. 'mar097.bsp' + Kernels = kernels .. "mar097.bsp" } }, Renderable = { diff --git a/data/assets/scene/solarsystem/planets/mars/moons/layers/colorlayers/deimos_viking.asset b/data/assets/scene/solarsystem/planets/mars/moons/layers/colorlayers/deimos_viking.asset index e2d8bcc965..97ab860099 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/layers/colorlayers/deimos_viking.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/layers/colorlayers/deimos_viking.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../deimos").Deimos.Identifier +local globeIdentifier = asset.require("../../deimos").Deimos.Identifier local layer = { Identifier = "Deimos_Global_Mosaic_USGS", diff --git a/data/assets/scene/solarsystem/planets/mars/moons/layers/colorlayers/phobos_viking.asset b/data/assets/scene/solarsystem/planets/mars/moons/layers/colorlayers/phobos_viking.asset index a753881a56..446c188279 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/layers/colorlayers/phobos_viking.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/layers/colorlayers/phobos_viking.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../phobos").Phobos.Identifier +local globeIdentifier = asset.require("../../phobos").Phobos.Identifier local layer = { Identifier = "Phobos_Global_Shaded_Relief_USGS", diff --git a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset index cedd49e9f8..4b8aad75d5 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset @@ -1,5 +1,5 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") local kernels = asset.syncedResource({ Name = "Mars Spice Kernels", @@ -8,7 +8,6 @@ local kernels = asset.syncedResource({ Version = 1 }) - local Phobos = { Identifier = "Phobos", Parent = transforms.MarsBarycenter.Identifier, @@ -17,13 +16,13 @@ local Phobos = { Type = "SpiceRotation", SourceFrame = "IAU_PHOBOS", DestinationFrame = "GALACTIC", - Kernels = kernels .. 'mar097.bsp' + Kernels = kernels .. "mar097.bsp" }, Translation = { Type = "SpiceTranslation", Target = "PHOBOS", Observer = "MARS BARYCENTER", - Kernels = kernels .. 'mar097.bsp' + Kernels = kernels .. "mar097.bsp" } }, Renderable = { diff --git a/data/assets/scene/solarsystem/planets/mars/trail.asset b/data/assets/scene/solarsystem/planets/mars/trail.asset index 78e8eea805..bda74c054b 100644 --- a/data/assets/scene/solarsystem/planets/mars/trail.asset +++ b/data/assets/scene/solarsystem/planets/mars/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/mars/trail_earth.asset b/data/assets/scene/solarsystem/planets/mars/trail_earth.asset index 0863042ef5..d96759605b 100644 --- a/data/assets/scene/solarsystem/planets/mars/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/mars/trail_earth.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/mars/transforms.asset b/data/assets/scene/solarsystem/planets/mars/transforms.asset index 7b8fb79dbf..1e3ff966f5 100644 --- a/data/assets/scene/solarsystem/planets/mars/transforms.asset +++ b/data/assets/scene/solarsystem/planets/mars/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") local MarsBarycenter = { diff --git a/data/assets/scene/solarsystem/planets/mercury/default_layers.asset b/data/assets/scene/solarsystem/planets/mercury/default_layers.asset index 1193812a21..e4daa2b0a9 100644 --- a/data/assets/scene/solarsystem/planets/mercury/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/mercury/default_layers.asset @@ -1,39 +1,37 @@ -local colorLayersPath = "./layers/colorlayers" - --mdis -asset.require(colorLayersPath .. "/messenger_mdis_utah") -asset.require(colorLayersPath .. "/messenger_mdis_sweden") +asset.require("./layers/colorlayers/messenger_mdis_utah") +asset.require("./layers/colorlayers/messenger_mdis_sweden") --mossaic -asset.require(colorLayersPath .. "/messenger_mosaic_utah") -asset.require(colorLayersPath .. "/messenger_mosaic_sweden") +asset.require("./layers/colorlayers/messenger_mosaic_utah") +asset.require("./layers/colorlayers/messenger_mosaic_sweden") --mosaic2 aka 8 color -asset.require(colorLayersPath .. "/messenger_mosaic2_utah") -asset.require(colorLayersPath .. "/messenger_mosaic2_sweden") +asset.require("./layers/colorlayers/messenger_mosaic2_utah") +asset.require("./layers/colorlayers/messenger_mosaic2_sweden") --bdr -local colorLayer = asset.require(colorLayersPath .. "/messenger_bdr_utah") -- TODO enabled -asset.require(colorLayersPath .. "/messenger_bdr_sweden") +local colorLayer = asset.require("./layers/colorlayers/messenger_bdr_utah") -- TODO enabled +asset.require("./layers/colorlayers/messenger_bdr_sweden") --mdr -asset.require(colorLayersPath .. "/messenger_mdr_utah") +asset.require("./layers/colorlayers/messenger_mdr_utah") --mp3 -asset.require(colorLayersPath .. "/messenger_mp3_utah") +asset.require("./layers/colorlayers/messenger_mp3_utah") --hie -asset.require(colorLayersPath .. "/messenger_hie_utah") -asset.require(colorLayersPath .. "/messenger_hie_sweden") +asset.require("./layers/colorlayers/messenger_hie_utah") +asset.require("./layers/colorlayers/messenger_hie_sweden") --hiw -asset.require(colorLayersPath .. "/messenger_hiw_utah") -asset.require(colorLayersPath .. "/messenger_hiw_sweden") +asset.require("./layers/colorlayers/messenger_hiw_utah") +asset.require("./layers/colorlayers/messenger_hiw_sweden") --loi -asset.require(colorLayersPath .. "/messenger_loi_utah") -asset.require(colorLayersPath .. "/messenger_loi_sweden") +asset.require("./layers/colorlayers/messenger_loi_utah") +asset.require("./layers/colorlayers/messenger_loi_sweden") --shade -asset.require(colorLayersPath .. "/messenger_shade_utah") -asset.require(colorLayersPath .. "/messenger_shade_sweden") +asset.require("./layers/colorlayers/messenger_shade_utah") +asset.require("./layers/colorlayers/messenger_shade_sweden") --local textures, these are mineral abundance maps -asset.require(colorLayersPath .. "/alsimap_02122015") -asset.require(colorLayersPath .. "/casimap_02122015") -asset.require(colorLayersPath .. "/fesimap_02122015") -asset.require(colorLayersPath .. "/mgsimap_02122015") -asset.require(colorLayersPath .. "/ssimap_02122015") +asset.require("./layers/colorlayers/alsimap_02122015") +asset.require("./layers/colorlayers/casimap_02122015") +asset.require("./layers/colorlayers/fesimap_02122015") +asset.require("./layers/colorlayers/mgsimap_02122015") +asset.require("./layers/colorlayers/ssimap_02122015") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset index ee7e845e12..4191fa531b 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/alsimap_02122015.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local texturesPath = asset.syncedResource({ Name = "Mercury Textures", diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset index 62a02e3634..132c104cc7 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/casimap_02122015.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local texturesPath = asset.syncedResource({ Name = "Mercury Textures", diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset index 254c215600..20762ae4a4 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/fesimap_02122015.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local texturesPath = asset.syncedResource({ Name = "Mercury Textures", diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_sweden.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_sweden.asset index 5c1be9ae17..22b3bb26aa 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_BDR_Sweden", Name = "Messenger BDR [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Messenger_BDR.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Messenger_BDR.wms"), TilePixelSize = 360, } diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_utah.asset index 739f312e00..cf9f2190da 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_utah.asset @@ -1,11 +1,10 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_BDR_Utah", Name = "Messenger BDR [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerBDR.wms", - TilePixelSize = 360, + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerBDR.wms"), + TilePixelSize = 360 } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_sweden.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_sweden.asset index 808b5726c9..e27291a9cd 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_HIE_Sweden", Name = "Messenger HIE [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Messenger_HIE.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Messenger_HIE.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_utah.asset index 0e5c229df6..0bd6f227f4 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_HIE_Utah", Name = "Messenger HIE [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerHIE.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerHIE.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_sweden.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_sweden.asset index bb2fd1bf06..c5d3e2b006 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_HIW_Sweden", Name = "Messenger HIW [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Messenger_HIW.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Messenger_HIW.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_utah.asset index 4eccc97a04..70b00ce8e4 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_HIW_Utah", Name = "Messenger HIW [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerHIW.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerHIW.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_sweden.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_sweden.asset index a6f1749c87..c791c85350 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_LOI_Sweden", Name = "Messenger LOI [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Messenger_LOI.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Messenger_LOI.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_utah.asset index c4bfe727b5..e6938ea90d 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_LOI_Utah", Name = "Messenger LOI [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerLOI.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerLOI.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_sweden.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_sweden.asset index 541c360148..f6da38cf22 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_MDIS_Sweden", Name = "Messenger MDIS [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Messenger_MDIS.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Messenger_MDIS.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_utah.asset index 231aa8bba8..784f9ad743 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_MDIS_Utah", Name = "Messenger MDIS [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerMDIS.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerMDIS.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdr_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdr_utah.asset index 01a5d89f63..d2fdbbee56 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdr_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdr_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_MDR_Utah", Name = "Messenger MDR [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerMDR.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerMDR.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_sweden.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_sweden.asset index ea4103fb23..c2df9ccab1 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_Mosaic2_Sweden", Name = "Messenger Mosaic2 [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Messenger_Mosaic_2.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Messenger_Mosaic_2.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_utah.asset index b2779a0203..47bc85cb98 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_Mosaic2_Utah", Name = "Messenger Mosaic2 [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerMosaic2.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerMosaic2.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_sweden.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_sweden.asset index 8ba07d375f..3bb7b1c824 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_Mosaic_Sweden", Name = "Messenger Mosaic [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Messenger_Mosaic.wms" + FilePath = asset.localResource("../../map_service_configs/LiU/Messenger_Mosaic.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_utah.asset index 9e6f140cb4..f26788dc8d 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_Mosaic_Utah", Name = "Messenger Mosaic [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerMosaic.wms" + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerMosaic.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mp3_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mp3_utah.asset index e9599d9bc6..84be9e3d77 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mp3_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mp3_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_MP3_Utah", Name = "Messenger MP3 [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerMP3.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerMP3.wms") } asset.onInitialize(function () diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_sweden.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_sweden.asset index 75e1311ce6..eea00d2c62 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_sweden.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_sweden.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_SHADE_Sweden", Name = "Messenger SHADE [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/Messenger_SHADE.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/Messenger_SHADE.wms"), Settings = { Gamma = 1.33, Multiplier = 1.15 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_utah.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_utah.asset index db21653329..e73e783df8 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_utah.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_utah.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local layer = { Identifier = "Messenger_SHADE_Utah", Name = "Messenger SHADE [Utah]", - FilePath = mapServiceConfigs .. "/Utah/MessengerSHADE.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MessengerSHADE.wms"), Settings = { Gamma = 1.33, Multiplier = 1.15 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset index d814e81f01..138e1017b3 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/mgsimap_02122015.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local texturesPath = asset.syncedResource({ Name = "Mercury Textures", diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset index 5ceddf457e..b910263ee5 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/ssimap_02122015.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../mercury").Mercury.Identifier +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier local texturesPath = asset.syncedResource({ Name = "Mercury Textures", diff --git a/data/assets/scene/solarsystem/planets/mercury/mercury.asset b/data/assets/scene/solarsystem/planets/mercury/mercury.asset index 65adb9c0b2..9ecd31f795 100644 --- a/data/assets/scene/solarsystem/planets/mercury/mercury.asset +++ b/data/assets/scene/solarsystem/planets/mercury/mercury.asset @@ -1,8 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') - +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") asset.require("spice/base") -asset.require('./trail') +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Mercury Labels", diff --git a/data/assets/scene/solarsystem/planets/mercury/trail.asset b/data/assets/scene/solarsystem/planets/mercury/trail.asset index 2514f0ca70..410e93a92a 100644 --- a/data/assets/scene/solarsystem/planets/mercury/trail.asset +++ b/data/assets/scene/solarsystem/planets/mercury/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/mercury/trail_earth.asset b/data/assets/scene/solarsystem/planets/mercury/trail_earth.asset index 1d44518f34..1eb4e8c0a4 100644 --- a/data/assets/scene/solarsystem/planets/mercury/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/mercury/trail_earth.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/mercury/transforms.asset b/data/assets/scene/solarsystem/planets/mercury/transforms.asset index 0b85348f9b..db4f045299 100644 --- a/data/assets/scene/solarsystem/planets/mercury/transforms.asset +++ b/data/assets/scene/solarsystem/planets/mercury/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") local MercuryBarycenter = { diff --git a/data/assets/scene/solarsystem/planets/neptune/default_layers.asset b/data/assets/scene/solarsystem/planets/neptune/default_layers.asset index aa5c63aeb5..aaa96a1536 100644 --- a/data/assets/scene/solarsystem/planets/neptune/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/neptune/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/neptune_texture") +local colorLayer = asset.require("./layers/colorlayers/neptune_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/neptune/inner_moons.asset b/data/assets/scene/solarsystem/planets/neptune/inner_moons.asset index dc8e85f381..2a81441ae9 100644 --- a/data/assets/scene/solarsystem/planets/neptune/inner_moons.asset +++ b/data/assets/scene/solarsystem/planets/neptune/inner_moons.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('./transforms') -local kernels = asset.require('./kernels') +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("./transforms") +local kernels = asset.require("./kernels") local kernel081 = kernels.nep081 local kernel087 = kernels.nep087 local kernel088 = kernels.nep088 diff --git a/data/assets/scene/solarsystem/planets/neptune/irregular_prograde_moons.asset b/data/assets/scene/solarsystem/planets/neptune/irregular_prograde_moons.asset index efb2834b56..b7d72ee0b1 100644 --- a/data/assets/scene/solarsystem/planets/neptune/irregular_prograde_moons.asset +++ b/data/assets/scene/solarsystem/planets/neptune/irregular_prograde_moons.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('./transforms') -local kernels = asset.require('./kernels') +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("./transforms") +local kernels = asset.require("./kernels") local kernel081 = kernels.nep081 local kernel086 = kernels.nep086 local kernel088 = kernels.nep088 diff --git a/data/assets/scene/solarsystem/planets/neptune/irregular_retrograde_moons.asset b/data/assets/scene/solarsystem/planets/neptune/irregular_retrograde_moons.asset index 38d9472ffa..fde9c5e8aa 100644 --- a/data/assets/scene/solarsystem/planets/neptune/irregular_retrograde_moons.asset +++ b/data/assets/scene/solarsystem/planets/neptune/irregular_retrograde_moons.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('./transforms') -local kernels = asset.require('./kernels') +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("./transforms") +local kernels = asset.require("./kernels") local kernel081 = kernels.nep081 local kernel086 = kernels.nep086 diff --git a/data/assets/scene/solarsystem/planets/neptune/kernels.asset b/data/assets/scene/solarsystem/planets/neptune/kernels.asset index f3ba3754aa..d512e3d7c3 100644 --- a/data/assets/scene/solarsystem/planets/neptune/kernels.asset +++ b/data/assets/scene/solarsystem/planets/neptune/kernels.asset @@ -5,10 +5,10 @@ local Kernels = asset.syncedResource({ Version = 1 }) -asset.export("nep081", Kernels .. 'nep081.bsp') -asset.export("nep086", Kernels .. 'nep086.bsp') -asset.export("nep087", Kernels .. 'nep087.bsp') -asset.export("nep088", Kernels .. 'nep088.bsp') +asset.export("nep081", Kernels .. "nep081.bsp") +asset.export("nep086", Kernels .. "nep086.bsp") +asset.export("nep087", Kernels .. "nep087.bsp") +asset.export("nep088", Kernels .. "nep088.bsp") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset b/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset index 88e18a9a97..86a3625998 100644 --- a/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset +++ b/data/assets/scene/solarsystem/planets/neptune/layers/colorlayers/neptune_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../neptune").Neptune.Identifier +local globeIdentifier = asset.require("../../neptune").Neptune.Identifier local texturesPath = asset.syncedResource({ Name = "Neptune textures", diff --git a/data/assets/scene/solarsystem/planets/neptune/major_moons.asset b/data/assets/scene/solarsystem/planets/neptune/major_moons.asset index 698924a3e3..18ffe8f9b0 100644 --- a/data/assets/scene/solarsystem/planets/neptune/major_moons.asset +++ b/data/assets/scene/solarsystem/planets/neptune/major_moons.asset @@ -1,4 +1,4 @@ -asset.require('./triton') +asset.require("./triton") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/neptune/minor_moons.asset b/data/assets/scene/solarsystem/planets/neptune/minor_moons.asset index 83a3d6391f..8f5e758e56 100644 --- a/data/assets/scene/solarsystem/planets/neptune/minor_moons.asset +++ b/data/assets/scene/solarsystem/planets/neptune/minor_moons.asset @@ -1,3 +1,3 @@ -asset.require('./inner_moons') -asset.require('./irregular_prograde_moons') -asset.require('./irregular_retrograde_moons') +asset.require("./inner_moons") +asset.require("./irregular_prograde_moons") +asset.require("./irregular_retrograde_moons") diff --git a/data/assets/scene/solarsystem/planets/neptune/neptune.asset b/data/assets/scene/solarsystem/planets/neptune/neptune.asset index e4e226a339..e8702e04e7 100644 --- a/data/assets/scene/solarsystem/planets/neptune/neptune.asset +++ b/data/assets/scene/solarsystem/planets/neptune/neptune.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") asset.require("spice/base") -asset.require('./trail') +asset.require("./trail") local Neptune = { Identifier = "Neptune", diff --git a/data/assets/scene/solarsystem/planets/neptune/trail.asset b/data/assets/scene/solarsystem/planets/neptune/trail.asset index a20febb561..579a87ff9d 100644 --- a/data/assets/scene/solarsystem/planets/neptune/trail.asset +++ b/data/assets/scene/solarsystem/planets/neptune/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/neptune/trail_earth.asset b/data/assets/scene/solarsystem/planets/neptune/trail_earth.asset index 791e8f70dd..6bd470acf5 100644 --- a/data/assets/scene/solarsystem/planets/neptune/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/neptune/trail_earth.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/neptune/transforms.asset b/data/assets/scene/solarsystem/planets/neptune/transforms.asset index d5f0409737..fdb81080ad 100644 --- a/data/assets/scene/solarsystem/planets/neptune/transforms.asset +++ b/data/assets/scene/solarsystem/planets/neptune/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sun_transforms_asset = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sun_transforms_asset = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") local NeptuneBarycenter = { diff --git a/data/assets/scene/solarsystem/planets/neptune/triton.asset b/data/assets/scene/solarsystem/planets/neptune/triton.asset index 8dec8708d0..cbeba17776 100644 --- a/data/assets/scene/solarsystem/planets/neptune/triton.asset +++ b/data/assets/scene/solarsystem/planets/neptune/triton.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('./transforms') -local kernel = asset.require('./kernels').nep081 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("./transforms") +local kernel = asset.require("./kernels").nep081 diff --git a/data/assets/scene/solarsystem/planets/planets.asset b/data/assets/scene/solarsystem/planets/planets.asset index 1b6fac78fc..77fb625fc8 100644 --- a/data/assets/scene/solarsystem/planets/planets.asset +++ b/data/assets/scene/solarsystem/planets/planets.asset @@ -1,33 +1,33 @@ -asset.require('./mercury/mercury') +asset.require("./mercury/mercury") -asset.require('./venus/venus') -asset.require('./venus/trail') -asset.require('./venus/trail_earth') -asset.require('./venus/atmosphere') +asset.require("./venus/venus") +asset.require("./venus/trail") +asset.require("./venus/trail_earth") +asset.require("./venus/atmosphere") -asset.require('./earth/earth') -asset.require('./earth/trail') -asset.require('./earth/atmosphere') -asset.require('./earth/markers') -asset.require('./earth/moon/moon') -asset.require('./earth/moon/trail') +asset.require("./earth/earth") +asset.require("./earth/trail") +asset.require("./earth/atmosphere") +asset.require("./earth/markers") +asset.require("./earth/moon/moon") +asset.require("./earth/moon/trail") -asset.require('./mars/mars') -asset.require('./mars/atmosphere') -asset.require('./mars/moons/phobos') -asset.require('./mars/moons/deimos') +asset.require("./mars/mars") +asset.require("./mars/atmosphere") +asset.require("./mars/moons/phobos") +asset.require("./mars/moons/deimos") -asset.require('./jupiter/jupiter') -asset.require('./jupiter/major_moons') +asset.require("./jupiter/jupiter") +asset.require("./jupiter/major_moons") -asset.require('./saturn/saturn') -asset.require('./saturn/major_moons') +asset.require("./saturn/saturn") +asset.require("./saturn/major_moons") -asset.require('./uranus/uranus') -asset.require('./uranus/major_moons') +asset.require("./uranus/uranus") +asset.require("./uranus/major_moons") -asset.require('./neptune/neptune') -asset.require('./neptune/major_moons') +asset.require("./neptune/neptune") +asset.require("./neptune/major_moons") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/saturn/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/default_layers.asset index 897c4f114d..5e92d43950 100644 --- a/data/assets/scene/solarsystem/planets/saturn/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/saturn_texture") +local colorLayer = asset.require("./layers/colorlayers/saturn_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/dione/default_layers.asset index d68bb5c002..267d525cf9 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/dione_texture") +local colorLayer = asset.require("./layers/colorlayers/dione_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset index b257b98717..3ae5d1dd71 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/dione.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 -asset.require('./trail') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Saturn Labels", diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset b/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset index aa44d870d3..891a48d36c 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/layers/colorlayers/dione_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../dione").Dione.Identifier +local globeIdentifier = asset.require("../../dione").Dione.Identifier local texturesPath = asset.syncedResource({ Name = "Dione textures", diff --git a/data/assets/scene/solarsystem/planets/saturn/dione/trail.asset b/data/assets/scene/solarsystem/planets/saturn/dione/trail.asset index 3b2f8a2d60..b051a95e24 100644 --- a/data/assets/scene/solarsystem/planets/saturn/dione/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/dione/trail.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/default_layers.asset index f488cfd5b7..415a5f882d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/default_layers.asset @@ -1,7 +1,5 @@ -local colorLayersPath = "./layers/colorlayers" - -asset.require(colorLayersPath .. "/enceladus_texture") -local colorLayer = asset.require(colorLayersPath .. "/global_mosaic_100m_hpf") +asset.require("./layers/colorlayers/enceladus_texture") +local colorLayer = asset.require("./layers/colorlayers/global_mosaic_100m_hpf") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset index 7361a0676d..48fbce8a6d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/enceladus.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 -asset.require('./trail') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Saturn Labels", diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset index 0242b1901e..b28f512525 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/enceladus_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../enceladus").Enceladus.Identifier +local globeIdentifier = asset.require("../../enceladus").Enceladus.Identifier local texturesPath = asset.syncedResource({ Name = "Enceladus textures", diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset index 861e113338..44d4cc0da4 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../enceladus").Enceladus.Identifier +local globeIdentifier = asset.require("../../enceladus").Enceladus.Identifier local layer = { Identifier = "Global_Mosaic_100m_HPF", Name = "Cassini Global Mosaic 100m HPF", - FilePath = mapServiceConfigs .. "/Cassini_ISS_Global_Mosaic_100m_HPF.wms", + FilePath = asset.localResource("../../map_service_configs/Cassini_ISS_Global_Mosaic_100m_HPF.wms"), Description = [[ This mosaic represents the completion of a global control network of Enceladus containing Cassini Imaging Science Subsystem (ISS) images. A total of 586 images in CLR, GRN, UV3, and IR3 filters were selected for the control diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/trail.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/trail.asset index df798fc9bb..eb70ea00ea 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/trail.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/hyperion/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/hyperion/default_layers.asset index ad25754fce..d575176f1d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/hyperion/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/hyperion/default_layers.asset @@ -1,3 +1 @@ -local colorLayersPath = "./layers/colorlayers" - -- @TODO: when we have a working texture, add it here diff --git a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset index 0a0d1725a1..7a1d445e7e 100644 --- a/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset +++ b/data/assets/scene/solarsystem/planets/saturn/hyperion/hyperion.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 -asset.require('./trail') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Saturn Labels", diff --git a/data/assets/scene/solarsystem/planets/saturn/hyperion/trail.asset b/data/assets/scene/solarsystem/planets/saturn/hyperion/trail.asset index a250809874..f6e01eeba9 100644 --- a/data/assets/scene/solarsystem/planets/saturn/hyperion/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/hyperion/trail.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/default_layers.asset index 9371e07f55..b2ae09d769 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/iapetus_texture") +local colorLayer = asset.require("./layers/colorlayers/iapetus_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset index 877924ef15..01f9b702cf 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/iapetus.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 -asset.require('./trail') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Saturn Labels", diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset index 750821d999..d00aef94cd 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/layers/colorlayers/iapetus_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../iapetus").Iapetus.Identifier +local globeIdentifier = asset.require("../../iapetus").Iapetus.Identifier local texturesPath = asset.syncedResource({ Name = "Iapetus textures", diff --git a/data/assets/scene/solarsystem/planets/saturn/iapetus/trail.asset b/data/assets/scene/solarsystem/planets/saturn/iapetus/trail.asset index d1c2c2218c..011dbcd41f 100644 --- a/data/assets/scene/solarsystem/planets/saturn/iapetus/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/iapetus/trail.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/kernels.asset b/data/assets/scene/solarsystem/planets/saturn/kernels.asset index 06eec38e3a..f709f8f8b0 100644 --- a/data/assets/scene/solarsystem/planets/saturn/kernels.asset +++ b/data/assets/scene/solarsystem/planets/saturn/kernels.asset @@ -5,10 +5,10 @@ local Kernels = asset.syncedResource({ Version = 1 }) -asset.export("sat319", Kernels .. 'sat319.bsp') -asset.export("sat368", Kernels .. 'sat368.bsp') -asset.export("sat375", Kernels .. 'sat375.bsp') -asset.export("sat393", Kernels .. 'sat393.bsp') +asset.export("sat319", Kernels .. "sat319.bsp") +asset.export("sat368", Kernels .. "sat368.bsp") +asset.export("sat375", Kernels .. "sat375.bsp") +asset.export("sat393", Kernels .. "sat393.bsp") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset b/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset index 66a345c47e..11c2f39bf9 100644 --- a/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/layers/colorlayers/saturn_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../saturn").Saturn.Identifier +local globeIdentifier = asset.require("../../saturn").Saturn.Identifier local texturesPath = asset.syncedResource({ Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/planets/saturn/major_moons.asset b/data/assets/scene/solarsystem/planets/saturn/major_moons.asset index 96b524dfe6..a17bdf389e 100644 --- a/data/assets/scene/solarsystem/planets/saturn/major_moons.asset +++ b/data/assets/scene/solarsystem/planets/saturn/major_moons.asset @@ -1,12 +1,12 @@ -asset.require('./dione/dione') -asset.require('./enceladus/enceladus') -asset.require('./hyperion/hyperion') -asset.require('./iapetus/iapetus') -asset.require('./mimas/mimas') -asset.require('./rhea/rhea') -asset.require('./tethys/tethys') -asset.require('./titan/titan') -asset.require('./titan/atmosphere') +asset.require("./dione/dione") +asset.require("./enceladus/enceladus") +asset.require("./hyperion/hyperion") +asset.require("./iapetus/iapetus") +asset.require("./mimas/mimas") +asset.require("./rhea/rhea") +asset.require("./tethys/tethys") +asset.require("./titan/titan") +asset.require("./titan/atmosphere") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/default_layers.asset index 8e4aca890e..67a2d8b367 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/mimas_texture") +local colorLayer = asset.require("./layers/colorlayers/mimas_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset index 257393d372..bef66be274 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/layers/colorlayers/mimas_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../mimas").Mimas.Identifier +local globeIdentifier = asset.require("../../mimas").Mimas.Identifier local texturesPath = asset.syncedResource({ Name = "Mimas textures", diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset index 18d1c667ed..4a4948f555 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/mimas.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 -asset.require('./trail') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Saturn Labels", diff --git a/data/assets/scene/solarsystem/planets/saturn/mimas/trail.asset b/data/assets/scene/solarsystem/planets/saturn/mimas/trail.asset index 0322f99b11..29da5054d7 100644 --- a/data/assets/scene/solarsystem/planets/saturn/mimas/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/mimas/trail.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/minor/gallic_group.asset b/data/assets/scene/solarsystem/planets/saturn/minor/gallic_group.asset index f67d555de2..fd6a6a6167 100644 --- a/data/assets/scene/solarsystem/planets/saturn/minor/gallic_group.asset +++ b/data/assets/scene/solarsystem/planets/saturn/minor/gallic_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').sat368 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").sat368 diff --git a/data/assets/scene/solarsystem/planets/saturn/minor/inuit_group.asset b/data/assets/scene/solarsystem/planets/saturn/minor/inuit_group.asset index ecdf1b457a..41226b427f 100644 --- a/data/assets/scene/solarsystem/planets/saturn/minor/inuit_group.asset +++ b/data/assets/scene/solarsystem/planets/saturn/minor/inuit_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernel = asset.require('../kernels').sat368 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernel = asset.require("../kernels").sat368 diff --git a/data/assets/scene/solarsystem/planets/saturn/minor/norse_group.asset b/data/assets/scene/solarsystem/planets/saturn/minor/norse_group.asset index 4eb04bb6cc..60d77e82c4 100644 --- a/data/assets/scene/solarsystem/planets/saturn/minor/norse_group.asset +++ b/data/assets/scene/solarsystem/planets/saturn/minor/norse_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernels = asset.require('../kernels') +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernels = asset.require("../kernels") local kernel368 = kernels.sat368 local kernel375 = kernels.sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/minor/other_group.asset b/data/assets/scene/solarsystem/planets/saturn/minor/other_group.asset index 1f7654e236..aa0d78963f 100644 --- a/data/assets/scene/solarsystem/planets/saturn/minor/other_group.asset +++ b/data/assets/scene/solarsystem/planets/saturn/minor/other_group.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('../transforms') -local kernels = asset.require('../kernels') +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("../transforms") +local kernels = asset.require("../kernels") local kernel375 = kernels.sat375 local kernel393 = kernels.sat393 diff --git a/data/assets/scene/solarsystem/planets/saturn/minor_moons.asset b/data/assets/scene/solarsystem/planets/saturn/minor_moons.asset index d3a7048f7f..6fdc8071f4 100644 --- a/data/assets/scene/solarsystem/planets/saturn/minor_moons.asset +++ b/data/assets/scene/solarsystem/planets/saturn/minor_moons.asset @@ -1,7 +1,7 @@ -asset.require('./minor/gallic_group') -asset.require('./minor/inuit_group') -asset.require('./minor/norse_group') -asset.require('./minor/other_group') +asset.require("./minor/gallic_group") +asset.require("./minor/inuit_group") +asset.require("./minor/norse_group") +asset.require("./minor/other_group") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/default_layers.asset index 3c169d1383..8d99012f73 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/rhea_texture") +local colorLayer = asset.require("./layers/colorlayers/rhea_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset index c23808c37d..a75b2eeee6 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/layers/colorlayers/rhea_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../rhea").Rhea.Identifier +local globeIdentifier = asset.require("../../rhea").Rhea.Identifier local texturesPath = asset.syncedResource({ Name = "Rhea textures", diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset index 080cb0e086..7c3de45932 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/rhea.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 -asset.require('./trail') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Saturn Labels", diff --git a/data/assets/scene/solarsystem/planets/saturn/rhea/trail.asset b/data/assets/scene/solarsystem/planets/saturn/rhea/trail.asset index e26cc0d02b..179dc82360 100644 --- a/data/assets/scene/solarsystem/planets/saturn/rhea/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/rhea/trail.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index 201afdbec8..666a9a161e 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('./transforms') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./transforms") +local assetHelper = asset.require("util/asset_helper") asset.require("spice/base") -asset.require('./trail') +asset.require("./trail") local texturesPath = asset.syncedResource({ Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/default_layers.asset index 18d406031c..8098061f28 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/tethys_texture") +local colorLayer = asset.require("./layers/colorlayers/tethys_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset index 6fa25627ca..c7fbe1969c 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/layers/colorlayers/tethys_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../tethys").Tethys.Identifier +local globeIdentifier = asset.require("../../tethys").Tethys.Identifier local texturesPath = asset.syncedResource({ Name = "Tethys textures", diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset index 0e70c9ccf4..eefbcd4ba5 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/tethys.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 -asset.require('./trail') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Saturn Labels", diff --git a/data/assets/scene/solarsystem/planets/saturn/tethys/trail.asset b/data/assets/scene/solarsystem/planets/saturn/tethys/trail.asset index 6a82617fae..730dbda0fa 100644 --- a/data/assets/scene/solarsystem/planets/saturn/tethys/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/tethys/trail.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/atmosphere.asset b/data/assets/scene/solarsystem/planets/saturn/titan/atmosphere.asset index c6387d927d..1c186daa01 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/atmosphere.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/atmosphere.asset @@ -1,5 +1,5 @@ -local transforms = asset.require('./titan') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./titan") +local assetHelper = asset.require("util/asset_helper") local Atmosphere = { Identifier = "TitanAtmosphere", diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/titan/default_layers.asset index faae518b07..ac35370d9d 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/cassini_iss_global_mosaic_4km_local") +local colorLayer = asset.require("./layers/colorlayers/cassini_iss_global_mosaic_4km_local") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_liu.asset b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_liu.asset index 759b74073f..87862587b8 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_liu.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_liu.asset @@ -1,10 +1,9 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../titan").Titan.Identifier +local globeIdentifier = asset.require("../../titan").Titan.Identifier local layer = { Identifier = "Cassini_ISS_Global_Mosaic_4km_LiU", Name = "Cassini ISS Global Mosaic [Sweden]", - FilePath = mapServiceConfigs .. "/LiU/ISS_P19658_Mosaic_Global_4km.wms", + FilePath = asset.localResource("../../map_service_configs/LiU/ISS_P19658_Mosaic_Global_4km.wms"), Description = [[ This global digital map of Saturn's moon Titan was created using images taken by the Cassini spacecraft's Imaging Science Subsystem (ISS). The map was produced in June 2015 using data collected through Cassini's flyby on April 7, diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset index 22afab24a1..91e0c5a587 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_local.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../titan").Titan.Identifier +local globeIdentifier = asset.require("../../titan").Titan.Identifier local texturesPath = asset.syncedResource({ Type = "HttpSynchronization", diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset index 0eaa1f8101..b407affe83 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/titan.asset @@ -1,7 +1,7 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 -asset.require('./trail') +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Saturn Labels", diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/trail.asset b/data/assets/scene/solarsystem/planets/saturn/titan/trail.asset index a05d56cd22..7b4c0177b8 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/titan/trail.asset @@ -1,6 +1,6 @@ -local transforms = asset.require('../transforms') -local assetHelper = asset.require('util/asset_helper') -local kernel = asset.require('../kernels').sat375 +local transforms = asset.require("../transforms") +local assetHelper = asset.require("util/asset_helper") +local kernel = asset.require("../kernels").sat375 diff --git a/data/assets/scene/solarsystem/planets/saturn/trail.asset b/data/assets/scene/solarsystem/planets/saturn/trail.asset index d2f09c1362..5dcb752284 100644 --- a/data/assets/scene/solarsystem/planets/saturn/trail.asset +++ b/data/assets/scene/solarsystem/planets/saturn/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") diff --git a/data/assets/scene/solarsystem/planets/saturn/trail_earth.asset b/data/assets/scene/solarsystem/planets/saturn/trail_earth.asset index 545e2e277b..def9f62137 100644 --- a/data/assets/scene/solarsystem/planets/saturn/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/saturn/trail_earth.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/saturn/transforms.asset b/data/assets/scene/solarsystem/planets/saturn/transforms.asset index 066c700e44..4c1a939748 100644 --- a/data/assets/scene/solarsystem/planets/saturn/transforms.asset +++ b/data/assets/scene/solarsystem/planets/saturn/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") local SaturnBarycenter = { diff --git a/data/assets/scene/solarsystem/planets/uranus/default_layers.asset b/data/assets/scene/solarsystem/planets/uranus/default_layers.asset index 54ebcc8a44..3c5ccd63cc 100644 --- a/data/assets/scene/solarsystem/planets/uranus/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/uranus/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/uranus_texture") +local colorLayer = asset.require("./layers/colorlayers/uranus_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/uranus/inner_moons.asset b/data/assets/scene/solarsystem/planets/uranus/inner_moons.asset index 54ff39f0cb..2ff105a6a0 100644 --- a/data/assets/scene/solarsystem/planets/uranus/inner_moons.asset +++ b/data/assets/scene/solarsystem/planets/uranus/inner_moons.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('./transforms') -local kernel = asset.require('./kernels').ura091 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("./transforms") +local kernel = asset.require("./kernels").ura091 diff --git a/data/assets/scene/solarsystem/planets/uranus/irregular_prograde_moons.asset b/data/assets/scene/solarsystem/planets/uranus/irregular_prograde_moons.asset index 97b359c59a..579a77e5e4 100644 --- a/data/assets/scene/solarsystem/planets/uranus/irregular_prograde_moons.asset +++ b/data/assets/scene/solarsystem/planets/uranus/irregular_prograde_moons.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('./transforms') -local kernel = asset.require('./kernels').ura112 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("./transforms") +local kernel = asset.require("./kernels").ura112 diff --git a/data/assets/scene/solarsystem/planets/uranus/irregular_retrograde_moons.asset b/data/assets/scene/solarsystem/planets/uranus/irregular_retrograde_moons.asset index c0d7b8efd9..e2029da442 100644 --- a/data/assets/scene/solarsystem/planets/uranus/irregular_retrograde_moons.asset +++ b/data/assets/scene/solarsystem/planets/uranus/irregular_retrograde_moons.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('./transforms') -local kernel = asset.require('./kernels').ura112 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("./transforms") +local kernel = asset.require("./kernels").ura112 diff --git a/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset b/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset index 711bda11df..7efd9eb3cd 100644 --- a/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset +++ b/data/assets/scene/solarsystem/planets/uranus/layers/colorlayers/uranus_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../uranus").Uranus.Identifier +local globeIdentifier = asset.require("../../uranus").Uranus.Identifier local texturesPath = asset.syncedResource({ Name = "Uranus Textures", diff --git a/data/assets/scene/solarsystem/planets/uranus/major_moons.asset b/data/assets/scene/solarsystem/planets/uranus/major_moons.asset index a854ebb27a..d33e073d68 100644 --- a/data/assets/scene/solarsystem/planets/uranus/major_moons.asset +++ b/data/assets/scene/solarsystem/planets/uranus/major_moons.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local proceduralGlobes = asset.require('util/procedural_globe') -local transforms = asset.require('./transforms') -local kernel = asset.require('./kernels').ura111 +local assetHelper = asset.require("util/asset_helper") +local proceduralGlobes = asset.require("util/procedural_globe") +local transforms = asset.require("./transforms") +local kernel = asset.require("./kernels").ura111 diff --git a/data/assets/scene/solarsystem/planets/uranus/minor_moons.asset b/data/assets/scene/solarsystem/planets/uranus/minor_moons.asset index cc69445a21..040c318cdb 100644 --- a/data/assets/scene/solarsystem/planets/uranus/minor_moons.asset +++ b/data/assets/scene/solarsystem/planets/uranus/minor_moons.asset @@ -1,6 +1,6 @@ -asset.require('./inner_moons') -asset.require('./irregular_prograde_moons') -asset.require('./irregular_retrograde_moons') +asset.require("./inner_moons") +asset.require("./irregular_prograde_moons") +asset.require("./irregular_retrograde_moons") asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/uranus/trail.asset b/data/assets/scene/solarsystem/planets/uranus/trail.asset index ad24d25221..6c21fde33f 100644 --- a/data/assets/scene/solarsystem/planets/uranus/trail.asset +++ b/data/assets/scene/solarsystem/planets/uranus/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") diff --git a/data/assets/scene/solarsystem/planets/uranus/trail_earth.asset b/data/assets/scene/solarsystem/planets/uranus/trail_earth.asset index a680c5e429..60eed096e0 100644 --- a/data/assets/scene/solarsystem/planets/uranus/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/uranus/trail_earth.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/uranus/transforms.asset b/data/assets/scene/solarsystem/planets/uranus/transforms.asset index a377192913..0cdd92f642 100644 --- a/data/assets/scene/solarsystem/planets/uranus/transforms.asset +++ b/data/assets/scene/solarsystem/planets/uranus/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/uranus/uranus.asset b/data/assets/scene/solarsystem/planets/uranus/uranus.asset index e8dadd8be4..6e065fd4e2 100644 --- a/data/assets/scene/solarsystem/planets/uranus/uranus.asset +++ b/data/assets/scene/solarsystem/planets/uranus/uranus.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") asset.require("spice/base") -asset.require('./trail') +asset.require("./trail") local Uranus = { Identifier = "Uranus", diff --git a/data/assets/scene/solarsystem/planets/venus/atmosphere.asset b/data/assets/scene/solarsystem/planets/venus/atmosphere.asset index 7e39382692..4e6f7515fe 100644 --- a/data/assets/scene/solarsystem/planets/venus/atmosphere.asset +++ b/data/assets/scene/solarsystem/planets/venus/atmosphere.asset @@ -1,5 +1,5 @@ -local transforms = asset.require('./venus') -local assetHelper = asset.require('util/asset_helper') +local transforms = asset.require("./venus") +local assetHelper = asset.require("util/asset_helper") diff --git a/data/assets/scene/solarsystem/planets/venus/default_layers.asset b/data/assets/scene/solarsystem/planets/venus/default_layers.asset index ba24b5e01b..17240b0f34 100644 --- a/data/assets/scene/solarsystem/planets/venus/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/venus/default_layers.asset @@ -1,12 +1,9 @@ -local colorLayersPath = "./layers/colorlayers" -local heightLayersPath = "./layers/heightlayers" - -- Color layers -asset.require(colorLayersPath .. "/venus_texture") -local colorLayer = asset.require(colorLayersPath .. "/magellan_mosaic_utah") +asset.require("./layers/colorlayers/venus_texture") +local colorLayer = asset.require("./layers/colorlayers/magellan_mosaic_utah") -- Height layers -local heightLayer = asset.require(heightLayersPath .. "/magellan") +local heightLayer = asset.require("./layers/heightlayers/magellan") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.asset b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.asset index d600ff6ec3..43c6bd27c7 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.asset +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.asset @@ -1,5 +1,4 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../venus").Venus.Identifier +local globeIdentifier = asset.require("../../venus").Venus.Identifier local layer = { Identifier = "Magellan_Mosaic_Utah", @@ -20,7 +19,7 @@ local layer = { the radar system was sending signals to the left of the spacecraft. The SAR operated in this left-looking mode during cycles 1 and 3 of the mission. (Description from USGS)]], - FilePath = mapServiceConfigs .. "/Utah/MagellanMosaic.vrt", + FilePath = asset.localResource("../../map_service_configs/Utah/MagellanMosaic.vrt"), BlendMode = "Color", Settings = { Gamma = 2.0 diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset index c02915438e..8aee32e12e 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/venus_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../venus").Venus.Identifier +local globeIdentifier = asset.require("../../venus").Venus.Identifier local texturesPath = asset.syncedResource({ Name = "Venus Textures", diff --git a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan.asset b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan.asset index f94cb916ab..3ee4e55a3d 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan.asset +++ b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan.asset @@ -1,5 +1,4 @@ -local mapServiceConfigs = asset.localResource("./../../map_service_configs") -local globeIdentifier = asset.require("./../../venus").Venus.Identifier +local globeIdentifier = asset.require("../../venus").Venus.Identifier local layer = { Identifier = "Magellan", @@ -14,7 +13,7 @@ local layer = { the in-plane elements of each spacecraft orbit, and then originally re-sampled into sinusoidal, Mercator, and north and south polar stereographic projections at a resolution of 5 kilometers per pixel (4641 meters per pixel [m]).]], - FilePath = mapServiceConfigs .. "/Utah/MagellanDEM.wms", + FilePath = asset.localResource("../../map_service_configs/Utah/MagellanDEM.wms"), TilePixelSize = 64, Settings = { Gamma = 1.72, diff --git a/data/assets/scene/solarsystem/planets/venus/trail.asset b/data/assets/scene/solarsystem/planets/venus/trail.asset index 5d0ad9fc1e..db8a8f09b5 100644 --- a/data/assets/scene/solarsystem/planets/venus/trail.asset +++ b/data/assets/scene/solarsystem/planets/venus/trail.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/venus/trail_earth.asset b/data/assets/scene/solarsystem/planets/venus/trail_earth.asset index 79e78aa2bb..62133e5af9 100644 --- a/data/assets/scene/solarsystem/planets/venus/trail_earth.asset +++ b/data/assets/scene/solarsystem/planets/venus/trail_earth.asset @@ -1,6 +1,6 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') -local earthTransforms = asset.require('scene/solarsystem/planets/earth/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") asset.require("spice/base") diff --git a/data/assets/scene/solarsystem/planets/venus/transforms.asset b/data/assets/scene/solarsystem/planets/venus/transforms.asset index 9ae009af03..9620f615e0 100644 --- a/data/assets/scene/solarsystem/planets/venus/transforms.asset +++ b/data/assets/scene/solarsystem/planets/venus/transforms.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") local VenusBarycenter = { diff --git a/data/assets/scene/solarsystem/planets/venus/venus.asset b/data/assets/scene/solarsystem/planets/venus/venus.asset index 6dea626664..1a3acd055b 100644 --- a/data/assets/scene/solarsystem/planets/venus/venus.asset +++ b/data/assets/scene/solarsystem/planets/venus/venus.asset @@ -1,7 +1,7 @@ -local assetHelper = asset.require('util/asset_helper') -local transforms = asset.require('./transforms') +local assetHelper = asset.require("util/asset_helper") +local transforms = asset.require("./transforms") asset.require("spice/base") -asset.require('./trail') +asset.require("./trail") local labelsPath = asset.syncedResource({ Name = "Venus Labels", diff --git a/data/assets/scene/solarsystem/sssb/amor_asteroid.asset b/data/assets/scene/solarsystem/sssb/amor_asteroid.asset index 1829752752..ff4e89334c 100644 --- a/data/assets/scene/solarsystem/sssb/amor_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/amor_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'amor_asteroid', - 'sssb_data_amor_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_amor_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "amor_asteroid", +"sssb_data_amor_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_amor_asteroid.csv", "Amor Asteroids", filepath, { 1.0, 1.0, 1.0 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 4 diff --git a/data/assets/scene/solarsystem/sssb/apollo_asteroid.asset b/data/assets/scene/solarsystem/sssb/apollo_asteroid.asset index 65507b67da..667bfb0d30 100644 --- a/data/assets/scene/solarsystem/sssb/apollo_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/apollo_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'apollo_asteroid', - 'sssb_data_apollo_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_apollo_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "apollo_asteroid", + "sssb_data_apollo_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_apollo_asteroid.csv", "Apollo Asteroids", filepath, { 0.7, 0.7, 1.0 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 6 diff --git a/data/assets/scene/solarsystem/sssb/astraea.asset b/data/assets/scene/solarsystem/sssb/astraea.asset index 1f9a5ccc15..87ed46a177 100644 --- a/data/assets/scene/solarsystem/sssb/astraea.asset +++ b/data/assets/scene/solarsystem/sssb/astraea.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local trajectory = asset.syncedResource({ Name = "5 Astraea Trajectory", diff --git a/data/assets/scene/solarsystem/sssb/aten_asteroid.asset b/data/assets/scene/solarsystem/sssb/aten_asteroid.asset index 9f86dffb54..63c1f2dc2d 100644 --- a/data/assets/scene/solarsystem/sssb/aten_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/aten_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'aten_asteroid', - 'sssb_data_aten_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_aten_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "aten_asteroid", + "sssb_data_aten_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_aten_asteroid.csv", "Aten Asteroids", filepath, { 0.15, 0.15, 1.0 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 2 diff --git a/data/assets/scene/solarsystem/sssb/atira_asteroid.asset b/data/assets/scene/solarsystem/sssb/atira_asteroid.asset index b89f2a2658..b16b13266a 100644 --- a/data/assets/scene/solarsystem/sssb/atira_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/atira_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'atira_asteroid', - 'sssb_data_atira_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_atira_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "atira_asteroid", + "sssb_data_atira_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_atira_asteroid.csv", "Atira Asteroids", filepath, { 0.5, 0.8, 1.0 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 2 diff --git a/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset b/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset index 58307832c8..49c06b661f 100644 --- a/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset +++ b/data/assets/scene/solarsystem/sssb/c2019y4atlas.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local orbit = asset.syncedResource({ Name = "Comet C/2019 Y4 ATLAS", @@ -42,7 +42,7 @@ local C2019Y4AtlasPosition = { GUI = { Name = "C/2019 Y4 Atlas", Path = "/Solar System/Comets", - Description = 'This is the position for C/2019 Y4 Atlas' + Description = "This is the position for C/2019 Y4 Atlas" } } @@ -55,7 +55,7 @@ asset.meta = { Name = "C/2019 Y4 Atlas", Version = "1.0", Description = [[ This asset contains the trail and position of C/2019 Y4 Atlas from - 1950 JAN 01 00:00:00 to 2100 JAN 01 00:00:00. Data from JPL Horizons']], + 1950 JAN 01 00:00:00 to 2100 JAN 01 00:00:00. Data from JPL Horizons]], Author = "OpenSpace Team", URL = "https://ssd.jpl.nasa.gov/horizons.cgi", License = "NASA", diff --git a/data/assets/scene/solarsystem/sssb/centaur_asteroid.asset b/data/assets/scene/solarsystem/sssb/centaur_asteroid.asset index 6d0e5a39b2..1fd58d3029 100644 --- a/data/assets/scene/solarsystem/sssb/centaur_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/centaur_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'centaur_asteroid', - 'sssb_data_centaur_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_centaur_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "centaur_asteroid", + "sssb_data_centaur_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_centaur_asteroid.csv", "Centaur Asteroids", filepath, { 0.94, 0.96, 0.94 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 6 diff --git a/data/assets/scene/solarsystem/sssb/chiron-type_comet.asset b/data/assets/scene/solarsystem/sssb/chiron-type_comet.asset index 315abef89b..c5fa1d6cd6 100644 --- a/data/assets/scene/solarsystem/sssb/chiron-type_comet.asset +++ b/data/assets/scene/solarsystem/sssb/chiron-type_comet.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'chiron-type_comet', - 'sssb_data_chiron-type_comet') -local object = sharedSssb.createSssbGroupObject('sssb_data_chiron-type_comet.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "chiron-type_comet", + "sssb_data_chiron-type_comet") +local object = sharedSssb.createSssbGroupObject("sssb_data_chiron-type_comet.csv", "Chiron-type Comets", filepath, { 0.15 ,0.1 ,1.0 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 10 diff --git a/data/assets/scene/solarsystem/sssb/encke-type_comet.asset b/data/assets/scene/solarsystem/sssb/encke-type_comet.asset index f07d3a39ab..2dfea14d39 100644 --- a/data/assets/scene/solarsystem/sssb/encke-type_comet.asset +++ b/data/assets/scene/solarsystem/sssb/encke-type_comet.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'encke-type_comet', - 'sssb_data_encke-type_comet') -local object = sharedSssb.createSssbGroupObject('sssb_data_encke-type_comet.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "encke-type_comet", + "sssb_data_encke-type_comet") +local object = sharedSssb.createSssbGroupObject("sssb_data_encke-type_comet.csv", "Encke-type Comets", filepath, { 0.8, 0.34, 1.0 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 2 diff --git a/data/assets/scene/solarsystem/sssb/halley-type_comet.asset b/data/assets/scene/solarsystem/sssb/halley-type_comet.asset index b0d0131d77..bf3cd4537f 100644 --- a/data/assets/scene/solarsystem/sssb/halley-type_comet.asset +++ b/data/assets/scene/solarsystem/sssb/halley-type_comet.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'halley-type_comet', - 'sssb_data_halley-type_comet') -local object = sharedSssb.createSssbGroupObject('sssb_data_halley-type_comet.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "halley-type_comet", + "sssb_data_halley-type_comet") +local object = sharedSssb.createSssbGroupObject("sssb_data_halley-type_comet.csv", "Halley-type Comets", filepath, { 0.66, 0.66, 0.66 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 9 diff --git a/data/assets/scene/solarsystem/sssb/inner_main_belt_asteroid.asset b/data/assets/scene/solarsystem/sssb/inner_main_belt_asteroid.asset index 1c43e1f631..d07fa4ab13 100644 --- a/data/assets/scene/solarsystem/sssb/inner_main_belt_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/inner_main_belt_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'inner_main_belt_asteroid', - 'sssb_data_inner_main_belt_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_inner_main_belt_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "inner_main_belt_asteroid", + "sssb_data_inner_main_belt_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_inner_main_belt_asteroid.csv", "Inner Main Asteroid Belt", filepath, { 1.0, 1.0, 0.0 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 1 diff --git a/data/assets/scene/solarsystem/sssb/jupiter-family_comet.asset b/data/assets/scene/solarsystem/sssb/jupiter-family_comet.asset index 91f4226222..82ed1f5901 100644 --- a/data/assets/scene/solarsystem/sssb/jupiter-family_comet.asset +++ b/data/assets/scene/solarsystem/sssb/jupiter-family_comet.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'jupiter-family_comet', - 'sssb_data_jupiter-family_comet') -local object = sharedSssb.createSssbGroupObject('sssb_data_jupiter-family_comet.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "jupiter-family_comet", + "sssb_data_jupiter-family_comet") +local object = sharedSssb.createSssbGroupObject("sssb_data_jupiter-family_comet.csv", "Jupiter-family Comets", filepath, { 0.2, 0.8, 0.2 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 10 diff --git a/data/assets/scene/solarsystem/sssb/jupiter_trojan_asteroid.asset b/data/assets/scene/solarsystem/sssb/jupiter_trojan_asteroid.asset index 0389c0338d..6e3e344b6b 100644 --- a/data/assets/scene/solarsystem/sssb/jupiter_trojan_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/jupiter_trojan_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'jupiter_trojan_asteroid', - 'sssb_data_jupiter_trojan_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_jupiter_trojan_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "jupiter_trojan_asteroid", + "sssb_data_jupiter_trojan_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_jupiter_trojan_asteroid.csv", "Jupiter Trojan Asteroids", filepath, { 0.5, 0.8, 0.5 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 1 diff --git a/data/assets/scene/solarsystem/sssb/main_belt_asteroid.asset b/data/assets/scene/solarsystem/sssb/main_belt_asteroid.asset index 7634f0ca92..77ca6d32be 100644 --- a/data/assets/scene/solarsystem/sssb/main_belt_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/main_belt_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'main_belt_asteroid', - 'sssb_data_main_belt_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_main_belt_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "main_belt_asteroid", + "sssb_data_main_belt_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_main_belt_asteroid.csv", "Main Asteroid Belt", filepath, { 0.0, 0.5, 0.0 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 1 diff --git a/data/assets/scene/solarsystem/sssb/mars-crossing_asteroid.asset b/data/assets/scene/solarsystem/sssb/mars-crossing_asteroid.asset index f731c32ab2..5be63fdf52 100644 --- a/data/assets/scene/solarsystem/sssb/mars-crossing_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/mars-crossing_asteroid.asset @@ -1,9 +1,9 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'mars-crossing_asteroid', - 'sssb_data_mars-crossing_asteroid') -local object = sharedSssb.createSssbGroupObject('sssb_data_mars-crossing_asteroid.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "mars-crossing_asteroid", + "sssb_data_mars-crossing_asteroid") +local object = sharedSssb.createSssbGroupObject("sssb_data_mars-crossing_asteroid.csv", "Mars-crossing Asteroids", filepath, { 0.814, 0.305, 0.220 }) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 1 diff --git a/data/assets/scene/solarsystem/sssb/outer_main_belt_asteroid.asset b/data/assets/scene/solarsystem/sssb/outer_main_belt_asteroid.asset index 6c01440fd6..0c3b16a9c4 100644 --- a/data/assets/scene/solarsystem/sssb/outer_main_belt_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/outer_main_belt_asteroid.asset @@ -1,13 +1,13 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") local filepath = sharedSssb.downloadSssbDatabaseFile( asset, - 'outer_main_belt_asteroid', - 'sssb_data_outer_main_belt_asteroid' + "outer_main_belt_asteroid", + "sssb_data_outer_main_belt_asteroid" ) local object = sharedSssb.createSssbGroupObject( - 'sssb_data_outer_main_belt_asteroid.csv', + "sssb_data_outer_main_belt_asteroid.csv", "Outer Main Asteroid Belt", filepath, { 0.4, 0.4, 1.0 } diff --git a/data/assets/scene/solarsystem/sssb/pha.asset b/data/assets/scene/solarsystem/sssb/pha.asset index 04ce9a44e2..e80295a478 100644 --- a/data/assets/scene/solarsystem/sssb/pha.asset +++ b/data/assets/scene/solarsystem/sssb/pha.asset @@ -1,11 +1,11 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") -local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'pha', 'sssb_data_pha') -local object = sharedSssb.createSssbGroupObject('sssb_data_pha.csv', +local filepath = sharedSssb.downloadSssbDatabaseFile(asset, "pha", "sssb_data_pha") +local object = sharedSssb.createSssbGroupObject("sssb_data_pha.csv", "Potentially Hazardous Asteroids", filepath, - { 0.98, 0.09, 0.06} + { 0.98, 0.09, 0.06 } ) object.Renderable.Enabled = false object.Renderable.SegmentQuality = 3 diff --git a/data/assets/scene/solarsystem/sssb/sssb_shared.asset b/data/assets/scene/solarsystem/sssb/sssb_shared.asset index c3b1d07ecf..c8770fb413 100644 --- a/data/assets/scene/solarsystem/sssb/sssb_shared.asset +++ b/data/assets/scene/solarsystem/sssb/sssb_shared.asset @@ -1,4 +1,4 @@ -local transforms = asset.require('scene/solarsystem/sun/transforms') +local transforms = asset.require("scene/solarsystem/sun/transforms") function downloadSssbDatabaseFile(sceneAsset, name, identifier) assert(sceneAsset, "'asset' needs to be provided") @@ -20,7 +20,7 @@ local createSssbGroupObject = function(filename, guiName, sssbFolder, trailColor local filenameSansExt = filename:gsub(filename:match("(%.%w+)$"), "") return { - Identifier = 'sssb_'..filenameSansExt, + Identifier = "sssb_" .. filenameSansExt, Parent = transforms.SunECLIPJ2000.Identifier, Renderable = { Type = "RenderableSmallBody", diff --git a/data/assets/scene/solarsystem/sssb/swifttuttle.asset b/data/assets/scene/solarsystem/sssb/swifttuttle.asset index 469e71f551..bcad498a16 100644 --- a/data/assets/scene/solarsystem/sssb/swifttuttle.asset +++ b/data/assets/scene/solarsystem/sssb/swifttuttle.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local sync = asset.syncedResource({ Name = "Swift Tuttle Orbit", diff --git a/data/assets/scene/solarsystem/sssb/tesla_roadster.asset b/data/assets/scene/solarsystem/sssb/tesla_roadster.asset index 7627d71b56..fc1e71735a 100644 --- a/data/assets/scene/solarsystem/sssb/tesla_roadster.asset +++ b/data/assets/scene/solarsystem/sssb/tesla_roadster.asset @@ -1,5 +1,5 @@ -local assetHelper = asset.require('util/asset_helper') -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") local orbit = asset.syncedResource({ Name = "Tesla Roadster Orbit", diff --git a/data/assets/scene/solarsystem/sssb/transneptunian_object_asteroid.asset b/data/assets/scene/solarsystem/sssb/transneptunian_object_asteroid.asset index dd8252f2d4..312c4ee154 100644 --- a/data/assets/scene/solarsystem/sssb/transneptunian_object_asteroid.asset +++ b/data/assets/scene/solarsystem/sssb/transneptunian_object_asteroid.asset @@ -1,12 +1,12 @@ -local assetHelper = asset.require('util/asset_helper') -local sharedSssb = asset.require('./sssb_shared') +local assetHelper = asset.require("util/asset_helper") +local sharedSssb = asset.require("./sssb_shared") local filepath = sharedSssb.downloadSssbDatabaseFile(asset, - 'transneptunian_object_asteroid', - 'sssb_data_transneptunian_object_asteroid' + "transneptunian_object_asteroid", + "sssb_data_transneptunian_object_asteroid" ) local object = sharedSssb.createSssbGroupObject( - 'sssb_data_transneptunian_object_asteroid.csv', + "sssb_data_transneptunian_object_asteroid.csv", "Transneptunian Object Asteroids", filepath, { 0.56, 0.64, 0.95 } diff --git a/data/assets/scene/solarsystem/sun.asset b/data/assets/scene/solarsystem/sun.asset index 0d0b462d84..0b1286c347 100644 --- a/data/assets/scene/solarsystem/sun.asset +++ b/data/assets/scene/solarsystem/sun.asset @@ -1,2 +1,2 @@ -asset.require('./sun/sun') -asset.require('./sun/glare') +asset.require("./sun/sun") +asset.require("./sun/glare") diff --git a/data/assets/scene/solarsystem/sun/EUV_layer.asset b/data/assets/scene/solarsystem/sun/EUV_layer.asset index 92a7e3abb4..7a7e617a41 100644 --- a/data/assets/scene/solarsystem/sun/EUV_layer.asset +++ b/data/assets/scene/solarsystem/sun/EUV_layer.asset @@ -1,6 +1,6 @@ asset.require("spice/base") local assetHelper = asset.require("util/asset_helper") -local propertyHelper = asset.require('util/property_helper') +local propertyHelper = asset.require("util/property_helper") local transforms = asset.require("./transforms") local textureSourcePath = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/sun/default_layers.asset b/data/assets/scene/solarsystem/sun/default_layers.asset index 5d0718e902..44fd7a1f3c 100644 --- a/data/assets/scene/solarsystem/sun/default_layers.asset +++ b/data/assets/scene/solarsystem/sun/default_layers.asset @@ -1,6 +1,4 @@ -local colorLayersPath = "./layers/colorlayers" - -local colorLayer = asset.require(colorLayersPath .. "/sun_texture") +local colorLayer = asset.require("./layers/colorlayers/sun_texture") -- Set enabled layers (temporary solution) -- @TODO: do this using a boolean that's passed to the 'asset.require' instead diff --git a/data/assets/scene/solarsystem/sun/habitablezone.asset b/data/assets/scene/solarsystem/sun/habitablezone.asset index 7c64aa0241..6726c3667c 100644 --- a/data/assets/scene/solarsystem/sun/habitablezone.asset +++ b/data/assets/scene/solarsystem/sun/habitablezone.asset @@ -1,6 +1,6 @@ local assetHelper = asset.require("util/asset_helper") local transforms = asset.require("./transforms") -local textures = asset.require('scene/milkyway/habitable_zones/habitable_zone_textures').TexturesPath +local textures = asset.require("scene/milkyway/habitable_zones/habitable_zone_textures").TexturesPath local HabitableZone = { Identifier = "SunHabitableZone", @@ -8,7 +8,7 @@ local HabitableZone = { Renderable = { Type = "RenderableHabitableZone", Enabled = false, - Texture = textures .. "/hot_to_cold_faded.png", + Texture = textures .. "hot_to_cold_faded.png", EffectiveTemperature = 5780, -- Kelvin Luminosity = 1, -- solar Opacity = 0.1, diff --git a/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset b/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset index 4aab850afe..2ce7e12487 100644 --- a/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset +++ b/data/assets/scene/solarsystem/sun/layers/colorlayers/sun_texture.asset @@ -1,4 +1,4 @@ -local globeIdentifier = asset.require("./../../sun").Sun.Identifier +local globeIdentifier = asset.require("../../sun").Sun.Identifier local texturesPath = asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/sun/transforms_heliosphere.asset b/data/assets/scene/solarsystem/sun/transforms_heliosphere.asset index 7262083c83..9478e20141 100644 --- a/data/assets/scene/solarsystem/sun/transforms_heliosphere.asset +++ b/data/assets/scene/solarsystem/sun/transforms_heliosphere.asset @@ -1,5 +1,5 @@ local assetHelper = asset.require("util/asset_helper") -local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +local sunTransforms = asset.require("scene/solarsystem/sun/transforms") asset.require("spice/base") local HEEQ180Kernel = asset.localResource("./kernels/HEEQ180.tf") diff --git a/data/assets/util/add_marker.asset b/data/assets/util/add_marker.asset index 527c776c25..2185749fe9 100644 --- a/data/assets/util/add_marker.asset +++ b/data/assets/util/add_marker.asset @@ -10,10 +10,10 @@ asset.onInitialize(function() Identifier = "target-marker", Name = "Target Marker", Type = "ScreenSpaceImageLocal", - TexturePath = icons .. 'target.png' + TexturePath = icons .. "target.png" }) end) asset.onDeinitialize(function() - openspace.removeScreenSpaceRenderable('target-marker'); + openspace.removeScreenSpaceRenderable("target-marker") end) diff --git a/data/assets/util/asset_helper.asset b/data/assets/util/asset_helper.asset index 840f845b13..51fc00b2e8 100644 --- a/data/assets/util/asset_helper.asset +++ b/data/assets/util/asset_helper.asset @@ -115,14 +115,14 @@ end local requireAll = function (sceneAsset, directory) function string.ends(String,End) - return End=='' or string.sub(String,-string.len(End))==End + return End == "" or string.sub(String,-string.len(End))==End end local result = {} - local files = openspace.walkDirectoryFiles(sceneAsset.localResource('') .. directory, true) + local files = openspace.walkDirectoryFiles(sceneAsset.localResource("") .. directory, true) for _, file in pairs(files) do - if file:ends('.asset') then + if file:ends(".asset") then openspace.printDebug("Requiring: " .. file:sub(file:find(directory), -7)) local exports = sceneAsset.require(file:sub(1, -7)) table.insert(result, exports) diff --git a/data/assets/util/default_keybindings.asset b/data/assets/util/default_keybindings.asset index e7e771417d..711c188662 100644 --- a/data/assets/util/default_keybindings.asset +++ b/data/assets/util/default_keybindings.asset @@ -1,9 +1,9 @@ -local propertyHelper = asset.require('./property_helper') +local propertyHelper = asset.require("./property_helper") local toggle_native_ui = { Identifier = "os_default.toggle_native_ui", Name = "Show Native GUI", - Command = propertyHelper.invert('Modules.ImGUI.Main.Enabled'), + Command = propertyHelper.invert("Modules.ImGUI.Main.Enabled"), Documentation = "Shows or hides the native UI", GuiPath = "/Native GUI", IsLocal = true, @@ -57,7 +57,7 @@ local toggle_pause_immediate = { local toggle_rotation_friction = { Identifier = "os_default.toggle_rotation_friction", Name = "Toggle Rotation friction", - Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'), + 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", IsLocal = false, @@ -68,7 +68,7 @@ local toggle_rotation_friction = { local toggle_zoom_friction = { Identifier = "os_default.toggle_zoom_friction", Name = "Toggle Zoom Friction", - Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'), + Command = propertyHelper.invert("NavigationHandler.OrbitalNavigator.Friction.ZoomFriction"), Documentation = "Toggles the zoom friction of the camera. If it is disabled, the camera rises up from or closes in towards the focus object indefinitely.", GuiPath = "/Navigation", IsLocal = false, @@ -79,7 +79,7 @@ local toggle_zoom_friction = { local toggle_roll_friction = { Identifier = "os_default.toggle_roll_friction", Name = "Toggle Roll Friction", - Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'), + Command = propertyHelper.invert("NavigationHandler.OrbitalNavigator.Friction.RollFriction"), Documentation = "Toggles the roll friction of the camera. If it is disabled, the camera rolls around its own axis indefinitely.", GuiPath = "/Navigation", IsLocal = false, @@ -90,7 +90,13 @@ local toggle_roll_friction = { local fade_to_black = { Identifier = "os_default.fade_to_black", Name = "Fade to/from black", - Command = "if openspace.getPropertyValue('RenderEngine.BlackoutFactor') > 0.5 then openspace.setPropertyValueSingle('RenderEngine.BlackoutFactor', 0.0, 3) else openspace.setPropertyValueSingle('RenderEngine.BlackoutFactor', 1.0, 3) end", + Command = [[ + if openspace.getPropertyValue("RenderEngine.BlackoutFactor") > 0.5 then + openspace.setPropertyValueSingle("RenderEngine.BlackoutFactor", 0.0, 3) + else + openspace.setPropertyValueSingle("RenderEngine.BlackoutFactor", 1.0, 3) + end + ]], Documentation = "Toggles the fade to black within 3 seconds or shows the rendering after 3 seconds.", GuiPath = "/Rendering", IsLocal = false, @@ -101,7 +107,7 @@ local fade_to_black = { local toggle_main_gui = { Identifier = "os_default.toggle_main_gui", Name = "Toggle main GUI", - Command = propertyHelper.invert('Modules.CefWebGui.Visible'), + Command = propertyHelper.invert("Modules.CefWebGui.Visible"), Documentation = "Toggles the main GUI", GuiPath = "/GUI", IsLocal = true, @@ -113,8 +119,8 @@ local toggle_overlays = { Identifier = "os_default.toggle_overlays", Name = "Toggle dashboard and overlays", Command = -[[local isEnabled = openspace.getPropertyValue('Dashboard.IsEnabled'); -openspace.setPropertyValueSingle('Dashboard.IsEnabled', not isEnabled); +[[local isEnabled = openspace.getPropertyValue("Dashboard.IsEnabled"); +openspace.setPropertyValueSingle("Dashboard.IsEnabled", not isEnabled); openspace.setPropertyValueSingle("RenderEngine.ShowLog", not isEnabled); openspace.setPropertyValueSingle("RenderEngine.ShowVersion", not isEnabled); openspace.setPropertyValueSingle("RenderEngine.ShowCamera", not isEnabled)]], @@ -128,7 +134,7 @@ openspace.setPropertyValueSingle("RenderEngine.ShowCamera", not isEnabled)]], local toggle_master_rendering = { Identifier = "os_default.toggle_master_rendering", Name = "Toggle rendering on master", - Command = propertyHelper.invert('RenderEngine.DisableMasterRendering'), + Command = propertyHelper.invert("RenderEngine.DisableMasterRendering"), Documentation = "Toggles the rendering on master", GuiPath = "/Rendering", IsLocal = true, diff --git a/data/assets/util/generate_bookmarks.asset b/data/assets/util/generate_bookmarks.asset index 8736ef7d11..17f4fb7dca 100644 --- a/data/assets/util/generate_bookmarks.asset +++ b/data/assets/util/generate_bookmarks.asset @@ -1,4 +1,4 @@ -local assetHelper = asset.require('util/asset_helper') +local assetHelper = asset.require("util/asset_helper") local getBookmarks = function (guiPath, bookmarkfile) local genBookmarks = {}; @@ -6,21 +6,21 @@ local getBookmarks = function (guiPath, bookmarkfile) local PARSEC_CONSTANT = 3.0856776E16; for line in io.lines(openspace.absPath(bookmarkfile)) do if (notFirstLine) then - local matchstring = '(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)$' + local matchstring = "(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)$" local group, name, globe, lat, lon, altitude, x, y, z, scale, linewidth = line:match(matchstring) - scale = (scale == '' and 75000 or scale) - linewidth = (linewidth == '' and 2.0 or tonumber(linewidth)) - group = (group == '' and globe or group) + scale = (scale == "" and 75000 or scale) + linewidth = (linewidth == "" and 2.0 or tonumber(linewidth)) + group = (group == "" and globe or group) - local parent = (globe == '' and 'Root' or globe) + local parent = (globe == "" and "Root" or globe) local sgn = { - Identifier = guiPath .. '-' .. name, + Identifier = guiPath .. "-" .. name, Parent = parent, Transform = { Scale = { - Type = 'StaticScale', + Type = "StaticScale", Scale = tonumber(scale); }, Rotation = { @@ -33,7 +33,7 @@ local getBookmarks = function (guiPath, bookmarkfile) } }, Renderable = { - Type = 'RenderableSphericalGrid', + Type = "RenderableSphericalGrid", Enabled = false, Opacity = 0.3, Color = { 0.3, 0.84, 1.0}, @@ -41,17 +41,17 @@ local getBookmarks = function (guiPath, bookmarkfile) }, GUI = { Name = name, - Path = '/' .. guiPath + Path = "/" .. guiPath } } - if (group ~= '') then - sgn.GUI.Path = sgn.GUI.Path .. '/' .. group + if (group ~= "") then + sgn.GUI.Path = sgn.GUI.Path .. "/" .. group end - if (globe == '') then + if (globe == "") then sgn.Transform.Translation = { - Type = 'StaticTranslation', + Type = "StaticTranslation", Position = { tonumber(x) * PARSEC_CONSTANT, tonumber(y) * PARSEC_CONSTANT, @@ -60,7 +60,7 @@ local getBookmarks = function (guiPath, bookmarkfile) } else sgn.Transform.Translation = { - Type = 'GlobeTranslation', + Type = "GlobeTranslation", Globe = globe, Latitude = tonumber(lat), Longitude = tonumber(lon) @@ -81,4 +81,4 @@ local getBookmarks = function (guiPath, bookmarkfile) return genBookmarks end -asset.export('getBookmarks', getBookmarks) +asset.export("getBookmarks", getBookmarks) diff --git a/data/assets/util/ipac.asset b/data/assets/util/ipac.asset index 223fbf47f9..34d9d79272 100644 --- a/data/assets/util/ipac.asset +++ b/data/assets/util/ipac.asset @@ -13,6 +13,18 @@ asset.onInitialize(function() openspace.bindKey("ALT+UP", "openspace.navigation.addTruckMovement(0.0, 5.0)"); openspace.bindKey("ALT+DOWN", "openspace.navigation.addTruckMovement(0.0, -5.0)"); - openspace.bindKey("SPACE", "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Moon');openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);") - openspace.bindKey("Z", "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);") + openspace.bindKey( + "SPACE", + [[ + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", ""); + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Moon"); + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil) + ]]) + openspace.bindKey( + "Z", + [[ + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", ""); + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Earth"); + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil) + ]]) end) diff --git a/data/assets/util/joysticks/ps4.asset b/data/assets/util/joysticks/ps4.asset index 6fc628911f..829661f96a 100644 --- a/data/assets/util/joysticks/ps4.asset +++ b/data/assets/util/joysticks/ps4.asset @@ -1,5 +1,5 @@ -local propertyHelper = asset.require('../property_helper') -local joystickHelper = asset.require('./joystick_helper') +local propertyHelper = asset.require("../property_helper") +local joystickHelper = asset.require("./joystick_helper") -- Allowed values for the third parameter of bindJoystickAxis: -- "None" @@ -96,36 +96,40 @@ asset.onInitialize(function() openspace.navigation.bindJoystickButton( name, controller.Cross, - propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'), + propertyHelper.invert("NavigationHandler.OrbitalNavigator.Friction.ZoomFriction"), "Toggle zoom friction" ) openspace.navigation.bindJoystickButton( name, controller.Circle, - propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'), + propertyHelper.invert("NavigationHandler.OrbitalNavigator.Friction.RotationalFriction"), "Toggle rotational friction" ) openspace.navigation.bindJoystickButton( name, controller.DPad.Left, - propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'), + propertyHelper.invert("NavigationHandler.OrbitalNavigator.Friction.RollFriction"), "Toggle roll friction" ) openspace.navigation.bindJoystickButton( name, controller.Square, - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" .. - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');" .. - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);", + [[ + "openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", ""); + "openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Earth"); + "openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil); + ]], "Switch target to Earth" ) openspace.navigation.bindJoystickButton( name, controller.Triangle, - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" .. - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Mars');" .. - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);", + [[ + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", ""); + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Mars"); + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil); + ]], "Switch target to Mars" ) end) diff --git a/data/assets/util/joysticks/space-mouse-not-sticky.asset b/data/assets/util/joysticks/space-mouse-not-sticky.asset index d185635e68..cea4fb0681 100644 --- a/data/assets/util/joysticks/space-mouse-not-sticky.asset +++ b/data/assets/util/joysticks/space-mouse-not-sticky.asset @@ -1,5 +1,5 @@ -local propertyHelper = asset.require('../property_helper') -local joystickHelper = asset.require('./joystick_helper') +local propertyHelper = asset.require("../property_helper") +local joystickHelper = asset.require("./joystick_helper") -- Allowed values for the third parameter of bindJoystickAxis: -- "None" diff --git a/data/assets/util/joysticks/space-mouse.asset b/data/assets/util/joysticks/space-mouse.asset index afc55055b6..3d36804891 100644 --- a/data/assets/util/joysticks/space-mouse.asset +++ b/data/assets/util/joysticks/space-mouse.asset @@ -1,5 +1,5 @@ -local propertyHelper = asset.require('../property_helper') -local joystickHelper = asset.require('./joystick_helper') +local propertyHelper = asset.require("../property_helper") +local joystickHelper = asset.require("./joystick_helper") -- Allowed values for the third parameter of bindJoystickAxis: -- "None" diff --git a/data/assets/util/joysticks/xbox.asset b/data/assets/util/joysticks/xbox.asset index 7659c3969b..c94449ba68 100644 --- a/data/assets/util/joysticks/xbox.asset +++ b/data/assets/util/joysticks/xbox.asset @@ -1,5 +1,5 @@ -local propertyHelper = asset.require('../property_helper') -local joystickHelper = asset.require('./joystick_helper') +local propertyHelper = asset.require("../property_helper") +local joystickHelper = asset.require("./joystick_helper") -- Allowed values for the third parameter of bindJoystickAxis: -- "None" @@ -94,36 +94,40 @@ asset.onInitialize(function() openspace.navigation.bindJoystickButton( name, controller.A, - propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'), + propertyHelper.invert("NavigationHandler.OrbitalNavigator.Friction.ZoomFriction"), "Toggle zoom friction" ) openspace.navigation.bindJoystickButton( name, controller.B, - propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'), + propertyHelper.invert("NavigationHandler.OrbitalNavigator.Friction.RotationalFriction"), "Toggle rotational friction" ) openspace.navigation.bindJoystickButton( name, controller.DPad.Left, - propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'), + propertyHelper.invert("NavigationHandler.OrbitalNavigator.Friction.RollFriction"), "Toggle roll friction" ) openspace.navigation.bindJoystickButton( name, controller.X, - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" .. - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');" .. - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);", + [[ + "openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", ""); + "openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Earth"); + "openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil); + ]], "Switch target to Earth" ) openspace.navigation.bindJoystickButton( name, controller.Y, - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" .. - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Mars');" .. - "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);", + [[ + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", ""); + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", "Mars"); + openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil); + ]], "Switch target to Mars" ) end) diff --git a/data/assets/util/lua_state_machine_helper.asset b/data/assets/util/lua_state_machine_helper.asset index 45369d01fb..eeca3748c5 100644 --- a/data/assets/util/lua_state_machine_helper.asset +++ b/data/assets/util/lua_state_machine_helper.asset @@ -58,4 +58,4 @@ local createStateMachine = function (states) return machine end -asset.export('createStateMachine', createStateMachine) +asset.export("createStateMachine", createStateMachine) diff --git a/data/assets/util/procedural_globe.asset b/data/assets/util/procedural_globe.asset index 282ffccf1f..b673a368bb 100644 --- a/data/assets/util/procedural_globe.asset +++ b/data/assets/util/procedural_globe.asset @@ -1,4 +1,4 @@ -asset.require('spice/base') +asset.require("spice/base") local createGlobeWithoutName = function(identifier, parent, parentSpiceName, spiceName, radii, tags, trailTags, guiPath, trailColor, orbitPeriod, kernels) diff --git a/data/assets/util/property_helper.asset b/data/assets/util/property_helper.asset index 0c13e098de..89d6a6f7d2 100644 --- a/data/assets/util/property_helper.asset +++ b/data/assets/util/property_helper.asset @@ -1,13 +1,13 @@ -- Function that returns the string that inverts the fully qualified boolean property 'property' local invert = function(prop) - local escaped_property = "'" .. prop .. "'" + local escaped_property = [["]] .. prop .. [["]] return "openspace.setPropertyValueSingle(" .. escaped_property .. ", not openspace.getPropertyValue(" .. escaped_property .. "));" end -- Function that returns the string that increments the 'property' by the 'value' local increment = function(prop, value) local v = value or 1 - local escaped_property = "'" .. prop .. "'" + local escaped_property = [["]] .. prop .. [["]] return "openspace.setPropertyValueSingle(" .. escaped_property .. ", openspace.getPropertyValue(" .. escaped_property .. ") + " .. v .. ");" end @@ -20,7 +20,7 @@ local fade = function(prop, value, duration) assert(type(prop) == "string", "prop must be a number") assert(type(duration) == "number", "duration must be a number") - local escaped_property = "'" .. prop .. "'" + local escaped_property = [["]] .. prop .. [["]] return "openspace.setPropertyValueSingle(" .. escaped_property ..", " .. tostring(value) .. ", " .. tostring(duration) .. ")" end @@ -36,15 +36,15 @@ local fadeInOut = function(prop, duration) assert(type(prop) == "string", "prop must be a number") assert(type(duration) == "number", "duration must be a number") - local escaped_property = "'" .. prop .. "'" + local escaped_property = [["]] .. prop .. [["]] -- If the value is > 0.5 fade out, otherwise fade in return "local v = openspace.getPropertyValue(" .. escaped_property .. "); if v <= 0.5 then " .. fadeIn(prop, duration) .. " else " .. fadeOut(prop, duration) .. " end" end -asset.export('invert', invert) -asset.export('increment', increment) -asset.export('decrement', decrement) -asset.export('fade', fade) -asset.export('fadeIn', fadeIn) -asset.export('fadeOut', fadeOut) -asset.export('fadeInOut', fadeInOut) +asset.export("invert", invert) +asset.export("increment", increment) +asset.export("decrement", decrement) +asset.export("fade", fade) +asset.export("fadeIn", fadeIn) +asset.export("fadeOut", fadeOut) +asset.export("fadeInOut", fadeInOut) diff --git a/data/assets/util/renderable_helper.asset b/data/assets/util/renderable_helper.asset index 90e04e9c7f..987d790768 100644 --- a/data/assets/util/renderable_helper.asset +++ b/data/assets/util/renderable_helper.asset @@ -1,4 +1,4 @@ -local propertyHelper = asset.require('./property_helper') +local propertyHelper = asset.require("./property_helper") -- Function that returns the string that enables/disables the renderable 'renderable' local toggle = function(renderable) @@ -7,9 +7,9 @@ end -- Function that returns the string that sets the enabled property of to local setEnabled = function(renderable, enabled) - return "openspace.setPropertyValue('" .. renderable .. ".Renderable.Enabled', " .. (enabled and "true" or "false") .. ");"; + return [[openspace.setPropertyValue("]] .. renderable .. [[.Renderable.Enabled", ]] .. (enabled and "true" or "false") .. ");"; end -asset.export('toggle', toggle) -asset.export('setEnabled', setEnabled) +asset.export("toggle", toggle) +asset.export("setEnabled", setEnabled) diff --git a/data/assets/util/script_scheduler_helper.asset b/data/assets/util/script_scheduler_helper.asset index e3740daac3..129732ab43 100644 --- a/data/assets/util/script_scheduler_helper.asset +++ b/data/assets/util/script_scheduler_helper.asset @@ -1,4 +1,4 @@ -local renderableHelper = asset.require('./renderable_helper') +local renderableHelper = asset.require("./renderable_helper") -- Function that schedules scripts setting the enabled property -- of to at time