Merge branch 'master' into feature/profiles

This commit is contained in:
GPayne
2020-05-14 19:31:19 -06:00
146 changed files with 2966 additions and 2511 deletions

View File

@@ -1,4 +1,4 @@
## How to contribute
The easiest way to contribute is through a separate fork of the repository and submitting a pull-request. One of the core developers will judge the pull request and integrate it into the main `master` branch. Preferably, there is an accompanying issue (created by you or not) which is solved by the PR. In this case, feel free to use the phrase "(closes #XXX)" in the text of the pull request, where `XXX` is the number of the issue that you have solved. The PR should be in its own separate branch following the naming `pr/feature`, where `feature` is a short, descripting name of the additional feature or bug contained in the PR.
For more information we refer to the [Wiki](https://github.com/OpenSpace/OpenSpace/wiki). If there are any questions, feel free to contact us via [email](mailto:alexander.bock@me.com?subject=OpenSpace: Contributing).
For more information we refer to the [Wiki](https://openspace.github.io). If there are any questions, feel free to contact us via [email](mailto:mail@alexanderbock.eu?subject=OpenSpace: Contributing).

7
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,7 @@
<< Description of the problem >>
<< What did you expect to happen >>
<< What did happen? >>
<< Attach screenshots, if possible >>

1
.gitignore vendored
View File

@@ -25,6 +25,7 @@ Thumbs.db
# OpenSpace-generated folders and files
/bin/
/cache/
/cache-*/
/cache_gdal/
/documentation/
/logs/

3
ACKNOWLEDGMENTS.md Normal file
View File

@@ -0,0 +1,3 @@
OpenSpace is funded in part by NASA under award No NNX16AB93A. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Aeronautics and Space Administration.
OpenSpace is also funded in part by the Knut & Alice Wallenberg Foundation in Sweden and the Swedish e-Science Research Centre.

View File

@@ -111,42 +111,20 @@ target_compile_definitions(OpenSpace PRIVATE
begin_header("Dependency: SGCT")
set(SGCT_TEXT OFF CACHE BOOL "" FORCE)
set(SGCT_BUILD_CSHARP_PROJECTS OFF CACHE BOOL "" FORCE)
set(SGCT_LIGHT_ONLY ON CACHE BOOL "" FORCE)
set(SGCT_CUSTOMOUTPUTDIRS OFF CACHE BOOL "" FORCE)
set(JPEG_TURBO_WITH_SIMD OFF CACHE BOOL "" FORCE)
set(SGCT_DEP_INCLUDE_FREETYPE OFF CACHE BOOL "" FORCE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct)
target_include_directories(OpenSpace SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct/include)
target_link_libraries(
OpenSpace
sgct_light glew glfw png16_static quat tinyxml2static turbojpeg-static
vrpn ${GLFW_LIBRARIES}
)
target_link_libraries(OpenSpace sgct)
mark_as_advanced(EXECUTABLE_OUTPUT_PATH GLFW_BUILD_DOCS GLFW_BUILD_EXAMPLES
GLFW_BUILD_TESTS GLFW_INSTALL GLFW_USE_HYBRID_HPG GLFW_USE_OSMESA GLFW_VULKAN_STATIC
INSTALL_BIN_DIR INSTALL_INC_DIR INSTALL_LIB_DIR INSTALL_MAN_DIR INSTALL_PKGCONFIG_DIR
IOKIT_LIBRARY JPEG_TURBO_FORCE32bit JPEG_TURBO_WITH_12BIT JPEG_TURBO_WITH_ARITH_DEC
JPEG_TURBO_WITH_ARITH_ENC JPEG_TURBO_WITH_JPEG7 JPEG_TURBO_WITH_JPEG8
JPEG_TURBO_WITH_MEM_SRCDST JPEG_TURBO_WITH_SIMD JPEG_TURBO_WITH_TURBOJPEG LIB_SUFFIX
LIBRARY_OUTPUT_PATH M_LIBRARY SGCT_BUILD_ALUT SGCT_BUILD_CSHARP_PROJECTS
SGCT_CUSTOMOUTPUTDIRS SGCT_DOXYGEN SGCT_DOXYGEN_QUIET SGCT_EXAMPLES SGCT_INSTALL
SGCT_LIGHT_ONLY SGCT_NO_EXTERNAL_LIBRARIES SGCT_SPOUT_SUPPORT SGCT_TEXT
SGCT_USE_MSVC_RUNTIMES USE_MSVC_RUNTIME_LIBRARY_DLL
)
set_folder_location(sgct_light "External")
set_folder_location(glew "External/SGCT")
set_folder_location(sgct "External")
set_folder_location(glfw "External/SGCT")
set_folder_location(miniziplibstatic "External/SGCT")
set_folder_location(png16_static "External/SGCT")
set_folder_location(quat "External/SGCT")
set_folder_location(simd "External/SGCT")
set_folder_location(tinyxml2static "External/SGCT")
set_folder_location(turbojpeg-static "External/SGCT")
set_folder_location(vrpn "External/SGCT")
set_folder_location(zlibstatic "External/SGCT")
set_folder_location(miniziplibstatic "External/SGCT")
if (UNIX AND (NOT APPLE))
target_link_libraries(OpenSpace Xcursor Xinerama X11)

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,24 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="true" numberOfSamples="4" name="OpenSpace">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="true" numberOfSamples="4" name="OpenSpace">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,33 +1,33 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="true" monitor="1" name="OpenSpace">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" border="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="true" monitor="1" name="OpenSpace">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" border="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1920" y="1080" />
<Pos x="0" y="0" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,23 +1,23 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- Res is equal to the Recommend target size -->
<Size x="1332" y="840" />
<Res x="3024" y="1680" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Projectionplane>
<!-- Lower left -->
<Pos x="-1.7156" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-1.7156" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="1.7156" y="0.965" z="0.0" />
</Projectionplane>
</Viewport>
</Window>
</Node>
<Node address="localhost" port="20401">
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- Res is equal to the Recommend target size -->
<Size x="1332" y="840" />
<Res x="3024" y="1680" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Projectionplane>
<!-- Lower left -->
<Pos x="-1.7156" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-1.7156" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="1.7156" y="0.965" z="0.0" />
</Projectionplane>
</Viewport>
</Window>
</Node>
</Cluster>

View File

@@ -1,23 +1,23 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- Res is equal to the Recommend target size -->
<Size x="1332" y="793" />
<Res x="2664" y="1586" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Projectionplane>
<!-- Lower left -->
<Pos x="-1.7156" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-1.7156" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="1.7156" y="0.965" z="0.0" />
</Projectionplane>
</Viewport>
</Window>
</Node>
<Node address="localhost" port="20401">
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- Res is equal to the Recommend target size -->
<Size x="1332" y="793" />
<Res x="2664" y="1586" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Projectionplane>
<!-- Lower left -->
<Pos x="-1.7156" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-1.7156" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="1.7156" y="0.965" z="0.0" />
</Projectionplane>
</Viewport>
</Window>
</Node>
</Cluster>

View File

@@ -1,24 +1,24 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,37 +1,37 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<!-- <Scene>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene> -->
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<!-- 16:9 aspect ratio -->
<Size x="1024" y="1024" />
<!-- Frame buffer resolution
<Res x="4096" y="4096" /> -->
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<Viewport name="fisheye">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene> -->
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<!-- 16:9 aspect ratio -->
<Size x="1024" y="1024" />
<!-- Frame buffer resolution
<Res x="4096" y="4096" /> -->
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<Viewport name="fisheye">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,53 +1,53 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<!-- <Scene>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene> -->
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<!-- 16:9 aspect ratio -->
<Size x="1024" y="1024" />
<!-- Frame buffer resolution
<Res x="4096" y="4096" /> -->
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<Viewport name="fisheye">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
<Window fullScreen="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1024" y="1024" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene> -->
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<!-- 16:9 aspect ratio -->
<Size x="1024" y="1024" />
<!-- Frame buffer resolution
<Res x="4096" y="4096" /> -->
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<Viewport name="fisheye">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
<Window fullScreen="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1024" y="1024" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,33 +1,33 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,30 +1,30 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window fullScreen="false">
<Stereo type="none" />
<Pos x="200" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="360" />
<Viewport eye="left">
<Pos x="0.0" y="0.0" />
<Size x="0.5" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
<Viewport eye="right">
<Pos x="0.5" y="0.0" />
<Size x="0.5" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
<Node address="localhost" port="20401">
<Window fullScreen="false">
<Stereo type="none" />
<Pos x="200" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="360" />
<Viewport eye="left">
<Pos x="0.0" y="0.0" />
<Size x="0.5" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
<Viewport eye="right">
<Pos x="0.5" y="0.0" />
<Size x="0.5" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,32 +1,32 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false" border="true">
<Pos x="10" y="100" />
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" border="true">
<Pos x="340" y="100" />
<Size x="1280" y="720" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false" border="true">
<Pos x="10" y="100" />
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" border="true">
<Pos x="340" y="100" />
<Size x="1280" y="720" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Cluster>

View File

@@ -1,34 +1,34 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node ip="127.0.0.1" port="20401">
<Window fullscreen="false" name="Spherical Projection">
<Stereo type="none" />
<Pos x="0" y="100" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Res x="2048" y="2048" />
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<!-- mesh path is relative to working directory-->
<!-- NOTE, if no working directory is set, mesh must be absolute path -->
<Viewport name="warped fisheye" mesh="config/mesh/standard_16x9.data">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="2k" tilt="30.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
<Node address="127.0.0.1" port="20401">
<Window fullscreen="false" name="Spherical Projection">
<Stereo type="none" />
<Pos x="0" y="100" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Res x="2048" y="2048" />
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<!-- mesh path is relative to working directory-->
<!-- NOTE, if no working directory is set, mesh must be absolute path -->
<Viewport name="warped fisheye" mesh="config/mesh/standard_16x9.data">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="2k" tilt="30.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node ip="127.0.0.1" port="20401">
<Node address="127.0.0.1" port="20401">
<Window fullscreen="false" name="Spherical Projection">
<Stereo type="none" />
<Pos x="0" y="100" />
@@ -27,7 +27,7 @@
</FisheyeProjection>
</Viewport>
</Window>
<Window fullScreen="false" name="GUI" tags="GUI">
<Window fullscreen="false" name="GUI" tags="GUI">
<Stereo type="none" />
<Size x="1280" y="720" />
<Res x="2048" y="2048" />

View File

@@ -1,29 +1,19 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<!-- <Settings>
<Display swapInterval="0" />
</Settings>
-->
<!-- <Scene>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene>
-->
<Node address="localhost" port="20401">
<Window fullScreen="false" name="OpenSpace">
<Stereo type="none" />
<Size x="1024" y="1024" />
<Viewport name="Spout">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<SpoutOutputProjection quality="1.5k">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</SpoutOutputProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
<Node address="localhost" port="20401">
<Window fullscreen="false" name="OpenSpace">
<Stereo type="none" />
<Size x="1024" y="1024" />
<Viewport name="Spout">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<SpoutOutputProjection quality="1.5k">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</SpoutOutputProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>

View File

@@ -1,41 +1,36 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false">
<Pos x="0" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.2" port="20402">
<Window fullScreen="false">
<Pos x="640" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
<Node address="127.0.0.1" port="20401">
<Window fullscreen="false">
<Pos x="0" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.2" port="20402">
<Window fullscreen="false">
<Pos x="640" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="1280" y="720" />
<Viewport tracked="true">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Cluster>
<!--
Usage:
for master: <executable> -local 0
for slave: <executable> -local 1 --slave
-->

View File

@@ -0,0 +1,34 @@
asset.require('./base')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.require('scene/solarsystem/sssb/amor_asteroid')
asset.require('scene/solarsystem/sssb/apollo_asteroid')
asset.require('scene/solarsystem/sssb/aten_asteroid')
asset.require('scene/solarsystem/sssb/atira_asteroid')
asset.require('scene/solarsystem/sssb/centaur_asteroid')
asset.require('scene/solarsystem/sssb/chiron-type_comet')
asset.require('scene/solarsystem/sssb/encke-type_comet')
asset.require('scene/solarsystem/sssb/halley-type_comet')
asset.require('scene/solarsystem/sssb/inner_main_belt_asteroid')
asset.require('scene/solarsystem/sssb/jupiter_trojan_asteroid')
asset.require('scene/solarsystem/sssb/jupiter-family_comet')
asset.require('scene/solarsystem/sssb/main_belt_asteroid')
asset.require('scene/solarsystem/sssb/mars-crossing_asteroid')
asset.require('scene/solarsystem/sssb/outer_main_belt_asteroid')
asset.require('scene/solarsystem/sssb/transneptunian_object_asteroid')
asset.require('scene/solarsystem/sssb/pha')
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()
-- Jump back one day to be able to show complete weather data on Earth.
openspace.time.setTime(openspace.time.advancedTime(now, "-1d"))
openspace.globebrowsing.goToGeo("Earth", 58.5877, 16.1924, 2.7e12)
openspace.markInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
end)
asset.onDeinitialize(function ()
openspace.removeInterestingNodes({ "Earth", "Mars", "Moon", "Sun" })
end)

View File

@@ -2,7 +2,6 @@ asset.require('./base')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.require('scene/solarsystem/planets/earth/satellites/satellites.asset')
asset.require('scene/solarsystem/sssb/pha')
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()

View File

@@ -1 +1 @@
asset.request('./satellites_interesting')
asset.require('./satellites_interesting')

View File

@@ -1,6 +1,6 @@
asset.request('./misc/brightest')
asset.request('./communications/geostationary')
asset.request('./navigation/gps')
asset.request('./misc/spacestations')
asset.request('./misc/iss')
asset.request('./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')

View File

@@ -0,0 +1,10 @@
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', "Amor Asteroids", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 4
object.Renderable.TrailFade = 11
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Apollo Asteroids", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 6
object.Renderable.TrailFade = 10
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Aten Asteroids", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 2
object.Renderable.TrailFade = 18
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Atira Asteroids", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 2
object.Renderable.TrailFade = 25
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,48 @@
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",
Type = "HttpSynchronization",
Identifier = "horizons_c2019y4atlas",
Version = 1
}) .. "/c2019y4atlas.txt"
local C2019Y4AtlasTrail = {
Identifier = "C2019Y4AtlasTrail",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderableTrailTrajectory",
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = orbit
},
Color = { 0.533333, 0.850980, 0.996078 },
EnableFade = false,
StartTime = "1950 JAN 1 0:00:00",
EndTime = "2100 JAN 1 00:00:00",
SampleInterval = 35000,
TimeStampSubsampleFactor = 1
},
GUI = {
Name = "C2019 Y4 Atlas Trail",
Path = "/Solar System/Comets"
}
}
local C2019Y4AtlasPosition = {
Identifier = "C2019Y4AtlasPosition",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Transform = {
Translation = {
Type = "HorizonsTranslation",
HorizonsTextFile = orbit
},
},
GUI = {
Name = "C 2019 Y4 Atlas",
Path = "/Solar System/Comets"
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {C2019Y4AtlasPosition, C2019Y4AtlasTrail })

View File

@@ -0,0 +1,10 @@
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', "Centaur Asteroids", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 6
object.Renderable.TrailFade = 18
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Chiron-type Comets", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 10
object.Renderable.TrailFade = 25
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Encke-type Comets", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 2
object.Renderable.TrailFade = 23
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Halley-type Comets", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 9
object.Renderable.TrailFade = 18
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Inner Main Asteroid Belt", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 1
object.Renderable.TrailFade = 0.5
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Jupiter-family Comets", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 10
object.Renderable.TrailFade = 28
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Jupiter Trojan Asteroids", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 1
object.Renderable.TrailFade = 5
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,11 @@
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', "Main Asteroid Belt", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 1
object.Renderable.TrailFade = 0.1
object.Renderable.UpperLimit = 50000
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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', "Mars-crossing Asteroids", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 1
object.Renderable.TrailFade = 13
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -0,0 +1,10 @@
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')
local object = sharedSssb.createSssbGroupObject('sssb_data_outer_main_belt_asteroid.csv', "Outer Main Asteroid Belt", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 1
object.Renderable.TrailFade = 2
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -2,7 +2,9 @@ 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", filepath, { 0.75, 0.2, 0.2 })
local object = sharedSssb.createSssbGroupObject('sssb_data_pha.csv', "Potentially Hazardous Asteroids", filepath, { 0.75, 0.2, 0.2 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 3
object.Renderable.TrailFade = 17
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -13,7 +13,7 @@ function downloadSssbDatabaseFile(sceneAsset, name, identifier)
})
end
local createSssbGroupObject = function(filename, sssbFolder, trailColor)
local createSssbGroupObject = function(filename, guiName, sssbFolder, trailColor)
assert(filename, "'filename' needs to be provided")
assert(sssbFolder, "'sssbFolder' needs to be provided")
trailColor = trailColor or { 0.75, 0.1, 0.1 }
@@ -27,10 +27,11 @@ local createSssbGroupObject = function(filename, sssbFolder, trailColor)
Path = sssbFolder.."/"..filename,
Segments = 200,
Color = trailColor,
Fade = 0.5,
TrailFade = 0.5,
},
GUI = {
Path = "/Solar System/Small Solar System Body"
Path = "/Solar System/Small Bodies",
Name = guiName
}
}
end

View File

@@ -0,0 +1,10 @@
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')
local object = sharedSssb.createSssbGroupObject('sssb_data_transneptunian_object_asteroid.csv', "Transneptunian Object Asteroids", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.SegmentQuality = 8
object.Renderable.TrailFade = 10
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -11,7 +11,8 @@ function downloadTLEFile(sceneAsset, url, name, filename)
Name = "Satellite TLE Data (" .. name .. ")",
Type = "UrlSynchronization",
Identifier = "satellite_tle_data_" .. identifier,
Url = url
Url = url,
Override = true
}
if (filename ~= '') then
@@ -81,7 +82,7 @@ function satellites(title, file, color, group)
Renderable = {
Type = "RenderableSatellites",
Path = file,
Segments = 120,
SegmentQuality = 3,
Color = color,
Fade = 1.5
},

View File

@@ -124,7 +124,8 @@ static VersionChecker& versionChecker = detail::gVersionChecker();
static VirtualPropertyManager& virtualPropertyManager = detail::gVirtualPropertyManager();
static WindowDelegate& windowDelegate = detail::gWindowDelegate();
static configuration::Configuration& configuration = detail::gConfiguration();
static interaction::InteractionMonitor& interactionMonitor = detail::gInteractionMonitor();
static interaction::InteractionMonitor& interactionMonitor =
detail::gInteractionMonitor();
static interaction::JoystickInputStates& joystickInputStates =
detail::gJoystickInputStates();
static interaction::WebsocketInputStates& websocketInputStates =

View File

@@ -88,8 +88,8 @@ public:
void touchDetectionCallback(TouchInput input);
void touchUpdateCallback(TouchInput input);
void touchExitCallback(TouchInput input);
std::vector<char> encode();
void decode(std::vector<char> data);
std::vector<std::byte> encode();
void decode(std::vector<std::byte> data);
void scheduleLoadSingleAsset(std::string assetPath);
void toggleShutdownMode();
@@ -125,6 +125,8 @@ private:
bool _hasScheduledAssetLoading = false;
std::string _scheduledAssetPathToLoad;
glm::vec2 _mousePosition;
//grabs json from each module to pass to the documentation engine.
std::string _documentationJson;

View File

@@ -53,13 +53,13 @@ public:
* Encodes all added Syncables in the injected <code>SyncBuffer</code>.
* This method is only called on the SGCT master node
*/
std::vector<char> encodeSyncables();
std::vector<std::byte> encodeSyncables();
/**
* Decodes the <code>SyncBuffer</code> into the added Syncables.
* This method is only called on the SGCT slave nodes
*/
void decodeSyncables(std::vector<char> data);
void decodeSyncables(std::vector<std::byte> data);
/**
* Invokes the presync method of all added Syncables

View File

@@ -40,8 +40,6 @@ struct WindowDelegate {
void (*setSynchronization)(bool enabled) = [](bool) {};
void (*clearAllWindows)(const glm::vec4& clearColor) = [](const glm::vec4&) {};
bool (*windowHasResized)() = []() { return false; };
double (*averageDeltaTime)() = []() { return 0.0; };
@@ -56,52 +54,29 @@ struct WindowDelegate {
double (*applicationTime)() = []() { return 0.0; };
glm::vec2 (*mousePosition)() = []() { return glm::vec2(0.f); };
uint32_t (*mouseButtons)(int maxNumber) = [](int) { return uint32_t(0); };
glm::ivec2 (*currentWindowSize)() = []() { return glm::ivec2(0); };
glm::ivec2 (*currentSubwindowSize)() = []() { return glm::ivec2(0); };
glm::ivec2 (*currentWindowResolution)() = []() { return glm::ivec2(0); };
glm::ivec2 (*currentDrawBufferResolution)() = []() { return glm::ivec2(0); };
glm::ivec2 (*currentViewportSize)() = []() { return glm::ivec2(0); };
glm::vec2 (*dpiScaling)() = []() { return glm::vec2(1.f); };
int (*currentNumberOfAaSamples)() = []() { return 1; };
bool (*hasGuiWindow)() = []() { return false; };
bool (*isGuiWindow)() = []() { return false; };
bool (*isMaster)() = []() { return false; };
int (*clusterId)() = []() { return 0; };
bool (*isUsingSwapGroups)() = []() { return false; };
bool (*isSwapGroupMaster)() = []() { return false; };
glm::mat4 (*viewProjectionMatrix)() = []() { return glm::mat4(1.f); };
bool (*isMaster)() = []() { return true; };
glm::mat4 (*modelMatrix)() = []() { return glm::mat4(1.f); };
void (*setNearFarClippingPlane)(float near, float far) = [](float, float) {};
void (*setEyeSeparationDistance)(float distance) = [](float) {};
glm::ivec4 (*viewportPixelCoordinates)() = []() { return glm::ivec4(0, 0, 0, 0); };
void (*sendMessageToExternalControl)(const std::vector<char>& message) =
[](const std::vector<char>&) {};
bool (*isFisheyeRendering)() = []() { return false; };
unsigned int(*takeScreenshot)(bool applyWarping) = [](bool) { return 0u; };
unsigned int (*takeScreenshot)(bool applyWarping) = [](bool) { return 0u; };
void (*swapBuffer)() = []() {};
@@ -112,9 +87,9 @@ struct WindowDelegate {
double (*getHorizFieldOfView)() = []() { return 0.0; };
void (*setHorizFieldOfView)(float hFovDeg) = [](float) { };
void* (*getNativeWindowHandle)(size_t windowIndex) = [](size_t) -> void* {
return nullptr;
void* (*getNativeWindowHandle)(size_t windowIndex) = [](size_t) -> void* {
return nullptr;
};
using GLProcAddress = void(*)(void);

View File

@@ -34,6 +34,11 @@ public:
MouseCameraStates(double sensitivity, double velocityScaleFactor);
void updateStateFromInput(const InputState& inputState, double deltaTime) override;
void setInvertMouseButton(bool value);
private:
bool _isMouseButtonInverted = false;
};
} // namespace openspace::interaction

View File

@@ -135,7 +135,7 @@ public:
WebsocketCameraStates::AxisInvert::No,
WebsocketCameraStates::AxisNormalize shouldNormalize =
WebsocketCameraStates::AxisNormalize::No);
NavigationState navigationState() const;
NavigationState navigationState(const SceneGraphNode& referenceFrame) const;

View File

@@ -79,10 +79,10 @@ public:
JoystickCameraStates& joystickStates();
const JoystickCameraStates& joystickStates() const;
WebsocketCameraStates& websocketStates();
const WebsocketCameraStates& websocketStates() const;
ScriptCameraStates& scriptStates();
const ScriptCameraStates& scriptStates() const;
@@ -160,6 +160,8 @@ private:
properties::FloatProperty _stereoInterpolationTime;
properties::FloatProperty _followRotationInterpolationTime;
properties::BoolProperty _invertMouseButtons;
MouseCameraStates _mouseStates;
JoystickCameraStates _joystickStates;
WebsocketCameraStates _websocketStates;
@@ -246,19 +248,22 @@ private:
* Translates the horizontal direction. If far from the anchor object, this will
* result in an orbital rotation around the object. This function does not affect the
* rotation but only the position.
* \returns a position vector adjusted in the horizontal direction.
*
* \return a position vector adjusted in the horizontal direction.
*/
glm::dvec3 translateHorizontally(double deltaTime, const glm::dvec3& cameraPosition,
const glm::dvec3& objectPosition, const glm::dquat& globalCameraRotation,
const SurfacePositionHandle& positionHandle) const;
/**
* Moves the camera along a vector, camPosToCenterPosDiff, until it reaches the focusLimit.
* The velocity of the zooming depend on distFromCameraToFocus and the final frame
* where the camera stops moving depends on the distance set in the variable focusLimit.
* The bool determines whether to move/fly towards the focus node or away from it.
* \returns a new position of the camera, closer to the focusLimit than the previous
* position.
* Moves the camera along a vector, camPosToCenterPosDiff, until it reaches the
* focusLimit. The velocity of the zooming depend on distFromCameraToFocus and the
* final frame where the camera stops moving depends on the distance set in the
* variable focusLimit. The bool determines whether to move/fly towards the focus node
* or away from it.
*
* \return a new position of the camera, closer to the focusLimit than the previous
* position
*/
glm::dvec3 moveCameraAlongVector(const glm::dvec3& camPos,
double distFromCameraToFocus, const glm::dvec3& camPosToCenterPosDiff,
@@ -267,14 +272,16 @@ private:
/*
* Adds rotation to the camera position so that it follows the rotation of the anchor
* node defined by the differential anchorNodeRotationDiff.
* \returns a position updated with the rotation defined by anchorNodeRotationDiff
*
* \return a position updated with the rotation defined by anchorNodeRotationDiff
*/
glm::dvec3 followAnchorNodeRotation(const glm::dvec3& cameraPosition,
const glm::dvec3& objectPosition, const glm::dquat& anchorNodeRotationDiff) const;
/**
* Updates the global rotation so that it points towards the anchor node.
* \returns a global rotation quaternion defining a rotation towards the anchor node.
*
* \return a global rotation quaternion defining a rotation towards the anchor node
*/
glm::dquat rotateGlobally(const glm::dquat& globalCameraRotation,
const glm::dquat& aimNodeRotationDiff,
@@ -290,7 +297,8 @@ private:
/**
* Rotates the camera around the out vector of the surface.
* \returns a quaternion adjusted to rotate around the out vector of the surface.
*
* \return a quaternion adjusted to rotate around the out vector of the surface
*/
glm::dquat rotateHorizontally(double deltaTime,
const glm::dquat& globalCameraRotation,
@@ -298,8 +306,9 @@ private:
/**
* Push the camera out to the surface of the object.
* \returns a position vector adjusted to be at least minHeightAboveGround meters
* above the actual surface of the object
*
* \return a position vector adjusted to be at least minHeightAboveGround meters
* above the actual surface of the object
*/
glm::dvec3 pushToSurface(double minHeightAboveGround,
const glm::dvec3& cameraPosition, const glm::dvec3& objectPosition,

View File

@@ -106,7 +106,8 @@ private:
namespace ghoul {
template <>
std::string to_string(const openspace::interaction::WebsocketCameraStates::AxisType& type);
std::string to_string(
const openspace::interaction::WebsocketCameraStates::AxisType& type);
template <>
openspace::interaction::WebsocketCameraStates::AxisType

View File

@@ -84,9 +84,9 @@ constexpr const int MaxWebsockets = 16;
struct WebsocketInputStates : public std::unordered_map<size_t, WebsocketInputState*> {
/**
* This function adds the contributions of all connected websockets for the provided
* \p axis. After adding each websockets contribution, the result is clamped to [-1,1].
* If a websocket does not possess a particular axis, it's does not contribute to the
* sum.
* \p axis. After adding each websockets contribution, the result is clamped to
* [-1,1]. If a websocket does not possess a particular axis, it's does not contribute
* to the sum.
*
* \param axis The numerical axis for which the values are added
* \return The summed axis values of all connected websockets

View File

@@ -80,7 +80,6 @@ public:
void setLightness(float lightness) override;
void setColorSpace(unsigned int colorspace) override;
void enableBloom(bool enable) override;
void enableHistogram(bool enable) override;

View File

@@ -71,17 +71,17 @@ public:
void updateHDRAndFiltering();
void updateFXAA();
void updateDownscaledVolume();
void setResolution(glm::ivec2 res) override;
void setHDRExposure(float hdrExposure) override;
void setGamma(float gamma) override;
void setHue(float hue) override;
void setValue(float value) override;
void setSaturation(float sat) override;
void enableFXAA(bool enable) override;
void setDisableHDR(bool disable) override;
void update() override;
void performRaycasterTasks(const std::vector<RaycasterTask>& tasks);
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks);
@@ -114,7 +114,7 @@ private:
void updateDownscaleTextures();
void updateExitVolumeTextures();
void writeDownscaledVolume();
std::map<VolumeRaycaster*, RaycastData> _raycastData;
RaycasterProgObjMap _exitPrograms;
RaycasterProgObjMap _raycastPrograms;
@@ -131,7 +131,7 @@ private:
UniformCache(hdrFeedingTexture, blackoutFactor, hdrExposure, gamma,
Hue, Saturation, Value) _hdrUniformCache;
UniformCache(renderedTexture, inverseScreenSize) _fxaaUniformCache;
UniformCache(downscaledRenderedVolume, downscaledRenderedVolumeDepth)
UniformCache(downscaledRenderedVolume, downscaledRenderedVolumeDepth)
_writeDownscaledVolumeUniformCache;
GLint _defaultFBO;
@@ -158,7 +158,7 @@ private:
GLuint hdrFilteringFramebuffer;
GLuint hdrFilteringTexture;
} _hdrBuffers;
struct {
GLuint fxaaFramebuffer;
GLuint fxaaTexture;
@@ -176,18 +176,18 @@ private:
bool _dirtyDeferredcastData;
bool _dirtyRaycastData;
bool _dirtyResolution;
glm::ivec2 _resolution = glm::ivec2(0);
int _nAaSamples;
bool _enableFXAA = true;
bool _disableHDR = false;
float _hdrExposure = 3.7f;
float _gamma = 0.95f;
float _hue = 1.f;
float _saturation = 1.f;
float _value = 1.f;
ghoul::Dictionary _rendererData;
};

View File

@@ -211,7 +211,7 @@ private:
properties::BoolProperty _disableMasterRendering;
properties::FloatProperty _globalBlackOutFactor;
properties::BoolProperty _enableFXAA;
properties::BoolProperty _disableHDRPipeline;
@@ -221,13 +221,13 @@ private:
properties::FloatProperty _hue;
properties::FloatProperty _saturation;
properties::FloatProperty _value;
properties::FloatProperty _horizFieldOfView;
properties::Vec3Property _globalRotation;
properties::Vec3Property _screenSpaceRotation;
properties::Vec3Property _masterRotation;
uint64_t _frameNumber = 0;
unsigned int _latestScreenshotNumber = 0;

View File

@@ -139,7 +139,7 @@ public:
private:
/**
* Maximum number of integration steps to be executed by the volume integrator.
* Maximum number of integration steps to be executed by the volume integrator.
*/
int _rayCastMaxSteps = 1000;

View File

@@ -48,8 +48,8 @@ public:
virtual bool initialize();
double scaleValue() const;
virtual double scaleValue(const UpdateData& data) const = 0;
glm::dvec3 scaleValue() const;
virtual glm::dvec3 scaleValue(const UpdateData& data) const = 0;
virtual void update(const UpdateData& data);
static documentation::Documentation Documentation();
@@ -60,7 +60,7 @@ protected:
private:
bool _needsUpdate = true;
double _cachedTime = -std::numeric_limits<double>::max();
double _cachedScale = 1.0;
glm::dvec3 _cachedScale = glm::dvec3(1.0);
};
} // namespace openspace

View File

@@ -122,13 +122,13 @@ public:
glm::dvec3 position() const;
const glm::dmat3& rotationMatrix() const;
double scale() const;
glm::dvec3 scale() const;
glm::dvec3 worldPosition() const;
const glm::dmat3& worldRotationMatrix() const;
glm::dmat4 modelTransform() const;
glm::dmat4 inverseModelTransform() const;
double worldScale() const;
glm::dvec3 worldScale() const;
bool isTimeFrameActive(const Time& time) const;
SceneGraphNode* parent() const;
@@ -152,7 +152,7 @@ public:
private:
glm::dvec3 calculateWorldPosition() const;
glm::dmat3 calculateWorldRotation() const;
double calculateWorldScale() const;
glm::dvec3 calculateWorldScale() const;
void computeScreenSpaceData(RenderData& newData);
std::atomic<State> _state = State::Loaded;
@@ -185,7 +185,7 @@ private:
// Cached transform data
glm::dvec3 _worldPositionCached = glm::dvec3(0.0);
glm::dmat3 _worldRotationCached = glm::dmat3(1.0);
double _worldScaleCached = 1.0;
glm::dvec3 _worldScaleCached = glm::dvec3(1.0);
float _fixedBoundingSphere = 0.f;
@@ -198,7 +198,7 @@ private:
properties::DoubleProperty _distFromCamToNode;
properties::DoubleProperty _screenSizeRadius;
properties::FloatProperty _visibilityDistance;
// This variable is used for the rate-limiting of the screenspace positions (if they
// are calculated when _computeScreenSpaceValues is true)
std::chrono::high_resolution_clock::time_point _lastScreenSpaceUpdateTime;

View File

@@ -57,14 +57,14 @@ public:
//void write();
//void read();
void setData(std::vector<char> data);
std::vector<char> data();
void setData(std::vector<std::byte> data);
std::vector<std::byte> data();
private:
size_t _n;
size_t _encodeOffset = 0;
size_t _decodeOffset = 0;
std::vector<char> _dataStream;
std::vector<std::byte> _dataStream;
};
} // namespace openspace

View File

@@ -32,6 +32,9 @@
namespace openspace {
// The TouchInput represents a single finger/device-input at a specific point in time.
// the fingerId and touchDeviceId coupled with the timestamp allows this to be compared
// with other TouchInputs in order to calculate gesture-like behaviour.
struct TouchInput {
TouchInput(size_t touchDeviceId, size_t fingerId, float x, float y, double timestamp);
glm::vec2 screenCoordinates(glm::vec2 resolution) const;
@@ -46,19 +49,25 @@ struct TouchInput {
float y;
float dx = 0.f; // movement in x direction since last touch input
float dy = 0.f; // movement in y direction since last touch input
double timestamp; // timestamp in seconds from global touch initialization
double timestamp; // timestamp in seconds from global touch initialization
};
// The TouchInputHolder holds one or many TouchInputs, in order to track the history of
// the finger/input device
class TouchInputHolder {
public:
TouchInputHolder(TouchInput input);
// tryAddInput:
// Succeeds upon a different input than last.
// Fails upon a too similar input as last.
// Updates time for the last input if same position.
bool tryAddInput(TouchInput input);
void clearInputs();
// Checks whether or not this Holder actually holds a specific input (based on IDs)
// Succeeds when `input` is held by this Holder
// Fails if `input` is not held by this Holder
bool holdsInput(const TouchInput &input) const;
size_t touchDeviceId() const;
@@ -72,12 +81,14 @@ public:
double gestureTime() const;
size_t numInputs() const;
const TouchInput& firstInput() const;
const TouchInput& latestInput() const;
const std::deque<TouchInput>& peekInputs() const;
private:
//A deque of recorded inputs. Adding newer points to the front of the queue
std::deque<TouchInput> _inputs;
TouchInput _firstInput;
size_t _touchDeviceId;
size_t _fingerId;

View File

@@ -38,7 +38,7 @@ struct InitializeData {};
struct TransformData {
glm::dvec3 translation = glm::dvec3(0.0);
glm::dmat3 rotation = glm::dmat3(1.0);
double scale = 0.0;
glm::dvec3 scale = glm::dvec3(1.0);
};
struct UpdateData {

View File

@@ -62,6 +62,7 @@ set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rotation/luarotation.h
${CMAKE_CURRENT_SOURCE_DIR}/rotation/staticrotation.h
${CMAKE_CURRENT_SOURCE_DIR}/scale/luascale.h
${CMAKE_CURRENT_SOURCE_DIR}/scale/nonuniformstaticscale.h
${CMAKE_CURRENT_SOURCE_DIR}/scale/staticscale.h
${CMAKE_CURRENT_SOURCE_DIR}/scale/timedependentscale.h
${CMAKE_CURRENT_SOURCE_DIR}/timeframe/timeframeinterval.h
@@ -111,6 +112,7 @@ set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rotation/luarotation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rotation/staticrotation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/scale/luascale.cpp
${CMAKE_CURRENT_SOURCE_DIR}/scale/nonuniformstaticscale.cpp
${CMAKE_CURRENT_SOURCE_DIR}/scale/staticscale.cpp
${CMAKE_CURRENT_SOURCE_DIR}/scale/timedependentscale.cpp
${CMAKE_CURRENT_SOURCE_DIR}/timeframe/timeframeinterval.cpp

View File

@@ -59,6 +59,7 @@
#include <modules/base/rotation/staticrotation.h>
#include <modules/base/rotation/timelinerotation.h>
#include <modules/base/scale/luascale.h>
#include <modules/base/scale/nonuniformstaticscale.h>
#include <modules/base/scale/staticscale.h>
#include <modules/base/scale/timedependentscale.h>
#include <modules/base/translation/timelinetranslation.h>
@@ -155,6 +156,7 @@ void BaseModule::internalInitialize(const ghoul::Dictionary&) {
ghoul_assert(fScale, "Scale factory was not created");
fScale->registerClass<LuaScale>("LuaScale");
fScale->registerClass<NonUniformStaticScale>("NonUniformStaticScale");
fScale->registerClass<StaticScale>("StaticScale");
fScale->registerClass<TimeDependentScale>("TimeDependentScale");

View File

@@ -48,7 +48,7 @@
namespace {
constexpr const char* _loggerCat = "base::RenderableLabels";
constexpr const char* MeterUnit = "m";
constexpr const char* KilometerUnit = "Km";
constexpr const char* MegameterUnit = "Mm";
@@ -203,7 +203,7 @@ documentation::Documentation RenderableLabels::Documentation() {
LabelColorInfo.identifier,
new DoubleVector4Verifier,
Optional::Yes,
LabelColorInfo.description,
LabelColorInfo.description,
},
{
LabelColorInfo.identifier,
@@ -392,7 +392,7 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
addProperty(_labelText);
addProperty(_labelOrientationOption);
_labelColor.setViewOption(properties::Property::ViewOptions::Color);
if (dictionary.hasKey(LabelColorInfo.identifier)) {
_labelColor = dictionary.value<glm::vec4>(LabelColorInfo.identifier);
@@ -634,17 +634,15 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
//}
float fadeInVariable = 1.f;
if (_enableFadingEffect) {
float distanceNodeToCamera = glm::distance(
data.camera.positionVec3(),
data.modelTransform.translation
float distanceNodeToCamera = static_cast<float>(
glm::distance(data.camera.positionVec3(), data.modelTransform.translation)
);
float sUnit = unit(_fadeStartUnitOption);
float eUnit = unit(_fadeEndUnitOption);
float startX = _fadeStartDistance * sUnit;
float endX = _fadeEndDistance * eUnit;
//fadeInVariable = changedPerlinSmoothStepFunc(distanceNodeToCamera, startX, endX);
fadeInVariable = linearSmoothStepFunc(
distanceNodeToCamera,
startX,
@@ -676,7 +674,7 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
glm::dvec3 orthoUp = glm::normalize(glm::cross(cameraViewDirectionWorld, orthoRight));
renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVariable);
//if (additiveBlending) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(true);
@@ -688,18 +686,18 @@ void RenderableLabels::setLabelText(const std::string & newText) {
_labelText = newText;
}
void RenderableLabels::renderLabels(const RenderData& data,
void RenderableLabels::renderLabels(const RenderData& data,
const glm::dmat4& modelViewProjectionMatrix,
const glm::dvec3& orthoRight,
const glm::dvec3& orthoUp, float fadeInVariable)
{
glm::vec4 textColor = _labelColor;
textColor.a *= fadeInVariable;
textColor.a *= _opacity;
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
labelInfo.orthoRight = orthoRight;
labelInfo.orthoUp = orthoUp;
labelInfo.minSize = static_cast<int>(_labelMinSize);
@@ -716,7 +714,7 @@ void RenderableLabels::renderLabels(const RenderData& data,
glm::vec3 transformedPos(
_transformationMatrix * glm::dvec4(data.modelTransform.translation, 1.0)
);
ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render(
*_font,
transformedPos,
@@ -727,11 +725,11 @@ void RenderableLabels::renderLabels(const RenderData& data,
}
float RenderableLabels::changedPerlinSmoothStepFunc(float x, float startX,
float endX) const
float endX) const
{
float f1 = 6.f * powf((x - startX), 5.f) - 15.f * powf((x - startX), 4.f) +
float f1 = 6.f * powf((x - startX), 5.f) - 15.f * powf((x - startX), 4.f) +
10.f * powf((x - startX), 3.f);
float f2 = -6.f * powf((x - endX), 5.f) + 15.f * powf((x - endX), 4.f) -
float f2 = -6.f * powf((x - endX), 5.f) + 15.f * powf((x - endX), 4.f) -
10.f * powf((x - endX), 3.f) + 1.f;
float f3 = 1.f;
@@ -743,7 +741,8 @@ float RenderableLabels::changedPerlinSmoothStepFunc(float x, float startX,
}
else if (x >= endX) {
return std::clamp(f2, 0.f, 1.f);
}
}
return x;
}
float RenderableLabels::linearSmoothStepFunc(float x, float startX, float endX,
@@ -754,7 +753,7 @@ float RenderableLabels::linearSmoothStepFunc(float x, float startX, float endX,
float f1 = sdiv * (x - startX) + 1.f;
float f2 = ediv * (x - endX) + 1.f;
float f3 = 1.f;
if (x <= startX) {
return std::clamp(f1, 0.f, 1.f);
}
@@ -764,17 +763,18 @@ float RenderableLabels::linearSmoothStepFunc(float x, float startX, float endX,
else if (x >= endX) {
return std::clamp(f2, 0.f, 1.f);
}
return x;
}
float RenderableLabels::unit(int unit) const {
switch (static_cast<Unit>(unit)) {
case Meter: return 1.f;
case Kilometer: return 1e3;
case Megameter: return 1e6;
case Gigameter: return 1e9;
case Kilometer: return 1e3f;
case Megameter: return 1e6f;
case Gigameter: return 1e9f;
case AU: return 149597870700.f;
case Terameter: return 1e12;
case Petameter: return 1e15;
case Terameter: return 1e12f;
case Petameter: return 1e15f;
case Parsec: return static_cast<float>(PARSEC);
case Kiloparsec: return static_cast<float>(1e3 * PARSEC);
case Megaparsec: return static_cast<float>(1e6 * PARSEC);

View File

@@ -100,7 +100,7 @@ private:
const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable);
float changedPerlinSmoothStepFunc(float x, float startX, float endX) const;
float linearSmoothStepFunc(float x, float startX, float endX, float sUnit,
float eUnit) const;

View File

@@ -146,7 +146,9 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
_lineColor = dictionary.value<glm::vec3>(LineColorInfo.identifier);
}
if (dictionary.hasKey(LineWidthInfo.identifier)) {
_lineWidth = static_cast<float>(dictionary.value<double>(LineWidthInfo.identifier));
_lineWidth = static_cast<float>(
dictionary.value<double>(LineWidthInfo.identifier)
);
}
_start.onChange([&]() { validateNodes(); });
@@ -238,13 +240,13 @@ void RenderableNodeLine::updateVertexData() {
global::renderEngine.scene()->sceneGraphNode(_end)->worldPosition()
);
_vertexArray.push_back(_startPos.x);
_vertexArray.push_back(_startPos.y);
_vertexArray.push_back(_startPos.z);
_vertexArray.push_back(static_cast<float>(_startPos.x));
_vertexArray.push_back(static_cast<float>(_startPos.y));
_vertexArray.push_back(static_cast<float>(_startPos.z));
_vertexArray.push_back(_endPos.x);
_vertexArray.push_back(_endPos.y);
_vertexArray.push_back(_endPos.z);
_vertexArray.push_back(static_cast<float>(_endPos.x));
_vertexArray.push_back(static_cast<float>(_endPos.y));
_vertexArray.push_back(static_cast<float>(_endPos.z));
_vertexArray;
@@ -264,7 +266,7 @@ void RenderableNodeLine::updateVertexData() {
void RenderableNodeLine::render(const RenderData& data, RendererTasks&) {
updateVertexData();
_program->activate();
glm::dmat4 anchorTranslation(1.0);
@@ -316,7 +318,7 @@ void RenderableNodeLine::render(const RenderData& data, RendererTasks&) {
// Bind and draw
bindGL();
glDrawArrays(GL_LINES, 0, 2);
// Restore GL State
unbindGL();
_program->deactivate();

View File

@@ -344,7 +344,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
}
auto render = [renderLines, renderPoints, p = _programObject, &data,
&modelTransform, pointSize = _appearance.pointSize.value(),
&modelTransform, pointSize = _appearance.pointSize.value(),
c = _uniformCache, lw = _appearance.lineWidth]
(RenderInformation& info, int nVertices, int offset)
{
@@ -366,14 +366,13 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
p->setUniform(c.nVertices, nVertices);
#ifndef __APPLE__
glm::ivec2 resolution = global::renderEngine.renderingResolution();
p->setUniform(c.resolution, resolution);
p->setUniform(c.lineWidth, ceil((2.f * 1.f + lw) * std::sqrt(2.f)));
#endif
if (renderPoints) {
// The stride parameter determines the distance between larger points and
// smaller ones
@@ -444,7 +443,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
);
glm::dvec3 trailPosWorld = glm::dvec3(
modelTransform * _primaryRenderInformation._localTransform *
modelTransform * _primaryRenderInformation._localTransform *
glm::dvec4(0.0, 0.0, 0.0, 1.0)
);
const double distance = glm::distance(

View File

@@ -373,7 +373,7 @@ void RenderableTrailOrbit::update(const UpdateData& data) {
std::for_each(_vertexArray.begin(), _vertexArray.end(), setMax);
setBoundingSphere(glm::distance(maxVertex, minVertex) / 2.0);
setBoundingSphere(glm::distance(maxVertex, minVertex) / 2.f);
}
RenderableTrailOrbit::UpdateReport RenderableTrailOrbit::updateTrails(

View File

@@ -350,7 +350,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
std::for_each(_vertexArray.begin(), _vertexArray.end(), setMax);
setBoundingSphere(glm::distance(maxVertex, minVertex) / 2.0);
setBoundingSphere(glm::distance(maxVertex, minVertex) / 2.f);
}

View File

@@ -43,7 +43,7 @@ namespace {
"scaling factor for this transformation. The script needs to define a function "
"'scale' that takes the current simulation time in seconds past the J2000 epoch "
"as the first argument, the current wall time as milliseconds past the J2000 "
"epoch the second argument and computes the scaling factor."
"epoch the second argument and computes the three scaling factors."
};
} // namespace
@@ -86,7 +86,7 @@ LuaScale::LuaScale(const ghoul::Dictionary& dictionary) : LuaScale() {
_luaScriptFile = absPath(dictionary.value<std::string>(ScriptInfo.identifier));
}
double LuaScale::scaleValue(const UpdateData& data) const {
glm::dvec3 LuaScale::scaleValue(const UpdateData& data) const {
ghoul::lua::runScriptFile(_state, _luaScriptFile);
// Get the scaling function
@@ -97,7 +97,7 @@ double LuaScale::scaleValue(const UpdateData& data) const {
"LuaScale",
fmt::format("Script '{}' does not have a function 'scale'", _luaScriptFile)
);
return 0.0;
return glm::dvec3(1.0);
}
// First argument is the number of seconds past the J2000 epoch in ingame time
@@ -120,7 +120,11 @@ double LuaScale::scaleValue(const UpdateData& data) const {
);
}
return luaL_checknumber(_state, -1);
const double x = luaL_checknumber(_state, -1);
const double y = luaL_checknumber(_state, -2);
const double z = luaL_checknumber(_state, -3);
lua_settop(_state, 0);
return glm::dvec3(x, y, z);
}
} // namespace openspace

View File

@@ -41,7 +41,7 @@ public:
LuaScale();
LuaScale(const ghoul::Dictionary& dictionary);
double scaleValue(const UpdateData& data) const override;
glm::dvec3 scaleValue(const UpdateData& data) const override;
static documentation::Documentation Documentation();

View File

@@ -0,0 +1,79 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* *
* 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 <modules/base/scale/nonuniformstaticscale.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/verifier.h>
namespace {
constexpr openspace::properties::Property::PropertyInfo ScaleInfo = {
"Scale",
"Scale",
"These values are used as scaling factors for the scene graph node that this "
"transformation is attached to relative to its parent."
};
} // namespace
namespace openspace {
documentation::Documentation NonUniformStaticScale::Documentation() {
using namespace openspace::documentation;
return {
"Static Scaling",
"base_scale_static",
{
{
ScaleInfo.identifier,
new DoubleVector3Verifier,
Optional::No,
ScaleInfo.description
}
}
};
}
glm::dvec3 NonUniformStaticScale::scaleValue(const UpdateData&) const {
return _scaleValue;
}
NonUniformStaticScale::NonUniformStaticScale()
: _scaleValue(ScaleInfo, glm::dvec3(1.0), glm::dvec3(0.1), glm::dvec3(100.0))
{
addProperty(_scaleValue);
_scaleValue.onChange([this]() {
requireUpdate();
});
}
NonUniformStaticScale::NonUniformStaticScale(const ghoul::Dictionary& dictionary)
: NonUniformStaticScale()
{
documentation::testSpecificationAndThrow(Documentation(), dictionary, "StaticScale");
_scaleValue = dictionary.value<glm::dvec3>(ScaleInfo.identifier);
}
} // namespace openspace

View File

@@ -0,0 +1,50 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* *
* 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_BASE___NONUNIFORMSTATICSCALE___H__
#define __OPENSPACE_MODULE_BASE___NONUNIFORMSTATICSCALE___H__
#include <openspace/scene/scale.h>
#include <openspace/properties/vector/dvec3property.h>
namespace openspace {
namespace documentation { struct Documentation; }
class NonUniformStaticScale : public Scale {
public:
NonUniformStaticScale();
NonUniformStaticScale(const ghoul::Dictionary& dictionary);
glm::dvec3 scaleValue(const UpdateData& data) const override;
static documentation::Documentation Documentation();
private:
properties::DVec3Property _scaleValue;
};
} // namespace openspace
#endif // __OPENSPACE_MODULE_BASE___NONUNIFORMSTATICSCALE___H__

View File

@@ -54,8 +54,8 @@ documentation::Documentation StaticScale::Documentation() {
};
}
double StaticScale::scaleValue(const UpdateData&) const {
return _scaleValue;
glm::dvec3 StaticScale::scaleValue(const UpdateData&) const {
return glm::dvec3(_scaleValue);
}
StaticScale::StaticScale() : _scaleValue(ScaleInfo, 1.f, 0.1f, 100.f) {

View File

@@ -37,7 +37,7 @@ class StaticScale : public Scale {
public:
StaticScale();
StaticScale(const ghoul::Dictionary& dictionary);
double scaleValue(const UpdateData& data) const override;
glm::dvec3 scaleValue(const UpdateData& data) const override;
static documentation::Documentation Documentation();

View File

@@ -108,7 +108,7 @@ TimeDependentScale::TimeDependentScale(const ghoul::Dictionary& dictionary)
addProperty(_clampToPositive);
}
double TimeDependentScale::scaleValue(const UpdateData& data) const {
glm::dvec3 TimeDependentScale::scaleValue(const UpdateData& data) const {
if (_cachedReferenceDirty) {
_cachedReference = Time::convertTime(_referenceDate);
_cachedReferenceDirty = false;
@@ -118,10 +118,10 @@ double TimeDependentScale::scaleValue(const UpdateData& data) const {
const double dt = now - _cachedReference;
if (_clampToPositive) {
return std::max(0.0, dt) * _speed;
return glm::dvec3(std::max(0.0, dt) * _speed);
}
else {
return dt * _speed;
return glm::dvec3(dt * _speed);
}
}

View File

@@ -38,7 +38,7 @@ namespace documentation { struct Documentation; }
class TimeDependentScale : public Scale {
public:
TimeDependentScale(const ghoul::Dictionary& dictionary);
double scaleValue(const UpdateData& data) const override;
glm::dvec3 scaleValue(const UpdateData& data) const override;
static documentation::Documentation Documentation();

View File

@@ -225,9 +225,9 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration)
if (isGuiWindow && isMaster && _instance) {
if (global::windowDelegate.windowHasResized() || _instance->_shouldReshape) {
glm::ivec2 csws = global::windowDelegate.currentSubwindowSize();
_instance->reshape(static_cast<glm::ivec2>(
static_cast<glm::vec2>(global::windowDelegate.currentSubwindowSize()) *
global::windowDelegate.dpiScaling()
static_cast<glm::vec2>(csws) * global::windowDelegate.dpiScaling()
));
_instance->_shouldReshape = false;
}

View File

@@ -424,7 +424,10 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
, _drawLabels(DrawLabelInfo, false)
, _pixelSizeControl(PixelSizeControlInfo, false)
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
, _datavarSizeOption(SizeOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
, _datavarSizeOption(
SizeOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, _fadeInDistance(
FadeInDistancesInfo,
glm::vec2(0.f),
@@ -548,7 +551,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
);
}
}
if (dictionary.hasKey(ExactColorMapInfo.identifier)) {
_isColorMapExact = dictionary.value<bool>(ExactColorMapInfo.identifier);
}
@@ -583,12 +586,12 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
_datavarSizeOption.onChange([&]() {
_dataIsDirty = true;
_datavarSizeOptionString = _optionConversionSizeMap[_datavarSizeOption.value()];
});
_datavarSizeOptionString = _optionConversionSizeMap[_datavarSizeOption];
});
addProperty(_datavarSizeOption);
_hasDatavarSize = true;
}
}
if (dictionary.hasKey(PolygonSidesInfo.identifier)) {
_polygonSides = static_cast<int>(
@@ -673,13 +676,11 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
addProperty(_correctionSizeFactor);
}
if (dictionary.hasKey(PixelSizeControlInfo.identifier)) {
_pixelSizeControl = dictionary.value<bool>(PixelSizeControlInfo.identifier);
addProperty(_pixelSizeControl);
}
}
bool RenderableBillboardsCloud::isReady() const {
@@ -1086,7 +1087,7 @@ void RenderableBillboardsCloud::update(const UpdateData&) {
sizeof(float) * 9,
reinterpret_cast<void*>(sizeof(float) * 8)
);
}
}
else if (_hasColorMapFile) {
glEnableVertexAttribArray(positionAttrib);
glVertexAttribPointer(
@@ -1607,10 +1608,11 @@ void RenderableBillboardsCloud::createDataSlice() {
}
// what datavar in use for the index color
int colorMapInUse = _hasColorMapFile ? _variableDataPositionMap[_colorOptionString] : 0;
int colorMapInUse =
_hasColorMapFile ? _variableDataPositionMap[_colorOptionString] : 0;
// what datavar in use for the size scaling (if present)
int sizeScalingInUse = _hasDatavarSize ?
int sizeScalingInUse = _hasDatavarSize ?
_variableDataPositionMap[_datavarSizeOptionString] : -1;
auto addDatavarSizeScalling = [&](size_t i, int datavarInUse) {
@@ -1625,7 +1627,7 @@ void RenderableBillboardsCloud::createDataSlice() {
float minColorIdx = std::numeric_limits<float>::max();
float maxColorIdx = std::numeric_limits<float>::min();
for (size_t i = 0; i < _fullData.size(); i += _nValuesPerAstronomicalObject) {
float colorIdx = _fullData[i + 3 + colorMapInUse];
maxColorIdx = colorIdx >= maxColorIdx ? colorIdx : maxColorIdx;
@@ -1671,7 +1673,7 @@ void RenderableBillboardsCloud::createDataSlice() {
}
else {
float ncmap = static_cast<float>(_colorMapData.size());
float normalization = ((cmax != cmin) && (ncmap > 2)) ?
float normalization = ((cmax != cmin) && (ncmap > 2)) ?
(ncmap - 2) / (cmax - cmin) : 0;
colorIndex = (variableColor - cmin) * normalization + 1;
colorIndex = colorIndex < 0 ? 0 : colorIndex;

View File

@@ -144,7 +144,7 @@ private:
correctionSizeFactor, color, alphaValue, scaleFactor, up, right, fadeInValue,
screenSize, spriteTexture, hasColormap, enabledRectSizeControl, hasDvarScaling
) _uniformCache;
std::shared_ptr<ghoul::fontrendering::Font> _font;
std::string _speckFile;

View File

@@ -110,6 +110,12 @@ namespace {
"objects being rendered."
};
constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = {
"LineWidth",
"Line Width",
"If the DU mesh is of wire type, this value determines the width of the lines"
};
constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = {
"DrawElements",
"Draw Elements",
@@ -215,6 +221,12 @@ documentation::Documentation RenderableDUMeshes::Documentation() {
Optional::Yes,
LabelMaxSizeInfo.description
},
{
LineWidthInfo.identifier,
new DoubleVerifier,
Optional::Yes,
LineWidthInfo.description
},
{
TransformationMatrixInfo.identifier,
new Matrix4x4Verifier<double>,
@@ -242,6 +254,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
, _drawLabels(DrawLabelInfo, false)
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
, _textMaxSize(LabelMaxSizeInfo, 500.f, 0.f, 1000.f)
, _lineWidth(LineWidthInfo, 2.f, 0.f, 16.f)
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
{
documentation::testSpecificationAndThrow(
@@ -315,6 +328,13 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
}
addProperty(_scaleFactor);*/
if (dictionary.hasKeyAndValue<double>(LineWidthInfo.identifier)) {
_lineWidth = static_cast<float>(
dictionary.value<double>(LineWidthInfo.identifier)
);
}
addProperty(_lineWidth);
if (dictionary.hasKey(DrawLabelInfo.identifier)) {
_drawLabels = dictionary.value<bool>(DrawLabelInfo.identifier);
}
@@ -473,7 +493,7 @@ void RenderableDUMeshes::renderMeshes(const RenderData&,
case Solid:
break;
case Wire:
glLineWidth(2.0);
glLineWidth(_lineWidth);
glDrawArrays(GL_LINE_STRIP, 0, pair.second.numV);
glLineWidth(lineWidth);
break;

View File

@@ -128,6 +128,7 @@ private:
//properties::OptionProperty _blendMode;
properties::FloatProperty _textMinSize;
properties::FloatProperty _textMaxSize;
properties::FloatProperty _lineWidth;
// DEBUG:
properties::OptionProperty _renderOption;

View File

@@ -149,7 +149,10 @@ namespace {
return;
}
fileStream.write(reinterpret_cast<const char*>(&CurrentCacheVersion), sizeof(int8_t));
fileStream.write(
reinterpret_cast<const char*>(&CurrentCacheVersion),
sizeof(int8_t)
);
fileStream.write(reinterpret_cast<const char*>(&nPoints), sizeof(int64_t));
fileStream.write(reinterpret_cast<const char*>(&pointsRatio), sizeof(float));
uint64_t nPositions = static_cast<uint64_t>(positions.size());
@@ -291,7 +294,7 @@ RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary)
_downScaleVolumeRendering.setVisibility(properties::Property::Visibility::Developer);
if (volumeDictionary.hasKey(DownscaleVolumeRenderingInfo.identifier)) {
_downScaleVolumeRendering =
_downScaleVolumeRendering =
volumeDictionary.value<float>(DownscaleVolumeRenderingInfo.identifier);
}
@@ -331,7 +334,7 @@ void RenderableGalaxy::initializeGL() {
_aspect = static_cast<glm::vec3>(_volumeDimensions);
_aspect /= std::max(std::max(_aspect.x, _aspect.y), _aspect.z);
// The volume
// The volume
volume::RawVolumeReader<glm::tvec4<GLubyte>> reader(
_volumeFilename,
_volumeDimensions
@@ -460,9 +463,9 @@ void RenderableGalaxy::initializeGL() {
}
else {
FileSys.cacheManager()->removeCacheFile(_pointsFilename);
Result res = loadPointFile(_pointsFilename);
pointPositions = std::move(res.positions);
pointColors = std::move(res.color);
Result resPoint = loadPointFile(_pointsFilename);
pointPositions = std::move(resPoint.positions);
pointColors = std::move(resPoint.color);
saveCachedFile(
cachedPointsFile,
pointPositions,
@@ -558,7 +561,7 @@ void RenderableGalaxy::update(const UpdateData& data) {
_pointTransform[3] += translation;
_raycaster->setDownscaleRender(_downScaleVolumeRendering);
_raycaster->setMaxSteps(_numberOfRayCastingSteps);
_raycaster->setMaxSteps(static_cast<int>(_numberOfRayCastingSteps));
_raycaster->setStepSize(_stepSize);
_raycaster->setAspect(_aspect);
_raycaster->setModelTransform(volumeTransform);
@@ -657,7 +660,7 @@ void RenderableGalaxy::renderPoints(const RenderData& data) {
glm::dmat4(1.0),
glm::pi<double>(),
glm::dvec3(1.0, 0.0, 0.0)) *
glm::rotate(glm::dmat4(1.0), 3.1248, glm::dvec3(0.0, 1.0, 0.0)) *
glm::rotate(glm::dmat4(1.0), 3.1248, glm::dvec3(0.0, 1.0, 0.0)) *
glm::rotate(glm::dmat4(1.0), 4.45741, glm::dvec3(0.0, 0.0, 1.0)
);
@@ -737,7 +740,7 @@ void RenderableGalaxy::renderBillboards(const RenderData& data) {
glm::dmat4(1.0),
glm::pi<double>(),
glm::dvec3(1.0, 0.0, 0.0)) *
glm::rotate(glm::dmat4(1.0), 3.1248, glm::dvec3(0.0, 1.0, 0.0)) *
glm::rotate(glm::dmat4(1.0), 3.1248, glm::dvec3(0.0, 1.0, 0.0)) *
glm::rotate(glm::dmat4(1.0), 4.45741, glm::dvec3(0.0, 0.0, 1.0)
);
@@ -795,7 +798,7 @@ float RenderableGalaxy::safeLength(const glm::vec3& vector) const {
return glm::length(vector / maxComponent) * maxComponent;
}
RenderableGalaxy::Result RenderableGalaxy::loadPointFile(const std::string& file) {
RenderableGalaxy::Result RenderableGalaxy::loadPointFile(const std::string&) {
std::vector<glm::vec3> pointPositions;
std::vector<glm::vec3> pointColors;
int64_t nPoints;

View File

@@ -626,8 +626,7 @@ void GlobeBrowsingModule::goToGeodetic2(const globebrowsing::RenderableGlobe& gl
}
void GlobeBrowsingModule::goToGeodetic3(const globebrowsing::RenderableGlobe& globe,
globebrowsing::Geodetic3 geo3,
bool doResetCameraDirection)
globebrowsing::Geodetic3 geo3, bool)
{
using namespace globebrowsing;
const glm::dvec3 positionModelSpace = globe.ellipsoid().cartesianPosition(geo3);

View File

@@ -377,16 +377,16 @@ vec4 calculateShadedColor(vec4 currentColor, vec3 ellipsoidNormalCameraSpace,
vec3 shadedColor = currentColor.rgb * 0.05;
vec3 n = normalize(ellipsoidNormalCameraSpace);
vec3 l = lightDirectionCameraSpace;
float power = orenNayarDiffuse(
-lightDirectionCameraSpace,
viewDirectionCameraSpace,
viewDirectionCameraSpace,
ellipsoidNormalCameraSpace,
roughness);
vec3 l = lightDirectionCameraSpace;
power = max(smoothstep(0.0f, 0.1f, max(dot(-l, n), 0.0f)) * power, 0.0f);
vec4 color = vec4(shadedColor + currentColor.rgb * power, currentColor.a);
return color;
}

View File

@@ -394,7 +394,8 @@ PixelRegion highestResPixelRegion(const GeodeticPatch& geodeticPatch,
return region;
}
RawTile::ReadError postProcessErrorCheck(const RawTile& rawTile, size_t nRasters,
RawTile::ReadError postProcessErrorCheck(const RawTile& rawTile,
[[ maybe_unused ]] size_t nRasters,
float noDataValue)
{
// This check was implicit before and just made explicit here

View File

@@ -697,7 +697,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
_ringsComponent.initialize();
addPropertySubOwner(_ringsComponent);
_hasRings = true;
ghoul::Dictionary ringsDic;
dictionary.getValue("Rings", ringsDic);
}
@@ -799,7 +799,7 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
if (_hasRings && _ringsComponent.isEnabled()) {
_ringsComponent.draw(lightRenderData, RingsComponent::GeometryOnly);
}
glEnable(GL_BLEND);
_shadowComponent.setViewDepthMap(false);
@@ -897,15 +897,13 @@ void RenderableGlobe::update(const UpdateData& data) {
}
setBoundingSphere(static_cast<float>(
_ellipsoid.maximumRadius() * data.modelTransform.scale
_ellipsoid.maximumRadius() * glm::compMax(data.modelTransform.scale)
));
glm::dmat4 translation =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation);
glm::dmat4 rotation = glm::dmat4(data.modelTransform.rotation);
glm::dmat4 scaling =
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale,
data.modelTransform.scale, data.modelTransform.scale));
glm::dmat4 scaling = glm::scale(glm::dmat4(1.0), data.modelTransform.scale);
_cachedModelTransform = translation * rotation * scaling;
_cachedInverseModelTransform = glm::inverse(_cachedModelTransform);
@@ -968,7 +966,7 @@ const glm::dmat4& RenderableGlobe::modelTransform() const {
// Rendering code
//////////////////////////////////////////////////////////////////////////////////////////
void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
const ShadowComponent::ShadowMapData& shadowData,
bool renderGeomOnly)
{
@@ -986,7 +984,7 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
const float dsf = static_cast<float>(
_generalProperties.currentLodScaleFactor * _ellipsoid.minimumRadius()
);
// We are setting the setIgnoreUniformLocationError as it is not super trivial
// and brittle to figure out apriori whether the uniform was optimized away
// or not. It should be something long the lines of:
@@ -1108,9 +1106,9 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
const bool hasWaterLayer = !_layerManager.layerGroup(
layergroupid::GroupID::WaterMasks
).activeLayers().empty();
_globalRenderer.program->setUniform("modelViewTransform", modelViewTransform);
const bool hasHeightLayer = !_layerManager.layerGroup(
layergroupid::HeightLayers
).activeLayers().empty();
@@ -1118,7 +1116,9 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
// Apply an extra scaling to the height if the object is scaled
_globalRenderer.program->setUniform(
"heightScale",
static_cast<float>(data.modelTransform.scale * data.camera.scaling())
static_cast<float>(
glm::compMax(data.modelTransform.scale) * data.camera.scaling()
)
);
}
@@ -1135,13 +1135,22 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
const glm::vec3 directionToSunCameraSpace = glm::vec3(viewTransform *
glm::dvec4(directionToSunWorldSpace, 0));
_globalRenderer.program->setUniform(
// @TODO (abock, 2020-04-14); This is just a bandaid for issue #1136. The better
// way is to figure out with the uniform is optimized away. I assume that it is
// because the shader doesn't get recompiled when the last layer of the night
// or water is disabled; so the shader thinks it has to do the calculation, but
// there are actually no layers left
using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError;
_localRenderer.program->setIgnoreUniformLocationError(IgnoreError::Yes);
_localRenderer.program->setUniform(
"lightDirectionCameraSpace",
-glm::normalize(directionToSunCameraSpace)
);
_localRenderer.program->setIgnoreUniformLocationError(IgnoreError::Yes);
}
// Local shader
_localRenderer.program->setUniform(
"projectionTransform",
@@ -1156,10 +1165,18 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
const glm::vec3 directionToSunCameraSpace = glm::vec3(viewTransform *
glm::dvec4(directionToSunWorldSpace, 0));
_localRenderer.program->setUniform(
// @TODO (abock, 2020-04-14); This is just a bandaid for issue #1136. The better
// way is to figure out with the uniform is optimized away. I assume that it is
// because the shader doesn't get recompiled when the last layer of the night
// or water is disabled; so the shader thinks it has to do the calculation, but
// there are actually no layers left
using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError;
_globalRenderer.program->setIgnoreUniformLocationError(IgnoreError::Yes);
_globalRenderer.program->setUniform(
"lightDirectionCameraSpace",
-glm::normalize(directionToSunCameraSpace)
);
_globalRenderer.program->setIgnoreUniformLocationError(IgnoreError::Yes);
}
constexpr const int ChunkBufferSize = 2048;
@@ -1329,9 +1346,9 @@ void RenderableGlobe::renderChunkGlobally(const Chunk& chunk, const RenderData&
// Shadow Mapping
ghoul::opengl::TextureUnit shadowMapUnit;
if (_generalProperties.shadowMapping && shadowData.shadowDepthTexture != 0) {
// Adding the model transformation to the final shadow matrix so we have a
// complete transformation from the model coordinates to the clip space of
// the light position.
// Adding the model transformation to the final shadow matrix so we have a
// complete transformation from the model coordinates to the clip space of the
// light position.
program.setUniform(
"shadowMatrix",
shadowData.shadowMatrix * modelTransform()
@@ -1345,14 +1362,14 @@ void RenderableGlobe::renderChunkGlobally(const Chunk& chunk, const RenderData&
}
glEnable(GL_DEPTH_TEST);
if (!renderGeomOnly) {
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
}
_grid.drawUsingActiveProgram();
for (GPULayerGroup& l : _globalRenderer.gpuLayerGroups) {
l.deactivate();
}
@@ -1444,7 +1461,9 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d
// Apply an extra scaling to the height if the object is scaled
program.setUniform(
"heightScale",
static_cast<float>(data.modelTransform.scale * data.camera.scaling())
static_cast<float>(
glm::compMax(data.modelTransform.scale) * data.camera.scaling()
)
);
}
@@ -1459,9 +1478,9 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d
// Shadow Mapping
ghoul::opengl::TextureUnit shadowMapUnit;
if (_generalProperties.shadowMapping && shadowData.shadowDepthTexture != 0) {
// Adding the model transformation to the final shadow matrix so we have a
// complete transformation from the model coordinates to the clip space of
// the light position.
// Adding the model transformation to the final shadow matrix so we have a
// complete transformation from the model coordinates to the clip space of the
// light position.
program.setUniform(
"shadowMatrix",
shadowData.shadowMatrix * modelTransform()
@@ -1479,7 +1498,7 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
}
_grid.drawUsingActiveProgram();
for (GPULayerGroup& l : _localRenderer.gpuLayerGroups) {
@@ -1616,7 +1635,7 @@ void RenderableGlobe::recompileShaders() {
//);
layeredTextureInfo.lastLayerIdx = static_cast<int>(
layerGroup.activeLayers().size() - 1
);
);
layeredTextureInfo.layerBlendingEnabled = layerGroup.layerBlendingEnabled();
for (Layer* layer : layers) {

View File

@@ -188,7 +188,7 @@ private:
*/
float getHeight(const glm::dvec3& position) const;
void renderChunks(const RenderData& data, RendererTasks& rendererTask,
void renderChunks(const RenderData& data, RendererTasks& rendererTask,
const ShadowComponent::ShadowMapData& shadowData = {}, bool renderGeomOnly = false
);

View File

@@ -52,7 +52,7 @@ namespace {
constexpr const char* _loggerCat = "RingsComponent";
constexpr const std::array<const char*, 9> UniformNames = {
"modelViewProjectionMatrix", "textureOffset", "transparency", "_nightFactor",
"modelViewProjectionMatrix", "textureOffset", "transparency", "_nightFactor",
"sunPosition", "ringTexture", "shadowMatrix", "shadowMapTexture",
"zFightingPercentage"
};
@@ -180,7 +180,7 @@ RingsComponent::RingsComponent(const ghoul::Dictionary& dictionary)
, _ringsDictionary(dictionary)
{
using ghoul::filesystem::File;
if (dictionary.hasKey("Rings")) {
// @TODO (abock, 2019-12-16) It would be better to not store the dictionary long
// term and rather extract the values directly here. This would require a bit of
@@ -188,7 +188,7 @@ RingsComponent::RingsComponent(const ghoul::Dictionary& dictionary)
// class-initializer list though
dictionary.getValue("Rings", _ringsDictionary);
}
documentation::testSpecificationAndThrow(
Documentation(),
_ringsDictionary,
@@ -310,20 +310,20 @@ void RingsComponent::draw(const RenderData& data,
else if (renderPass == GeometryOnly) {
_geometryOnlyShader->activate();
}
const glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) *
glm::dmat4(data.modelTransform.rotation) *
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
const glm::dmat4 modelViewProjectionTransform =
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix()
const glm::dmat4 modelViewProjectionTransform =
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix()
* modelTransform;
ghoul::opengl::TextureUnit ringTextureUnit;
if (renderPass == GeometryAndShading) {
_shader->setUniform(
_uniformCache.modelViewProjectionMatrix,
_uniformCache.modelViewProjectionMatrix,
modelViewProjectionTransform
);
_shader->setUniform(_uniformCache.textureOffset, _offset);
@@ -336,18 +336,18 @@ void RingsComponent::draw(const RenderData& data,
_texture->bind();
_shader->setUniform(_uniformCache.ringTexture, ringTextureUnit);
// Adding the model transformation to the final shadow matrix so we have a
// complete transformation from the model coordinates to the clip space of
// Adding the model transformation to the final shadow matrix so we have a
// complete transformation from the model coordinates to the clip space of
// the light position.
_shader->setUniform(
_uniformCache.shadowMatrix,
_uniformCache.shadowMatrix,
shadowData.shadowMatrix * modelTransform
);
ghoul::opengl::TextureUnit shadowMapUnit;
shadowMapUnit.activate();
glBindTexture(GL_TEXTURE_2D, shadowData.shadowDepthTexture);
_shader->setUniform(_uniformCache.shadowMapTexture, shadowMapUnit);
}
else if (renderPass == GeometryOnly) {
@@ -386,8 +386,8 @@ void RingsComponent::update(const UpdateData& data) {
if (_geometryOnlyShader->isDirty()) {
_geometryOnlyShader->rebuildFromFile();
ghoul::opengl::updateUniformLocations(
*_geometryOnlyShader,
_geomUniformCache,
*_geometryOnlyShader,
_geomUniformCache,
GeomUniformNames
);
}

View File

@@ -54,18 +54,16 @@ public:
GeometryOnly,
GeometryAndShading
};
RingsComponent(const ghoul::Dictionary& dictionary);
void initialize();
void initializeGL();
void deinitializeGL();
bool isReady() const;
void draw(
const RenderData& data,
const RingsComponent::RenderPass renderPass,
void draw(const RenderData& data, const RingsComponent::RenderPass renderPass,
const ShadowComponent::ShadowMapData& shadowData = {}
);
void update(const UpdateData& data);
@@ -90,11 +88,11 @@ private:
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
std::unique_ptr<ghoul::opengl::ProgramObject> _geometryOnlyShader;
UniformCache(modelViewProjectionMatrix, textureOffset, transparency, nightFactor,
UniformCache(modelViewProjectionMatrix, textureOffset, transparency, nightFactor,
sunPosition, ringTexture, shadowMatrix, shadowMapTexture, zFightingPercentage
) _uniformCache;
UniformCache(modelViewProjectionMatrix, textureOffset, ringTexture)
_geomUniformCache;
UniformCache(modelViewProjectionMatrix, textureOffset, ringTexture
) _geomUniformCache;
std::unique_ptr<ghoul::opengl::Texture> _texture;
std::unique_ptr<ghoul::filesystem::File> _textureFile;

View File

@@ -55,7 +55,7 @@
namespace {
constexpr const char* _loggerCat = "ShadowComponent";
constexpr openspace::properties::Property::PropertyInfo SaveDepthTextureInfo = {
"SaveDepthTextureInfo",
"Save Depth Texture",
@@ -197,10 +197,10 @@ ShadowComponent::ShadowComponent(const ghoul::Dictionary& dictionary)
if (_shadowMapDictionary.hasKey(DepthMapSizeInfo.identifier)) {
glm::vec2 depthMapSize =
glm::vec2 depthMapSize =
_shadowMapDictionary.value<glm::vec2>(DepthMapSizeInfo.identifier);
_shadowDepthTextureWidth = depthMapSize.x;
_shadowDepthTextureHeight = depthMapSize.y;
_shadowDepthTextureWidth = static_cast<int>(depthMapSize.x);
_shadowDepthTextureHeight = static_cast<int>(depthMapSize.y);
_dynamicDepthTextureRes = false;
}
else {
@@ -240,42 +240,42 @@ RenderData ShadowComponent::begin(const RenderData& data) {
// ===========================================
// Builds light's ModelViewProjectionMatrix:
// ===========================================
glm::dvec3 diffVector = glm::dvec3(_sunPosition) - data.modelTransform.translation;
double originalLightDistance = glm::length(diffVector);
glm::dvec3 lightDirection = glm::normalize(diffVector);
// Percentage of the original light source distance (to avoid artifacts)
//double multiplier = originalLightDistance *
//double multiplier = originalLightDistance *
// (static_cast<double>(_distanceFraction)/1.0E5);
double multiplier = originalLightDistance *
(static_cast<double>(_distanceFraction) / 1E17);
// New light source position
//glm::dvec3 lightPosition = data.modelTransform.translation +
//glm::dvec3 lightPosition = data.modelTransform.translation +
// (lightDirection * multiplier);
glm::dvec3 lightPosition = data.modelTransform.translation +
(diffVector * multiplier);
//// Light Position
//glm::dvec3 lightPosition = glm::dvec3(_sunPosition);
//=============== Manually Created Camera Matrix ===================
//==================================================================
// camera Z
glm::dvec3 cameraZ = lightDirection;
// camera X
glm::dvec3 upVector = glm::dvec3(0.0, 1.0, 0.0);
glm::dvec3 cameraX = glm::normalize(glm::cross(upVector, cameraZ));
glm::dvec3 cameraX = glm::normalize(glm::cross(upVector, cameraZ));
// camera Y
glm::dvec3 cameraY = glm::cross(cameraZ, cameraX);
// init 4x4 matrix
glm::dmat4 cameraRotationMatrix(1.0);
double* matrix = glm::value_ptr(cameraRotationMatrix);
matrix[0] = cameraX.x;
matrix[4] = cameraX.y;
@@ -288,31 +288,31 @@ RenderData ShadowComponent::begin(const RenderData& data) {
matrix[10] = cameraZ.z;
// set translation part
// We aren't setting the position here because it is set in
// We aren't setting the position here because it is set in
// the camera->setPosition()
//matrix[12] = -glm::dot(cameraX, lightPosition);
//matrix[13] = -glm::dot(cameraY, lightPosition);
//matrix[14] = -glm::dot(cameraZ, lightPosition);
_lightCamera = std::move(std::unique_ptr<Camera>(new Camera(data.camera)));
_lightCamera->setPositionVec3(lightPosition);
_lightCamera->setRotation(glm::dquat(glm::inverse(cameraRotationMatrix)));
//=======================================================================
//=======================================================================
//============= Light Matrix by Camera Matrices Composition =============
//=======================================================================
glm::dmat4 lightProjectionMatrix = glm::dmat4(_lightCamera->projectionMatrix());
// The model transformation missing in the final shadow matrix is add when rendering each
// object (using its transformations provided by the RenderData structure)
_shadowData.shadowMatrix =
_toTextureCoordsMatrix * lightProjectionMatrix *
// The model transformation missing in the final shadow matrix is add when rendering
// each object (using its transformations provided by the RenderData structure)
_shadowData.shadowMatrix =
_toTextureCoordsMatrix * lightProjectionMatrix *
_lightCamera->combinedViewMatrix();
// Saves current state
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO);
glGetIntegerv(GL_VIEWPORT, _mViewport);
@@ -337,8 +337,7 @@ RenderData ShadowComponent::begin(const RenderData& data) {
glEnable(GL_DEPTH_TEST);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glEnable(GL_CULL_FACE);
//checkGLError("begin() -- enabled cull face");
//glCullFace(GL_FRONT);
@@ -372,7 +371,7 @@ void ShadowComponent::end() {
};
glDrawBuffers(3, drawBuffers);
glViewport(_mViewport[0], _mViewport[1], _mViewport[2], _mViewport[3]);
if (_faceCulling) {
glEnable(GL_CULL_FACE);
glCullFace(_faceToCull);
@@ -399,9 +398,9 @@ void ShadowComponent::end() {
}
glClearColor(
_colorClearValue[0],
_colorClearValue[1],
_colorClearValue[2],
_colorClearValue[0],
_colorClearValue[1],
_colorClearValue[2],
_colorClearValue[3]
);
glClearDepth(_depthClearValue);
@@ -433,14 +432,14 @@ void ShadowComponent::end() {
glBindVertexArray(_quadVAO);
glDrawArrays(GL_TRIANGLES, 0, 6);
_renderDMProgram->deactivate();
}
}
void ShadowComponent::update(const UpdateData&) {
_sunPosition = global::renderEngine.scene()->sceneGraphNode("Sun")->worldPosition();
glm::ivec2 renderingResolution = global::renderEngine.renderingResolution();
if (_dynamicDepthTextureRes && ((_shadowDepthTextureWidth != renderingResolution.x) ||
(_shadowDepthTextureHeight != renderingResolution.y)))
@@ -454,7 +453,7 @@ void ShadowComponent::update(const UpdateData&) {
void ShadowComponent::createDepthTexture() {
glGenTextures(1, &_shadowDepthTexture);
updateDepthTexture();
_shadowData.shadowDepthTexture = _shadowDepthTexture;
//_shadowData.positionInLightSpaceTexture = _positionInLightSpaceTexture;
}
@@ -462,13 +461,13 @@ void ShadowComponent::createDepthTexture() {
void ShadowComponent::createShadowFBO() {
// Saves current FBO first
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO);
glGenFramebuffers(1, &_shadowFBO);
glBindFramebuffer(GL_FRAMEBUFFER, _shadowFBO);
glFramebufferTexture(
GL_FRAMEBUFFER,
GL_DEPTH_ATTACHMENT,
_shadowDepthTexture,
GL_FRAMEBUFFER,
GL_DEPTH_ATTACHMENT,
_shadowDepthTexture,
0
);
@@ -478,7 +477,7 @@ void ShadowComponent::createShadowFBO() {
// _positionInLightSpaceTexture,
// 0
//);
//GLenum drawBuffers[] = { GL_COLOR_ATTACHMENT0, GL_NONE, GL_NONE };
GLenum drawBuffers[] = { GL_NONE, GL_NONE, GL_NONE };
glDrawBuffers(3, drawBuffers);
@@ -561,7 +560,7 @@ void ShadowComponent::saveDepthBuffer() {
if (ppmFile.is_open()) {
ppmFile << "P3" << std::endl;
ppmFile << _shadowDepthTextureWidth << " " << _shadowDepthTextureHeight
ppmFile << _shadowDepthTextureWidth << " " << _shadowDepthTextureHeight
<< std::endl;
ppmFile << "255" << std::endl;
@@ -601,7 +600,7 @@ void ShadowComponent::saveDepthBuffer() {
if (ppmFile.is_open()) {
ppmFile << "P3" << std::endl;
ppmFile << _shadowDepthTextureWidth << " " << _shadowDepthTextureHeight
ppmFile << _shadowDepthTextureWidth << " " << _shadowDepthTextureHeight
<< std::endl;
ppmFile << "255" << std::endl;

View File

@@ -70,7 +70,7 @@ public:
RenderData begin(const RenderData& data);
void end();
void update(const UpdateData& data);
static documentation::Documentation Documentation();
bool isEnabled() const;
@@ -101,13 +101,13 @@ private:
properties::TriggerProperty _saveDepthTexture;
properties::IntProperty _distanceFraction;
properties::BoolProperty _enabled;
ghoul::Dictionary _shadowMapDictionary;
int _shadowDepthTextureHeight = 4096;
int _shadowDepthTextureWidth = 4096;
bool _dynamicDepthTextureRes = true;
GLuint _shadowDepthTexture = 0;
GLuint _positionInLightSpaceTexture = 0;
GLuint _shadowFBO = 0;

View File

@@ -540,7 +540,7 @@ void TimeQuantizer::doFirstApproximation(DateTime& quantized, DateTime& unQ,
static_cast<double>(_start.year());
minIncrementsAdjust = minYearsToAdjust / value;
quantized.setYear(
_start.year() + static_cast<int>(minIncrementsAdjust) * value
_start.year() + static_cast<int>(minIncrementsAdjust * value)
);
break;
case 'M':

View File

@@ -65,7 +65,7 @@ public:
*
* \param checkTime An ISO8601 date/time string to clamp if falls outside of range
*
* \returns clamped value of input parameter, will be equal to the start value if
* \returns clamped value of input parameter, will be equal to the start value if
* less than start, equal to end if greater than end, or equal to input
* parameter if falls in-between
*/
@@ -227,7 +227,7 @@ public:
/*
* Increment operation for the date/time
*
*
* \param value integer value for number of units in an operation
* \param unit single char that specifies the unit of increment. Allowable units are:
* (y)ear, (M)onth, (d)ay, (h)our, (m)inute, (s)econd
@@ -254,7 +254,7 @@ public:
* \returns The number of decrements that were performed in order to get as close as
* possible to the target, where each decrement is defined by the value &
* unit (and approximated but not fixed by the resolution param)
*/
*/
int decrement(int value, char unit, double error, double resolution);
/*

View File

@@ -154,9 +154,6 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
global::callback::draw2D.emplace_back([&]() {
ZoneScopedN("ImGUI")
// TODO emiax: Make sure this is only called for one of the eyes, in the case
// of side-by-side / top-bottom stereo.
WindowDelegate& delegate = global::windowDelegate;
const bool showGui = delegate.hasGuiWindow() ? delegate.isGuiWindow() : true;
if (delegate.isMaster() && showGui) {
@@ -167,22 +164,15 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
return;
}
glm::vec2 mousePosition = delegate.mousePosition();
uint32_t mouseButtons = delegate.mouseButtons(2);
const double dt = std::max(delegate.averageDeltaTime(), 0.0);
if (touchInput.active && mouseButtons == 0) {
mouseButtons = touchInput.action;
mousePosition = touchInput.pos;
}
// We don't do any collection of immediate mode user interface, so it
// is fine to open and close a frame immediately
gui.startFrame(
static_cast<float>(dt),
glm::vec2(windowSize),
resolution / windowSize,
mousePosition,
mouseButtons
_mousePosition,
_mouseButtons
);
gui.endFrame();
@@ -221,10 +211,23 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
}
);
global::callback::mousePosition.emplace_back(
[&](double x, double y) {
_mousePosition = glm::vec2(static_cast<float>(x), static_cast<float>(y));
}
);
global::callback::mouseButton.emplace_back(
[&](MouseButton button, MouseAction action, KeyModifier) -> bool {
ZoneScopedN("ImGUI")
if (action == MouseAction::Press) {
_mouseButtons |= (1 << static_cast<int>(button));
}
else if (action == MouseAction::Release) {
_mouseButtons &= ~(1 << static_cast<int>(button));
}
// A list of all the windows that can show up by themselves
if (gui.isEnabled() || gui._performance.isEnabled() ||
gui._sceneProperty.isEnabled())
@@ -252,6 +255,24 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
}
}
);
global::callback::touchDetected.emplace_back(
[&](TouchInput input) -> bool {
return gui.touchDetectedCallback(input);
}
);
global::callback::touchUpdated.emplace_back(
[&](TouchInput input) -> bool {
return gui.touchUpdatedCallback(input);
}
);
global::callback::touchExit.emplace_back(
[&](TouchInput input) {
gui.touchExitCallback(input);
}
);
}
} // namespace openspace

View File

@@ -31,13 +31,6 @@
namespace openspace {
// This should be moved into the touch module ---abock
struct Touch {
bool active;
glm::vec2 pos = glm::vec2(0.f);
uint32_t action = 0;
};
class ImGUIModule : public OpenSpaceModule {
public:
constexpr static const char* Name = "ImGUI";
@@ -45,7 +38,10 @@ public:
ImGUIModule();
gui::GUI gui;
Touch touchInput = { false, glm::vec2(0), 0 };
private:
glm::vec2 _mousePosition = glm::vec2(0.f);
uint32_t _mouseButtons = 0;
};
} // namespace openspace

View File

@@ -44,6 +44,7 @@
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/util/keys.h>
#include <openspace/util/mouse.h>
#include <openspace/util/touch.h>
#include <ghoul/glm.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
@@ -89,6 +90,10 @@ public:
bool keyCallback(Key key, KeyModifier modifier, KeyAction action);
bool charCallback(unsigned int character, KeyModifier modifier);
bool touchDetectedCallback(TouchInput input);
bool touchUpdatedCallback(TouchInput input);
void touchExitCallback(TouchInput input);
void startFrame(float deltaTime, const glm::vec2& windowSize,
const glm::vec2& dpiScaling, const glm::vec2& mousePos,
uint32_t mouseButtonsPressed);
@@ -169,6 +174,8 @@ private:
properties::Property::Visibility::Developer;
std::vector<ImGuiContext*> _contexts;
std::vector<TouchInput> _validTouchStates;
};
void CaptionText(const char* text);

View File

@@ -637,6 +637,77 @@ bool GUI::charCallback(unsigned int character, KeyModifier) {
return consumeEvent;
}
bool GUI::touchDetectedCallback(TouchInput input) {
ImGuiIO& io = ImGui::GetIO();
const glm::vec2 windowPos = input.currentWindowCoordinates();
const bool consumeEvent = ImGui::IsPosHoveringAnyWindow({ windowPos.x, windowPos.y });
if (!consumeEvent) {
return false;
}
if (_validTouchStates.empty()) {
io.MousePos = {windowPos.x, windowPos.y};
io.MouseClicked[0] = true;
}
_validTouchStates.push_back(input);
return true;
}
bool GUI::touchUpdatedCallback(TouchInput input) {
if (_validTouchStates.empty()) {
return false;
}
ImGuiIO& io = ImGui::GetIO();
auto it = std::find_if(
_validTouchStates.cbegin(),
_validTouchStates.cend(),
[&](const TouchInput& state){
return state.fingerId == input.fingerId &&
state.touchDeviceId == input.touchDeviceId;
}
);
if (it == _validTouchStates.cbegin()) {
glm::vec2 windowPos = input.currentWindowCoordinates();
io.MousePos = {windowPos.x, windowPos.y};
io.MouseClicked[0] = true;
return true;
}
else if (it != _validTouchStates.cend()){
return true;
}
return false;
}
void GUI::touchExitCallback(TouchInput input) {
if (_validTouchStates.empty()) {
return;
}
const auto found = std::find_if(
_validTouchStates.cbegin(),
_validTouchStates.cend(),
[&](const TouchInput& state){
return state.fingerId == input.fingerId &&
state.touchDeviceId == input.touchDeviceId;
}
);
if (found == _validTouchStates.cend()) {
return;
}
ImGuiIO& io = ImGui::GetIO();
_validTouchStates.erase(found);
if (_validTouchStates.empty()) {
glm::vec2 windowPos = input.currentWindowCoordinates();
io.MousePos = {windowPos.x, windowPos.y};
io.MouseClicked[0] = false;
}
}
void GUI::render() {
ImGui::SetNextWindowCollapsed(_isCollapsed);

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