mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 12:39:24 -05:00
Merge branch 'thesis/2019/camera-paths' into camera-paths/avoid-collision
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
## How to contribute
|
## 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.
|
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).
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<< Description of the problem >>
|
||||||
|
|
||||||
|
<< What did you expect to happen >>
|
||||||
|
<< What did happen? >>
|
||||||
|
|
||||||
|
|
||||||
|
<< Attach screenshots, if possible >>
|
||||||
@@ -25,6 +25,7 @@ Thumbs.db
|
|||||||
# OpenSpace-generated folders and files
|
# OpenSpace-generated folders and files
|
||||||
/bin/
|
/bin/
|
||||||
/cache/
|
/cache/
|
||||||
|
/cache-*/
|
||||||
/cache_gdal/
|
/cache_gdal/
|
||||||
/documentation/
|
/documentation/
|
||||||
/logs/
|
/logs/
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -111,42 +111,20 @@ target_compile_definitions(OpenSpace PRIVATE
|
|||||||
begin_header("Dependency: SGCT")
|
begin_header("Dependency: SGCT")
|
||||||
|
|
||||||
set(SGCT_TEXT OFF CACHE BOOL "" FORCE)
|
set(SGCT_TEXT OFF CACHE BOOL "" FORCE)
|
||||||
set(SGCT_BUILD_CSHARP_PROJECTS OFF CACHE BOOL "" FORCE)
|
set(SGCT_DEP_INCLUDE_FREETYPE 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)
|
|
||||||
|
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct)
|
||||||
target_include_directories(OpenSpace SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct/include)
|
target_include_directories(OpenSpace SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct/include)
|
||||||
target_link_libraries(
|
target_link_libraries(OpenSpace sgct)
|
||||||
OpenSpace
|
|
||||||
sgct_light glew glfw png16_static quat tinyxml2static turbojpeg-static
|
|
||||||
vrpn ${GLFW_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
mark_as_advanced(EXECUTABLE_OUTPUT_PATH GLFW_BUILD_DOCS GLFW_BUILD_EXAMPLES
|
set_folder_location(sgct "External")
|
||||||
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(glfw "External/SGCT")
|
set_folder_location(glfw "External/SGCT")
|
||||||
|
set_folder_location(miniziplibstatic "External/SGCT")
|
||||||
set_folder_location(png16_static "External/SGCT")
|
set_folder_location(png16_static "External/SGCT")
|
||||||
set_folder_location(quat "External/SGCT")
|
set_folder_location(quat "External/SGCT")
|
||||||
set_folder_location(simd "External/SGCT")
|
|
||||||
set_folder_location(tinyxml2static "External/SGCT")
|
set_folder_location(tinyxml2static "External/SGCT")
|
||||||
set_folder_location(turbojpeg-static "External/SGCT")
|
|
||||||
set_folder_location(vrpn "External/SGCT")
|
set_folder_location(vrpn "External/SGCT")
|
||||||
set_folder_location(zlibstatic "External/SGCT")
|
set_folder_location(zlibstatic "External/SGCT")
|
||||||
set_folder_location(miniziplibstatic "External/SGCT")
|
|
||||||
|
|
||||||
if (UNIX AND (NOT APPLE))
|
if (UNIX AND (NOT APPLE))
|
||||||
target_link_libraries(OpenSpace Xcursor Xinerama X11)
|
target_link_libraries(OpenSpace Xcursor Xinerama X11)
|
||||||
|
|||||||
+1
-1
Submodule apps/OpenSpace/ext/sgct updated: 3622605062...df7c5414cc
+265
-399
File diff suppressed because it is too large
Load Diff
+21
-21
@@ -1,24 +1,24 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost" externalControlPort="20500">
|
<Cluster masterAddress="localhost" externalControlPort="20500">
|
||||||
<Settings>
|
<Settings>
|
||||||
<Display swapInterval="0" />
|
<Display swapInterval="0" />
|
||||||
</Settings>
|
</Settings>
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window fullScreen="true" numberOfSamples="4" name="OpenSpace">
|
<Window fullScreen="true" numberOfSamples="4" name="OpenSpace">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Size x="1920" y="1080" />
|
<Size x="1920" y="1080" />
|
||||||
<Pos x="0" y="0" />
|
<Pos x="0" y="0" />
|
||||||
<Viewport tracked="true">
|
<Viewport tracked="true">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.065">
|
<User eyeSeparation="0.065">
|
||||||
<Pos x="0.0" y="0.0" z="0.0" />
|
<Pos x="0.0" y="0.0" z="0.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
+30
-30
@@ -1,33 +1,33 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost" externalControlPort="20500">
|
<Cluster masterAddress="localhost" externalControlPort="20500">
|
||||||
<Settings>
|
<Settings>
|
||||||
<Display swapInterval="0" />
|
<Display swapInterval="0" />
|
||||||
</Settings>
|
</Settings>
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window fullScreen="true" monitor="1" name="OpenSpace">
|
<Window fullScreen="true" monitor="1" name="OpenSpace">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Size x="1920" y="1080" />
|
<Size x="1920" y="1080" />
|
||||||
<Pos x="0" y="0" />
|
<Pos x="0" y="0" />
|
||||||
<Viewport tracked="true">
|
<Viewport tracked="true">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
<Window fullScreen="false" border="false" name="GUI" tags="GUI">
|
<Window fullScreen="false" border="false" name="GUI" tags="GUI">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Size x="1920" y="1080" />
|
<Size x="1920" y="1080" />
|
||||||
<Pos x="0" y="0" />
|
<Pos x="0" y="0" />
|
||||||
<Viewport>
|
<Viewport>
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.065">
|
<User eyeSeparation="0.065">
|
||||||
<Pos x="0.0" y="0.0" z="0.0" />
|
<Pos x="0.0" y="0.0" z="0.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
+20
-20
@@ -1,23 +1,23 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost">
|
<Cluster masterAddress="localhost">
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
|
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
|
||||||
<Stereo type="side_by_side" />
|
<Stereo type="side_by_side" />
|
||||||
<!-- Res is equal to the Recommend target size -->
|
<!-- Res is equal to the Recommend target size -->
|
||||||
<Size x="1332" y="840" />
|
<Size x="1332" y="840" />
|
||||||
<Res x="3024" y="1680" />
|
<Res x="3024" y="1680" />
|
||||||
<Viewport>
|
<Viewport>
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<Projectionplane>
|
<Projectionplane>
|
||||||
<!-- Lower left -->
|
<!-- Lower left -->
|
||||||
<Pos x="-1.7156" y="-0.965" z="0.0" />
|
<Pos x="-1.7156" y="-0.965" z="0.0" />
|
||||||
<!-- Upper left -->
|
<!-- Upper left -->
|
||||||
<Pos x="-1.7156" y="0.965" z="0.0" />
|
<Pos x="-1.7156" y="0.965" z="0.0" />
|
||||||
<!-- Upper right -->
|
<!-- Upper right -->
|
||||||
<Pos x="1.7156" y="0.965" z="0.0" />
|
<Pos x="1.7156" y="0.965" z="0.0" />
|
||||||
</Projectionplane>
|
</Projectionplane>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost">
|
<Cluster masterAddress="localhost">
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
|
<Window tags="OpenVR" fullScreen="false" name="OpenSpace">
|
||||||
<Stereo type="side_by_side" />
|
<Stereo type="side_by_side" />
|
||||||
<!-- Res is equal to the Recommend target size -->
|
<!-- Res is equal to the Recommend target size -->
|
||||||
<Size x="1332" y="793" />
|
<Size x="1332" y="793" />
|
||||||
<Res x="2664" y="1586" />
|
<Res x="2664" y="1586" />
|
||||||
<Viewport>
|
<Viewport>
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<Projectionplane>
|
<Projectionplane>
|
||||||
<!-- Lower left -->
|
<!-- Lower left -->
|
||||||
<Pos x="-1.7156" y="-0.965" z="0.0" />
|
<Pos x="-1.7156" y="-0.965" z="0.0" />
|
||||||
<!-- Upper left -->
|
<!-- Upper left -->
|
||||||
<Pos x="-1.7156" y="0.965" z="0.0" />
|
<Pos x="-1.7156" y="0.965" z="0.0" />
|
||||||
<!-- Upper right -->
|
<!-- Upper right -->
|
||||||
<Pos x="1.7156" y="0.965" z="0.0" />
|
<Pos x="1.7156" y="0.965" z="0.0" />
|
||||||
</Projectionplane>
|
</Projectionplane>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
+21
-21
@@ -1,24 +1,24 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost" externalControlPort="20500">
|
<Cluster masterAddress="localhost" externalControlPort="20500">
|
||||||
<Settings>
|
<Settings>
|
||||||
<Display swapInterval="0" />
|
<Display swapInterval="0" />
|
||||||
</Settings>
|
</Settings>
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window fullScreen="false" name="OpenSpace">
|
<Window fullScreen="false" name="OpenSpace">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Pos x="50" y="50" />
|
<Pos x="50" y="50" />
|
||||||
<Viewport tracked="true">
|
<Viewport tracked="true">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.065">
|
<User eyeSeparation="0.065">
|
||||||
<Pos x="0.0" y="0.0" z="0.0" />
|
<Pos x="0.0" y="0.0" z="0.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
+33
-33
@@ -1,37 +1,37 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost">
|
<Cluster masterAddress="localhost">
|
||||||
<!-- <Scene>
|
<!-- <Scene>
|
||||||
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
|
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
|
||||||
<Offset x="0.0" y="0.0" z="0.0" />
|
<Offset x="0.0" y="0.0" z="0.0" />
|
||||||
<Scale value="1.0" />
|
<Scale value="1.0" />
|
||||||
</Scene> -->
|
</Scene> -->
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window fullScreen="false" name="OpenSpace">
|
<Window fullScreen="false" name="OpenSpace">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<!-- 16:9 aspect ratio -->
|
<!-- 16:9 aspect ratio -->
|
||||||
<Size x="1024" y="1024" />
|
<Size x="1024" y="1024" />
|
||||||
<!-- Frame buffer resolution
|
<!-- Frame buffer resolution
|
||||||
<Res x="4096" y="4096" /> -->
|
<Res x="4096" y="4096" /> -->
|
||||||
<!--
|
<!--
|
||||||
quality options (cubemap size):
|
quality options (cubemap size):
|
||||||
- low (256)
|
- low (256)
|
||||||
- medium (512)
|
- medium (512)
|
||||||
- high/1k (1024)
|
- high/1k (1024)
|
||||||
- 2k (2048)
|
- 2k (2048)
|
||||||
- 4k (4096)
|
- 4k (4096)
|
||||||
- 8k (8192)
|
- 8k (8192)
|
||||||
tilt specifies the dome tilt angle in degrees from the horizontal
|
tilt specifies the dome tilt angle in degrees from the horizontal
|
||||||
-->
|
-->
|
||||||
<Viewport name="fisheye">
|
<Viewport name="fisheye">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
|
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
|
||||||
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
|
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
|
||||||
</FisheyeProjection>
|
</FisheyeProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.06">
|
<User eyeSeparation="0.06">
|
||||||
<Pos x="0.0" y="0.0" z="0.0" />
|
<Pos x="0.0" y="0.0" z="0.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost">
|
<Cluster masterAddress="localhost">
|
||||||
<!-- <Scene>
|
<!-- <Scene>
|
||||||
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
|
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
|
||||||
<Offset x="0.0" y="0.0" z="0.0" />
|
<Offset x="0.0" y="0.0" z="0.0" />
|
||||||
<Scale value="1.0" />
|
<Scale value="1.0" />
|
||||||
</Scene> -->
|
</Scene> -->
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window fullScreen="false" name="OpenSpace">
|
<Window fullScreen="false" name="OpenSpace">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<!-- 16:9 aspect ratio -->
|
<!-- 16:9 aspect ratio -->
|
||||||
<Size x="1024" y="1024" />
|
<Size x="1024" y="1024" />
|
||||||
<!-- Frame buffer resolution
|
<!-- Frame buffer resolution
|
||||||
<Res x="4096" y="4096" /> -->
|
<Res x="4096" y="4096" /> -->
|
||||||
<!--
|
<!--
|
||||||
quality options (cubemap size):
|
quality options (cubemap size):
|
||||||
- low (256)
|
- low (256)
|
||||||
- medium (512)
|
- medium (512)
|
||||||
- high/1k (1024)
|
- high/1k (1024)
|
||||||
- 2k (2048)
|
- 2k (2048)
|
||||||
- 4k (4096)
|
- 4k (4096)
|
||||||
- 8k (8192)
|
- 8k (8192)
|
||||||
tilt specifies the dome tilt angle in degrees from the horizontal
|
tilt specifies the dome tilt angle in degrees from the horizontal
|
||||||
-->
|
-->
|
||||||
<Viewport name="fisheye">
|
<Viewport name="fisheye">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
|
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
|
||||||
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
|
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
|
||||||
</FisheyeProjection>
|
</FisheyeProjection>
|
||||||
</Viewport>
|
</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>
|
|
||||||
</Window>
|
</Window>
|
||||||
|
|
||||||
</Node>
|
|
||||||
<User eyeSeparation="0.06">
|
<Window fullScreen="false" name="GUI" tags="GUI">
|
||||||
<Pos x="0.0" y="0.0" z="0.0" />
|
<Stereo type="none" />
|
||||||
</User>
|
<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>
|
</Cluster>
|
||||||
|
|||||||
+30
-30
@@ -1,33 +1,33 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost" externalControlPort="20500">
|
<Cluster masterAddress="localhost" externalControlPort="20500">
|
||||||
<Settings>
|
<Settings>
|
||||||
<Display swapInterval="0" />
|
<Display swapInterval="0" />
|
||||||
</Settings>
|
</Settings>
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window fullScreen="false" name="OpenSpace">
|
<Window fullScreen="false" name="OpenSpace">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Pos x="50" y="50" />
|
<Pos x="50" y="50" />
|
||||||
<Viewport tracked="true">
|
<Viewport tracked="true">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
<Window fullScreen="false" name="GUI" tags="GUI">
|
<Window fullScreen="false" name="GUI" tags="GUI">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Pos x="50" y="50" />
|
<Pos x="50" y="50" />
|
||||||
<Viewport>
|
<Viewport>
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.065">
|
<User eyeSeparation="0.065">
|
||||||
<Pos x="0.0" y="0.0" z="0.0" />
|
<Pos x="0.0" y="0.0" z="0.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost">
|
<Cluster masterAddress="localhost">
|
||||||
<Node address="localhost" port="20401">
|
<Node address="localhost" port="20401">
|
||||||
<Window fullScreen="false">
|
<Window fullScreen="false">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Pos x="200" y="300" />
|
<Pos x="200" y="300" />
|
||||||
<!-- 16:9 aspect ratio -->
|
<!-- 16:9 aspect ratio -->
|
||||||
<Size x="1280" y="360" />
|
<Size x="1280" y="360" />
|
||||||
<Viewport eye="left">
|
<Viewport eye="left">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="0.5" y="1.0" />
|
<Size x="0.5" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
<Viewport eye="right">
|
<Viewport eye="right">
|
||||||
<Pos x="0.5" y="0.0" />
|
<Pos x="0.5" y="0.0" />
|
||||||
<Size x="0.5" y="1.0" />
|
<Size x="0.5" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.06">
|
<User eyeSeparation="0.06">
|
||||||
<Pos x="0.0" y="0.0" z="0.0" />
|
<Pos x="0.0" y="0.0" z="0.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
+29
-29
@@ -1,32 +1,32 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="127.0.0.1">
|
<Cluster masterAddress="127.0.0.1">
|
||||||
<Node address="127.0.0.1" port="20401">
|
<Node address="127.0.0.1" port="20401">
|
||||||
<Window fullScreen="false" border="true">
|
<Window fullScreen="false" border="true">
|
||||||
<Pos x="10" y="100" />
|
<Pos x="10" y="100" />
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Viewport tracked="true">
|
<Viewport tracked="true">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
<Window fullScreen="false" border="true">
|
<Window fullScreen="false" border="true">
|
||||||
<Pos x="340" y="100" />
|
<Pos x="340" y="100" />
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Viewport>
|
<Viewport>
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.065">
|
<User eyeSeparation="0.065">
|
||||||
<Pos x="0.0" y="0.0" z="4.0" />
|
<Pos x="0.0" y="0.0" z="4.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
+32
-32
@@ -1,34 +1,34 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="127.0.0.1">
|
<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">
|
<Window fullscreen="false" name="Spherical Projection">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Pos x="0" y="100" />
|
<Pos x="0" y="100" />
|
||||||
<!-- 16:9 aspect ratio -->
|
<!-- 16:9 aspect ratio -->
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Res x="2048" y="2048" />
|
<Res x="2048" y="2048" />
|
||||||
<!--
|
<!--
|
||||||
quality options (cubemap size):
|
quality options (cubemap size):
|
||||||
- low (256)
|
- low (256)
|
||||||
- medium (512)
|
- medium (512)
|
||||||
- high/1k (1024)
|
- high/1k (1024)
|
||||||
- 2k (2048)
|
- 2k (2048)
|
||||||
- 4k (4096)
|
- 4k (4096)
|
||||||
- 8k (8192)
|
- 8k (8192)
|
||||||
tilt specifies the dome tilt angle in degrees from the horizontal
|
tilt specifies the dome tilt angle in degrees from the horizontal
|
||||||
-->
|
-->
|
||||||
<!-- mesh path is relative to working directory-->
|
<!-- mesh path is relative to working directory-->
|
||||||
<!-- NOTE, if no working directory is set, mesh must be absolute path -->
|
<!-- NOTE, if no working directory is set, mesh must be absolute path -->
|
||||||
<Viewport name="warped fisheye" mesh="config/mesh/standard_16x9.data">
|
<Viewport name="warped fisheye" mesh="config/mesh/standard_16x9.data">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<FisheyeProjection fov="180" quality="2k" tilt="30.0">
|
<FisheyeProjection fov="180" quality="2k" tilt="30.0">
|
||||||
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
|
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
|
||||||
</FisheyeProjection>
|
</FisheyeProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.06">
|
<User eyeSeparation="0.06">
|
||||||
<Pos x="0.0" y="0.0" z="0.0" />
|
<Pos x="0.0" y="0.0" z="0.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="127.0.0.1">
|
<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">
|
<Window fullscreen="false" name="Spherical Projection">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Pos x="0" y="100" />
|
<Pos x="0" y="100" />
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</FisheyeProjection>
|
</FisheyeProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
<Window fullScreen="false" name="GUI" tags="GUI">
|
<Window fullscreen="false" name="GUI" tags="GUI">
|
||||||
<Stereo type="none" />
|
<Stereo type="none" />
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Res x="2048" y="2048" />
|
<Res x="2048" y="2048" />
|
||||||
|
|||||||
+16
-26
@@ -1,29 +1,19 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="localhost">
|
<Cluster masterAddress="localhost">
|
||||||
<!-- <Settings>
|
<Node address="localhost" port="20401">
|
||||||
<Display swapInterval="0" />
|
<Window fullscreen="false" name="OpenSpace">
|
||||||
</Settings>
|
<Stereo type="none" />
|
||||||
-->
|
<Size x="1024" y="1024" />
|
||||||
<!-- <Scene>
|
<Viewport name="Spout">
|
||||||
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Offset x="0.0" y="0.0" z="0.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<Scale value="1.0" />
|
<SpoutOutputProjection quality="1.5k">
|
||||||
</Scene>
|
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
|
||||||
-->
|
</SpoutOutputProjection>
|
||||||
<Node address="localhost" port="20401">
|
</Viewport>
|
||||||
<Window fullScreen="false" name="OpenSpace">
|
</Window>
|
||||||
<Stereo type="none" />
|
</Node>
|
||||||
<Size x="1024" y="1024" />
|
<User eyeSeparation="0.06">
|
||||||
<Viewport name="Spout">
|
<Pos x="0.0" y="0.0" z="0.0" />
|
||||||
<Pos x="0.0" y="0.0" />
|
</User>
|
||||||
<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>
|
</Cluster>
|
||||||
|
|||||||
+33
-38
@@ -1,41 +1,36 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<Cluster masterAddress="127.0.0.1">
|
<Cluster masterAddress="127.0.0.1">
|
||||||
<Node address="127.0.0.1" port="20401">
|
<Node address="127.0.0.1" port="20401">
|
||||||
<Window fullScreen="false">
|
<Window fullscreen="false">
|
||||||
<Pos x="0" y="300" />
|
<Pos x="0" y="300" />
|
||||||
<!-- 16:9 aspect ratio -->
|
<!-- 16:9 aspect ratio -->
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Viewport tracked="true">
|
<Viewport tracked="true">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<Node address="127.0.0.2" port="20402">
|
<Node address="127.0.0.2" port="20402">
|
||||||
<Window fullScreen="false">
|
<Window fullscreen="false">
|
||||||
<Pos x="640" y="300" />
|
<Pos x="640" y="300" />
|
||||||
<!-- 16:9 aspect ratio -->
|
<!-- 16:9 aspect ratio -->
|
||||||
<Size x="1280" y="720" />
|
<Size x="1280" y="720" />
|
||||||
<Viewport tracked="true">
|
<Viewport tracked="true">
|
||||||
<Pos x="0.0" y="0.0" />
|
<Pos x="0.0" y="0.0" />
|
||||||
<Size x="1.0" y="1.0" />
|
<Size x="1.0" y="1.0" />
|
||||||
<PlanarProjection>
|
<PlanarProjection>
|
||||||
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
<FOV down="25.267007923362" left="40.0" right="40.0" up="25.267007923362" />
|
||||||
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
|
||||||
</PlanarProjection>
|
</PlanarProjection>
|
||||||
</Viewport>
|
</Viewport>
|
||||||
</Window>
|
</Window>
|
||||||
</Node>
|
</Node>
|
||||||
<User eyeSeparation="0.065">
|
<User eyeSeparation="0.065">
|
||||||
<Pos x="0.0" y="0.0" z="4.0" />
|
<Pos x="0.0" y="0.0" z="4.0" />
|
||||||
</User>
|
</User>
|
||||||
</Cluster>
|
</Cluster>
|
||||||
<!--
|
|
||||||
Usage:
|
|
||||||
for master: <executable> -local 0
|
|
||||||
for slave: <executable> -local 1 --slave
|
|
||||||
-->
|
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -2,7 +2,6 @@ asset.require('./base')
|
|||||||
|
|
||||||
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
|
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
|
||||||
asset.require('scene/solarsystem/planets/earth/satellites/satellites.asset')
|
asset.require('scene/solarsystem/planets/earth/satellites/satellites.asset')
|
||||||
asset.require('scene/solarsystem/sssb/pha')
|
|
||||||
|
|
||||||
asset.onInitialize(function ()
|
asset.onInitialize(function ()
|
||||||
local now = openspace.time.currentWallTime()
|
local now = openspace.time.currentWallTime()
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
asset.request('./satellites_interesting')
|
asset.require('./satellites_interesting')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
asset.request('./misc/brightest')
|
asset.require('./misc/brightest')
|
||||||
asset.request('./communications/geostationary')
|
asset.require('./communications/geostationary')
|
||||||
asset.request('./navigation/gps')
|
asset.require('./navigation/gps')
|
||||||
asset.request('./misc/spacestations')
|
asset.require('./misc/spacestations')
|
||||||
asset.request('./misc/iss')
|
asset.require('./misc/iss')
|
||||||
asset.request('./misc/tle-new')
|
asset.require('./misc/tle-new')
|
||||||
|
|||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -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 })
|
||||||
@@ -2,7 +2,9 @@ local assetHelper = asset.require('util/asset_helper')
|
|||||||
local sharedSssb = asset.require('./sssb_shared')
|
local sharedSssb = asset.require('./sssb_shared')
|
||||||
|
|
||||||
local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'pha', 'sssb_data_pha')
|
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.Enabled = false
|
||||||
|
object.Renderable.SegmentQuality = 3
|
||||||
|
object.Renderable.TrailFade = 17
|
||||||
|
|
||||||
assetHelper.registerSceneGraphNodesAndExport(asset, { object })
|
assetHelper.registerSceneGraphNodesAndExport(asset, { object })
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function downloadSssbDatabaseFile(sceneAsset, name, identifier)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local createSssbGroupObject = function(filename, sssbFolder, trailColor)
|
local createSssbGroupObject = function(filename, guiName, sssbFolder, trailColor)
|
||||||
assert(filename, "'filename' needs to be provided")
|
assert(filename, "'filename' needs to be provided")
|
||||||
assert(sssbFolder, "'sssbFolder' needs to be provided")
|
assert(sssbFolder, "'sssbFolder' needs to be provided")
|
||||||
trailColor = trailColor or { 0.75, 0.1, 0.1 }
|
trailColor = trailColor or { 0.75, 0.1, 0.1 }
|
||||||
@@ -27,10 +27,11 @@ local createSssbGroupObject = function(filename, sssbFolder, trailColor)
|
|||||||
Path = sssbFolder.."/"..filename,
|
Path = sssbFolder.."/"..filename,
|
||||||
Segments = 200,
|
Segments = 200,
|
||||||
Color = trailColor,
|
Color = trailColor,
|
||||||
Fade = 0.5,
|
TrailFade = 0.5,
|
||||||
},
|
},
|
||||||
GUI = {
|
GUI = {
|
||||||
Path = "/Solar System/Small Solar System Body"
|
Path = "/Solar System/Small Bodies",
|
||||||
|
Name = guiName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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 })
|
||||||
@@ -11,7 +11,8 @@ function downloadTLEFile(sceneAsset, url, name, filename)
|
|||||||
Name = "Satellite TLE Data (" .. name .. ")",
|
Name = "Satellite TLE Data (" .. name .. ")",
|
||||||
Type = "UrlSynchronization",
|
Type = "UrlSynchronization",
|
||||||
Identifier = "satellite_tle_data_" .. identifier,
|
Identifier = "satellite_tle_data_" .. identifier,
|
||||||
Url = url
|
Url = url,
|
||||||
|
Override = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filename ~= '') then
|
if (filename ~= '') then
|
||||||
@@ -81,7 +82,7 @@ function satellites(title, file, color, group)
|
|||||||
Renderable = {
|
Renderable = {
|
||||||
Type = "RenderableSatellites",
|
Type = "RenderableSatellites",
|
||||||
Path = file,
|
Path = file,
|
||||||
Segments = 120,
|
SegmentQuality = 3,
|
||||||
Color = color,
|
Color = color,
|
||||||
Fade = 1.5
|
Fade = 1.5
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
Submodule ext/ghoul updated: 0461bf1f44...df1522a1fe
@@ -122,7 +122,8 @@ static VersionChecker& versionChecker = detail::gVersionChecker();
|
|||||||
static VirtualPropertyManager& virtualPropertyManager = detail::gVirtualPropertyManager();
|
static VirtualPropertyManager& virtualPropertyManager = detail::gVirtualPropertyManager();
|
||||||
static WindowDelegate& windowDelegate = detail::gWindowDelegate();
|
static WindowDelegate& windowDelegate = detail::gWindowDelegate();
|
||||||
static configuration::Configuration& configuration = detail::gConfiguration();
|
static configuration::Configuration& configuration = detail::gConfiguration();
|
||||||
static interaction::InteractionMonitor& interactionMonitor = detail::gInteractionMonitor();
|
static interaction::InteractionMonitor& interactionMonitor =
|
||||||
|
detail::gInteractionMonitor();
|
||||||
static interaction::JoystickInputStates& joystickInputStates =
|
static interaction::JoystickInputStates& joystickInputStates =
|
||||||
detail::gJoystickInputStates();
|
detail::gJoystickInputStates();
|
||||||
static interaction::WebsocketInputStates& websocketInputStates =
|
static interaction::WebsocketInputStates& websocketInputStates =
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ public:
|
|||||||
void touchDetectionCallback(TouchInput input);
|
void touchDetectionCallback(TouchInput input);
|
||||||
void touchUpdateCallback(TouchInput input);
|
void touchUpdateCallback(TouchInput input);
|
||||||
void touchExitCallback(TouchInput input);
|
void touchExitCallback(TouchInput input);
|
||||||
std::vector<char> encode();
|
std::vector<std::byte> encode();
|
||||||
void decode(std::vector<char> data);
|
void decode(std::vector<std::byte> data);
|
||||||
|
|
||||||
void scheduleLoadSingleAsset(std::string assetPath);
|
void scheduleLoadSingleAsset(std::string assetPath);
|
||||||
void toggleShutdownMode();
|
void toggleShutdownMode();
|
||||||
@@ -120,6 +120,8 @@ private:
|
|||||||
bool _hasScheduledAssetLoading = false;
|
bool _hasScheduledAssetLoading = false;
|
||||||
std::string _scheduledAssetPathToLoad;
|
std::string _scheduledAssetPathToLoad;
|
||||||
|
|
||||||
|
glm::vec2 _mousePosition;
|
||||||
|
|
||||||
//grabs json from each module to pass to the documentation engine.
|
//grabs json from each module to pass to the documentation engine.
|
||||||
std::string _documentationJson;
|
std::string _documentationJson;
|
||||||
|
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ public:
|
|||||||
* Encodes all added Syncables in the injected <code>SyncBuffer</code>.
|
* Encodes all added Syncables in the injected <code>SyncBuffer</code>.
|
||||||
* This method is only called on the SGCT master node
|
* 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.
|
* Decodes the <code>SyncBuffer</code> into the added Syncables.
|
||||||
* This method is only called on the SGCT slave nodes
|
* 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
|
* Invokes the presync method of all added Syncables
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ struct WindowDelegate {
|
|||||||
|
|
||||||
void (*setSynchronization)(bool enabled) = [](bool) {};
|
void (*setSynchronization)(bool enabled) = [](bool) {};
|
||||||
|
|
||||||
void (*clearAllWindows)(const glm::vec4& clearColor) = [](const glm::vec4&) {};
|
|
||||||
|
|
||||||
bool (*windowHasResized)() = []() { return false; };
|
bool (*windowHasResized)() = []() { return false; };
|
||||||
|
|
||||||
double (*averageDeltaTime)() = []() { return 0.0; };
|
double (*averageDeltaTime)() = []() { return 0.0; };
|
||||||
@@ -56,52 +54,29 @@ struct WindowDelegate {
|
|||||||
|
|
||||||
double (*applicationTime)() = []() { return 0.0; };
|
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 (*currentWindowSize)() = []() { return glm::ivec2(0); };
|
||||||
|
|
||||||
glm::ivec2 (*currentSubwindowSize)() = []() { 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 (*currentDrawBufferResolution)() = []() { return glm::ivec2(0); };
|
||||||
|
|
||||||
glm::ivec2 (*currentViewportSize)() = []() { return glm::ivec2(0); };
|
glm::ivec2 (*currentViewportSize)() = []() { return glm::ivec2(0); };
|
||||||
|
|
||||||
glm::vec2 (*dpiScaling)() = []() { return glm::vec2(1.f); };
|
glm::vec2 (*dpiScaling)() = []() { return glm::vec2(1.f); };
|
||||||
|
|
||||||
int (*currentNumberOfAaSamples)() = []() { return 1; };
|
|
||||||
|
|
||||||
bool (*hasGuiWindow)() = []() { return false; };
|
bool (*hasGuiWindow)() = []() { return false; };
|
||||||
|
|
||||||
bool (*isGuiWindow)() = []() { return false; };
|
bool (*isGuiWindow)() = []() { return false; };
|
||||||
|
|
||||||
bool (*isMaster)() = []() { return false; };
|
bool (*isMaster)() = []() { return true; };
|
||||||
|
|
||||||
int (*clusterId)() = []() { return 0; };
|
|
||||||
|
|
||||||
bool (*isUsingSwapGroups)() = []() { return false; };
|
|
||||||
|
|
||||||
bool (*isSwapGroupMaster)() = []() { return false; };
|
|
||||||
|
|
||||||
glm::mat4 (*viewProjectionMatrix)() = []() { return glm::mat4(1.f); };
|
|
||||||
|
|
||||||
glm::mat4 (*modelMatrix)() = []() { return glm::mat4(1.f); };
|
glm::mat4 (*modelMatrix)() = []() { return glm::mat4(1.f); };
|
||||||
|
|
||||||
void (*setNearFarClippingPlane)(float near, float far) = [](float, float) {};
|
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; };
|
bool (*isFisheyeRendering)() = []() { return false; };
|
||||||
|
|
||||||
unsigned int(*takeScreenshot)(bool applyWarping) = [](bool) { return 0u; };
|
unsigned int (*takeScreenshot)(bool applyWarping) = [](bool) { return 0u; };
|
||||||
|
|
||||||
void (*swapBuffer)() = []() {};
|
void (*swapBuffer)() = []() {};
|
||||||
|
|
||||||
@@ -112,9 +87,9 @@ struct WindowDelegate {
|
|||||||
double (*getHorizFieldOfView)() = []() { return 0.0; };
|
double (*getHorizFieldOfView)() = []() { return 0.0; };
|
||||||
|
|
||||||
void (*setHorizFieldOfView)(float hFovDeg) = [](float) { };
|
void (*setHorizFieldOfView)(float hFovDeg) = [](float) { };
|
||||||
|
|
||||||
void* (*getNativeWindowHandle)(size_t windowIndex) = [](size_t) -> void* {
|
void* (*getNativeWindowHandle)(size_t windowIndex) = [](size_t) -> void* {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
using GLProcAddress = void(*)(void);
|
using GLProcAddress = void(*)(void);
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ public:
|
|||||||
MouseCameraStates(double sensitivity, double velocityScaleFactor);
|
MouseCameraStates(double sensitivity, double velocityScaleFactor);
|
||||||
|
|
||||||
void updateStateFromInput(const InputState& inputState, double deltaTime) override;
|
void updateStateFromInput(const InputState& inputState, double deltaTime) override;
|
||||||
|
|
||||||
|
void setInvertMouseButton(bool value);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool _isMouseButtonInverted = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace openspace::interaction
|
} // namespace openspace::interaction
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public:
|
|||||||
WebsocketCameraStates::AxisInvert::No,
|
WebsocketCameraStates::AxisInvert::No,
|
||||||
WebsocketCameraStates::AxisNormalize shouldNormalize =
|
WebsocketCameraStates::AxisNormalize shouldNormalize =
|
||||||
WebsocketCameraStates::AxisNormalize::No);
|
WebsocketCameraStates::AxisNormalize::No);
|
||||||
|
|
||||||
NavigationState navigationState() const;
|
NavigationState navigationState() const;
|
||||||
NavigationState navigationState(const SceneGraphNode& referenceFrame) const;
|
NavigationState navigationState(const SceneGraphNode& referenceFrame) const;
|
||||||
|
|
||||||
|
|||||||
@@ -79,10 +79,10 @@ public:
|
|||||||
|
|
||||||
JoystickCameraStates& joystickStates();
|
JoystickCameraStates& joystickStates();
|
||||||
const JoystickCameraStates& joystickStates() const;
|
const JoystickCameraStates& joystickStates() const;
|
||||||
|
|
||||||
WebsocketCameraStates& websocketStates();
|
WebsocketCameraStates& websocketStates();
|
||||||
const WebsocketCameraStates& websocketStates() const;
|
const WebsocketCameraStates& websocketStates() const;
|
||||||
|
|
||||||
ScriptCameraStates& scriptStates();
|
ScriptCameraStates& scriptStates();
|
||||||
const ScriptCameraStates& scriptStates() const;
|
const ScriptCameraStates& scriptStates() const;
|
||||||
|
|
||||||
@@ -160,6 +160,8 @@ private:
|
|||||||
properties::FloatProperty _stereoInterpolationTime;
|
properties::FloatProperty _stereoInterpolationTime;
|
||||||
properties::FloatProperty _followRotationInterpolationTime;
|
properties::FloatProperty _followRotationInterpolationTime;
|
||||||
|
|
||||||
|
properties::BoolProperty _invertMouseButtons;
|
||||||
|
|
||||||
MouseCameraStates _mouseStates;
|
MouseCameraStates _mouseStates;
|
||||||
JoystickCameraStates _joystickStates;
|
JoystickCameraStates _joystickStates;
|
||||||
WebsocketCameraStates _websocketStates;
|
WebsocketCameraStates _websocketStates;
|
||||||
@@ -246,19 +248,22 @@ private:
|
|||||||
* Translates the horizontal direction. If far from the anchor object, this will
|
* 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
|
* result in an orbital rotation around the object. This function does not affect the
|
||||||
* rotation but only the position.
|
* 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,
|
glm::dvec3 translateHorizontally(double deltaTime, const glm::dvec3& cameraPosition,
|
||||||
const glm::dvec3& objectPosition, const glm::dquat& globalCameraRotation,
|
const glm::dvec3& objectPosition, const glm::dquat& globalCameraRotation,
|
||||||
const SurfacePositionHandle& positionHandle) const;
|
const SurfacePositionHandle& positionHandle) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the camera along a vector, camPosToCenterPosDiff, until it reaches the focusLimit.
|
* Moves the camera along a vector, camPosToCenterPosDiff, until it reaches the
|
||||||
* The velocity of the zooming depend on distFromCameraToFocus and the final frame
|
* focusLimit. The velocity of the zooming depend on distFromCameraToFocus and the
|
||||||
* where the camera stops moving depends on the distance set in the variable focusLimit.
|
* final frame where the camera stops moving depends on the distance set in the
|
||||||
* The bool determines whether to move/fly towards the focus node or away from it.
|
* variable focusLimit. The bool determines whether to move/fly towards the focus node
|
||||||
* \returns a new position of the camera, closer to the focusLimit than the previous
|
* or away from it.
|
||||||
* position.
|
*
|
||||||
|
* \return a new position of the camera, closer to the focusLimit than the previous
|
||||||
|
* position
|
||||||
*/
|
*/
|
||||||
glm::dvec3 moveCameraAlongVector(const glm::dvec3& camPos,
|
glm::dvec3 moveCameraAlongVector(const glm::dvec3& camPos,
|
||||||
double distFromCameraToFocus, const glm::dvec3& camPosToCenterPosDiff,
|
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
|
* Adds rotation to the camera position so that it follows the rotation of the anchor
|
||||||
* node defined by the differential anchorNodeRotationDiff.
|
* 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,
|
glm::dvec3 followAnchorNodeRotation(const glm::dvec3& cameraPosition,
|
||||||
const glm::dvec3& objectPosition, const glm::dquat& anchorNodeRotationDiff) const;
|
const glm::dvec3& objectPosition, const glm::dquat& anchorNodeRotationDiff) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the global rotation so that it points towards the anchor node.
|
* 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,
|
glm::dquat rotateGlobally(const glm::dquat& globalCameraRotation,
|
||||||
const glm::dquat& aimNodeRotationDiff,
|
const glm::dquat& aimNodeRotationDiff,
|
||||||
@@ -290,7 +297,8 @@ private:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Rotates the camera around the out vector of the surface.
|
* 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,
|
glm::dquat rotateHorizontally(double deltaTime,
|
||||||
const glm::dquat& globalCameraRotation,
|
const glm::dquat& globalCameraRotation,
|
||||||
@@ -298,8 +306,9 @@ private:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Push the camera out to the surface of the object.
|
* 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,
|
glm::dvec3 pushToSurface(double minHeightAboveGround,
|
||||||
const glm::dvec3& cameraPosition, const glm::dvec3& objectPosition,
|
const glm::dvec3& cameraPosition, const glm::dvec3& objectPosition,
|
||||||
|
|||||||
@@ -106,7 +106,8 @@ private:
|
|||||||
namespace ghoul {
|
namespace ghoul {
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
std::string to_string(const openspace::interaction::WebsocketCameraStates::AxisType& type);
|
std::string to_string(
|
||||||
|
const openspace::interaction::WebsocketCameraStates::AxisType& type);
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
openspace::interaction::WebsocketCameraStates::AxisType
|
openspace::interaction::WebsocketCameraStates::AxisType
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ constexpr const int MaxWebsockets = 16;
|
|||||||
struct WebsocketInputStates : public std::unordered_map<size_t, WebsocketInputState*> {
|
struct WebsocketInputStates : public std::unordered_map<size_t, WebsocketInputState*> {
|
||||||
/**
|
/**
|
||||||
* This function adds the contributions of all connected websockets for the provided
|
* 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].
|
* \p axis. After adding each websockets contribution, the result is clamped to
|
||||||
* If a websocket does not possess a particular axis, it's does not contribute to the
|
* [-1,1]. If a websocket does not possess a particular axis, it's does not contribute
|
||||||
* sum.
|
* to the sum.
|
||||||
*
|
*
|
||||||
* \param axis The numerical axis for which the values are added
|
* \param axis The numerical axis for which the values are added
|
||||||
* \return The summed axis values of all connected websockets
|
* \return The summed axis values of all connected websockets
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ public:
|
|||||||
void setLightness(float lightness) override;
|
void setLightness(float lightness) override;
|
||||||
void setColorSpace(unsigned int colorspace) override;
|
void setColorSpace(unsigned int colorspace) override;
|
||||||
|
|
||||||
|
|
||||||
void enableBloom(bool enable) override;
|
void enableBloom(bool enable) override;
|
||||||
void enableHistogram(bool enable) override;
|
void enableHistogram(bool enable) override;
|
||||||
|
|
||||||
|
|||||||
@@ -71,17 +71,17 @@ public:
|
|||||||
void updateHDRAndFiltering();
|
void updateHDRAndFiltering();
|
||||||
void updateFXAA();
|
void updateFXAA();
|
||||||
void updateDownscaledVolume();
|
void updateDownscaledVolume();
|
||||||
|
|
||||||
void setResolution(glm::ivec2 res) override;
|
void setResolution(glm::ivec2 res) override;
|
||||||
void setHDRExposure(float hdrExposure) override;
|
void setHDRExposure(float hdrExposure) override;
|
||||||
void setGamma(float gamma) override;
|
void setGamma(float gamma) override;
|
||||||
void setHue(float hue) override;
|
void setHue(float hue) override;
|
||||||
void setValue(float value) override;
|
void setValue(float value) override;
|
||||||
void setSaturation(float sat) override;
|
void setSaturation(float sat) override;
|
||||||
|
|
||||||
void enableFXAA(bool enable) override;
|
void enableFXAA(bool enable) override;
|
||||||
void setDisableHDR(bool disable) override;
|
void setDisableHDR(bool disable) override;
|
||||||
|
|
||||||
void update() override;
|
void update() override;
|
||||||
void performRaycasterTasks(const std::vector<RaycasterTask>& tasks);
|
void performRaycasterTasks(const std::vector<RaycasterTask>& tasks);
|
||||||
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks);
|
void performDeferredTasks(const std::vector<DeferredcasterTask>& tasks);
|
||||||
@@ -114,7 +114,7 @@ private:
|
|||||||
void updateDownscaleTextures();
|
void updateDownscaleTextures();
|
||||||
void updateExitVolumeTextures();
|
void updateExitVolumeTextures();
|
||||||
void writeDownscaledVolume();
|
void writeDownscaledVolume();
|
||||||
|
|
||||||
std::map<VolumeRaycaster*, RaycastData> _raycastData;
|
std::map<VolumeRaycaster*, RaycastData> _raycastData;
|
||||||
RaycasterProgObjMap _exitPrograms;
|
RaycasterProgObjMap _exitPrograms;
|
||||||
RaycasterProgObjMap _raycastPrograms;
|
RaycasterProgObjMap _raycastPrograms;
|
||||||
@@ -131,7 +131,7 @@ private:
|
|||||||
UniformCache(hdrFeedingTexture, blackoutFactor, hdrExposure, gamma,
|
UniformCache(hdrFeedingTexture, blackoutFactor, hdrExposure, gamma,
|
||||||
Hue, Saturation, Value) _hdrUniformCache;
|
Hue, Saturation, Value) _hdrUniformCache;
|
||||||
UniformCache(renderedTexture, inverseScreenSize) _fxaaUniformCache;
|
UniformCache(renderedTexture, inverseScreenSize) _fxaaUniformCache;
|
||||||
UniformCache(downscaledRenderedVolume, downscaledRenderedVolumeDepth)
|
UniformCache(downscaledRenderedVolume, downscaledRenderedVolumeDepth)
|
||||||
_writeDownscaledVolumeUniformCache;
|
_writeDownscaledVolumeUniformCache;
|
||||||
|
|
||||||
GLint _defaultFBO;
|
GLint _defaultFBO;
|
||||||
@@ -158,7 +158,7 @@ private:
|
|||||||
GLuint hdrFilteringFramebuffer;
|
GLuint hdrFilteringFramebuffer;
|
||||||
GLuint hdrFilteringTexture;
|
GLuint hdrFilteringTexture;
|
||||||
} _hdrBuffers;
|
} _hdrBuffers;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
GLuint fxaaFramebuffer;
|
GLuint fxaaFramebuffer;
|
||||||
GLuint fxaaTexture;
|
GLuint fxaaTexture;
|
||||||
@@ -176,18 +176,18 @@ private:
|
|||||||
bool _dirtyDeferredcastData;
|
bool _dirtyDeferredcastData;
|
||||||
bool _dirtyRaycastData;
|
bool _dirtyRaycastData;
|
||||||
bool _dirtyResolution;
|
bool _dirtyResolution;
|
||||||
|
|
||||||
glm::ivec2 _resolution = glm::ivec2(0);
|
glm::ivec2 _resolution = glm::ivec2(0);
|
||||||
int _nAaSamples;
|
int _nAaSamples;
|
||||||
bool _enableFXAA = true;
|
bool _enableFXAA = true;
|
||||||
bool _disableHDR = false;
|
bool _disableHDR = false;
|
||||||
|
|
||||||
float _hdrExposure = 3.7f;
|
float _hdrExposure = 3.7f;
|
||||||
float _gamma = 0.95f;
|
float _gamma = 0.95f;
|
||||||
float _hue = 1.f;
|
float _hue = 1.f;
|
||||||
float _saturation = 1.f;
|
float _saturation = 1.f;
|
||||||
float _value = 1.f;
|
float _value = 1.f;
|
||||||
|
|
||||||
ghoul::Dictionary _rendererData;
|
ghoul::Dictionary _rendererData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ private:
|
|||||||
properties::BoolProperty _disableMasterRendering;
|
properties::BoolProperty _disableMasterRendering;
|
||||||
|
|
||||||
properties::FloatProperty _globalBlackOutFactor;
|
properties::FloatProperty _globalBlackOutFactor;
|
||||||
|
|
||||||
properties::BoolProperty _enableFXAA;
|
properties::BoolProperty _enableFXAA;
|
||||||
|
|
||||||
properties::BoolProperty _disableHDRPipeline;
|
properties::BoolProperty _disableHDRPipeline;
|
||||||
@@ -221,13 +221,13 @@ private:
|
|||||||
properties::FloatProperty _hue;
|
properties::FloatProperty _hue;
|
||||||
properties::FloatProperty _saturation;
|
properties::FloatProperty _saturation;
|
||||||
properties::FloatProperty _value;
|
properties::FloatProperty _value;
|
||||||
|
|
||||||
properties::FloatProperty _horizFieldOfView;
|
properties::FloatProperty _horizFieldOfView;
|
||||||
|
|
||||||
properties::Vec3Property _globalRotation;
|
properties::Vec3Property _globalRotation;
|
||||||
properties::Vec3Property _screenSpaceRotation;
|
properties::Vec3Property _screenSpaceRotation;
|
||||||
properties::Vec3Property _masterRotation;
|
properties::Vec3Property _masterRotation;
|
||||||
|
|
||||||
uint64_t _frameNumber = 0;
|
uint64_t _frameNumber = 0;
|
||||||
unsigned int _latestScreenshotNumber = 0;
|
unsigned int _latestScreenshotNumber = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public:
|
|||||||
|
|
||||||
private:
|
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;
|
int _rayCastMaxSteps = 1000;
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ public:
|
|||||||
|
|
||||||
virtual bool initialize();
|
virtual bool initialize();
|
||||||
|
|
||||||
double scaleValue() const;
|
glm::dvec3 scaleValue() const;
|
||||||
virtual double scaleValue(const UpdateData& data) const = 0;
|
virtual glm::dvec3 scaleValue(const UpdateData& data) const = 0;
|
||||||
virtual void update(const UpdateData& data);
|
virtual void update(const UpdateData& data);
|
||||||
|
|
||||||
static documentation::Documentation Documentation();
|
static documentation::Documentation Documentation();
|
||||||
@@ -60,7 +60,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
bool _needsUpdate = true;
|
bool _needsUpdate = true;
|
||||||
double _cachedTime = -std::numeric_limits<double>::max();
|
double _cachedTime = -std::numeric_limits<double>::max();
|
||||||
double _cachedScale = 1.0;
|
glm::dvec3 _cachedScale = glm::dvec3(1.0);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace openspace
|
} // namespace openspace
|
||||||
|
|||||||
@@ -122,13 +122,13 @@ public:
|
|||||||
|
|
||||||
glm::dvec3 position() const;
|
glm::dvec3 position() const;
|
||||||
const glm::dmat3& rotationMatrix() const;
|
const glm::dmat3& rotationMatrix() const;
|
||||||
double scale() const;
|
glm::dvec3 scale() const;
|
||||||
|
|
||||||
glm::dvec3 worldPosition() const;
|
glm::dvec3 worldPosition() const;
|
||||||
const glm::dmat3& worldRotationMatrix() const;
|
const glm::dmat3& worldRotationMatrix() const;
|
||||||
glm::dmat4 modelTransform() const;
|
glm::dmat4 modelTransform() const;
|
||||||
glm::dmat4 inverseModelTransform() const;
|
glm::dmat4 inverseModelTransform() const;
|
||||||
double worldScale() const;
|
glm::dvec3 worldScale() const;
|
||||||
bool isTimeFrameActive(const Time& time) const;
|
bool isTimeFrameActive(const Time& time) const;
|
||||||
|
|
||||||
SceneGraphNode* parent() const;
|
SceneGraphNode* parent() const;
|
||||||
@@ -152,7 +152,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
glm::dvec3 calculateWorldPosition() const;
|
glm::dvec3 calculateWorldPosition() const;
|
||||||
glm::dmat3 calculateWorldRotation() const;
|
glm::dmat3 calculateWorldRotation() const;
|
||||||
double calculateWorldScale() const;
|
glm::dvec3 calculateWorldScale() const;
|
||||||
void computeScreenSpaceData(RenderData& newData);
|
void computeScreenSpaceData(RenderData& newData);
|
||||||
|
|
||||||
std::atomic<State> _state = State::Loaded;
|
std::atomic<State> _state = State::Loaded;
|
||||||
@@ -185,7 +185,7 @@ private:
|
|||||||
// Cached transform data
|
// Cached transform data
|
||||||
glm::dvec3 _worldPositionCached = glm::dvec3(0.0);
|
glm::dvec3 _worldPositionCached = glm::dvec3(0.0);
|
||||||
glm::dmat3 _worldRotationCached = glm::dmat3(1.0);
|
glm::dmat3 _worldRotationCached = glm::dmat3(1.0);
|
||||||
double _worldScaleCached = 1.0;
|
glm::dvec3 _worldScaleCached = glm::dvec3(1.0);
|
||||||
|
|
||||||
float _fixedBoundingSphere = 0.f;
|
float _fixedBoundingSphere = 0.f;
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ private:
|
|||||||
properties::DoubleProperty _distFromCamToNode;
|
properties::DoubleProperty _distFromCamToNode;
|
||||||
properties::DoubleProperty _screenSizeRadius;
|
properties::DoubleProperty _screenSizeRadius;
|
||||||
properties::FloatProperty _visibilityDistance;
|
properties::FloatProperty _visibilityDistance;
|
||||||
|
|
||||||
// This variable is used for the rate-limiting of the screenspace positions (if they
|
// This variable is used for the rate-limiting of the screenspace positions (if they
|
||||||
// are calculated when _computeScreenSpaceValues is true)
|
// are calculated when _computeScreenSpaceValues is true)
|
||||||
std::chrono::high_resolution_clock::time_point _lastScreenSpaceUpdateTime;
|
std::chrono::high_resolution_clock::time_point _lastScreenSpaceUpdateTime;
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ public:
|
|||||||
//void write();
|
//void write();
|
||||||
//void read();
|
//void read();
|
||||||
|
|
||||||
void setData(std::vector<char> data);
|
void setData(std::vector<std::byte> data);
|
||||||
std::vector<char> data();
|
std::vector<std::byte> data();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t _n;
|
size_t _n;
|
||||||
size_t _encodeOffset = 0;
|
size_t _encodeOffset = 0;
|
||||||
size_t _decodeOffset = 0;
|
size_t _decodeOffset = 0;
|
||||||
std::vector<char> _dataStream;
|
std::vector<std::byte> _dataStream;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace openspace
|
} // namespace openspace
|
||||||
|
|||||||
@@ -32,6 +32,9 @@
|
|||||||
|
|
||||||
namespace openspace {
|
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 {
|
struct TouchInput {
|
||||||
TouchInput(size_t touchDeviceId, size_t fingerId, float x, float y, double timestamp);
|
TouchInput(size_t touchDeviceId, size_t fingerId, float x, float y, double timestamp);
|
||||||
glm::vec2 screenCoordinates(glm::vec2 resolution) const;
|
glm::vec2 screenCoordinates(glm::vec2 resolution) const;
|
||||||
@@ -46,19 +49,25 @@ struct TouchInput {
|
|||||||
float y;
|
float y;
|
||||||
float dx = 0.f; // movement in x direction since last touch input
|
float dx = 0.f; // movement in x direction since last touch input
|
||||||
float dy = 0.f; // movement in y 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 {
|
class TouchInputHolder {
|
||||||
public:
|
public:
|
||||||
TouchInputHolder(TouchInput input);
|
TouchInputHolder(TouchInput input);
|
||||||
|
|
||||||
// tryAddInput:
|
|
||||||
// Succeeds upon a different input than last.
|
// Succeeds upon a different input than last.
|
||||||
// Fails upon a too similar input as last.
|
// Fails upon a too similar input as last.
|
||||||
|
// Updates time for the last input if same position.
|
||||||
bool tryAddInput(TouchInput input);
|
bool tryAddInput(TouchInput input);
|
||||||
|
|
||||||
void clearInputs();
|
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;
|
bool holdsInput(const TouchInput &input) const;
|
||||||
|
|
||||||
size_t touchDeviceId() const;
|
size_t touchDeviceId() const;
|
||||||
@@ -72,12 +81,14 @@ public:
|
|||||||
double gestureTime() const;
|
double gestureTime() const;
|
||||||
|
|
||||||
size_t numInputs() const;
|
size_t numInputs() const;
|
||||||
|
const TouchInput& firstInput() const;
|
||||||
const TouchInput& latestInput() const;
|
const TouchInput& latestInput() const;
|
||||||
const std::deque<TouchInput>& peekInputs() const;
|
const std::deque<TouchInput>& peekInputs() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//A deque of recorded inputs. Adding newer points to the front of the queue
|
//A deque of recorded inputs. Adding newer points to the front of the queue
|
||||||
std::deque<TouchInput> _inputs;
|
std::deque<TouchInput> _inputs;
|
||||||
|
TouchInput _firstInput;
|
||||||
|
|
||||||
size_t _touchDeviceId;
|
size_t _touchDeviceId;
|
||||||
size_t _fingerId;
|
size_t _fingerId;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ struct InitializeData {};
|
|||||||
struct TransformData {
|
struct TransformData {
|
||||||
glm::dvec3 translation = glm::dvec3(0.0);
|
glm::dvec3 translation = glm::dvec3(0.0);
|
||||||
glm::dmat3 rotation = glm::dmat3(1.0);
|
glm::dmat3 rotation = glm::dmat3(1.0);
|
||||||
double scale = 0.0;
|
glm::dvec3 scale = glm::dvec3(1.0);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct UpdateData {
|
struct UpdateData {
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ set(HEADER_FILES
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/rotation/luarotation.h
|
${CMAKE_CURRENT_SOURCE_DIR}/rotation/luarotation.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/rotation/staticrotation.h
|
${CMAKE_CURRENT_SOURCE_DIR}/rotation/staticrotation.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/scale/luascale.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/staticscale.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/scale/timedependentscale.h
|
${CMAKE_CURRENT_SOURCE_DIR}/scale/timedependentscale.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/timeframe/timeframeinterval.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/luarotation.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/rotation/staticrotation.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/rotation/staticrotation.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/scale/luascale.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/staticscale.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/scale/timedependentscale.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/scale/timedependentscale.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/timeframe/timeframeinterval.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/timeframe/timeframeinterval.cpp
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
#include <modules/base/rotation/staticrotation.h>
|
#include <modules/base/rotation/staticrotation.h>
|
||||||
#include <modules/base/rotation/timelinerotation.h>
|
#include <modules/base/rotation/timelinerotation.h>
|
||||||
#include <modules/base/scale/luascale.h>
|
#include <modules/base/scale/luascale.h>
|
||||||
|
#include <modules/base/scale/nonuniformstaticscale.h>
|
||||||
#include <modules/base/scale/staticscale.h>
|
#include <modules/base/scale/staticscale.h>
|
||||||
#include <modules/base/scale/timedependentscale.h>
|
#include <modules/base/scale/timedependentscale.h>
|
||||||
#include <modules/base/translation/timelinetranslation.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");
|
ghoul_assert(fScale, "Scale factory was not created");
|
||||||
|
|
||||||
fScale->registerClass<LuaScale>("LuaScale");
|
fScale->registerClass<LuaScale>("LuaScale");
|
||||||
|
fScale->registerClass<NonUniformStaticScale>("NonUniformStaticScale");
|
||||||
fScale->registerClass<StaticScale>("StaticScale");
|
fScale->registerClass<StaticScale>("StaticScale");
|
||||||
fScale->registerClass<TimeDependentScale>("TimeDependentScale");
|
fScale->registerClass<TimeDependentScale>("TimeDependentScale");
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr const char* _loggerCat = "base::RenderableLabels";
|
constexpr const char* _loggerCat = "base::RenderableLabels";
|
||||||
|
|
||||||
constexpr const char* MeterUnit = "m";
|
constexpr const char* MeterUnit = "m";
|
||||||
constexpr const char* KilometerUnit = "Km";
|
constexpr const char* KilometerUnit = "Km";
|
||||||
constexpr const char* MegameterUnit = "Mm";
|
constexpr const char* MegameterUnit = "Mm";
|
||||||
@@ -203,7 +203,7 @@ documentation::Documentation RenderableLabels::Documentation() {
|
|||||||
LabelColorInfo.identifier,
|
LabelColorInfo.identifier,
|
||||||
new DoubleVector4Verifier,
|
new DoubleVector4Verifier,
|
||||||
Optional::Yes,
|
Optional::Yes,
|
||||||
LabelColorInfo.description,
|
LabelColorInfo.description,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
LabelColorInfo.identifier,
|
LabelColorInfo.identifier,
|
||||||
@@ -392,7 +392,7 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
|
|||||||
addProperty(_labelText);
|
addProperty(_labelText);
|
||||||
|
|
||||||
addProperty(_labelOrientationOption);
|
addProperty(_labelOrientationOption);
|
||||||
|
|
||||||
_labelColor.setViewOption(properties::Property::ViewOptions::Color);
|
_labelColor.setViewOption(properties::Property::ViewOptions::Color);
|
||||||
if (dictionary.hasKey(LabelColorInfo.identifier)) {
|
if (dictionary.hasKey(LabelColorInfo.identifier)) {
|
||||||
_labelColor = dictionary.value<glm::vec4>(LabelColorInfo.identifier);
|
_labelColor = dictionary.value<glm::vec4>(LabelColorInfo.identifier);
|
||||||
@@ -634,17 +634,15 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
float fadeInVariable = 1.f;
|
float fadeInVariable = 1.f;
|
||||||
|
|
||||||
if (_enableFadingEffect) {
|
if (_enableFadingEffect) {
|
||||||
float distanceNodeToCamera = glm::distance(
|
float distanceNodeToCamera = static_cast<float>(
|
||||||
data.camera.positionVec3(),
|
glm::distance(data.camera.positionVec3(), data.modelTransform.translation)
|
||||||
data.modelTransform.translation
|
|
||||||
);
|
);
|
||||||
float sUnit = unit(_fadeStartUnitOption);
|
float sUnit = unit(_fadeStartUnitOption);
|
||||||
float eUnit = unit(_fadeEndUnitOption);
|
float eUnit = unit(_fadeEndUnitOption);
|
||||||
float startX = _fadeStartDistance * sUnit;
|
float startX = _fadeStartDistance * sUnit;
|
||||||
float endX = _fadeEndDistance * eUnit;
|
float endX = _fadeEndDistance * eUnit;
|
||||||
//fadeInVariable = changedPerlinSmoothStepFunc(distanceNodeToCamera, startX, endX);
|
|
||||||
fadeInVariable = linearSmoothStepFunc(
|
fadeInVariable = linearSmoothStepFunc(
|
||||||
distanceNodeToCamera,
|
distanceNodeToCamera,
|
||||||
startX,
|
startX,
|
||||||
@@ -676,7 +674,7 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
|
|||||||
glm::dvec3 orthoUp = glm::normalize(glm::cross(cameraViewDirectionWorld, orthoRight));
|
glm::dvec3 orthoUp = glm::normalize(glm::cross(cameraViewDirectionWorld, orthoRight));
|
||||||
|
|
||||||
renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVariable);
|
renderLabels(data, modelViewProjectionMatrix, orthoRight, orthoUp, fadeInVariable);
|
||||||
|
|
||||||
//if (additiveBlending) {
|
//if (additiveBlending) {
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glDepthMask(true);
|
glDepthMask(true);
|
||||||
@@ -688,18 +686,18 @@ void RenderableLabels::setLabelText(const std::string & newText) {
|
|||||||
_labelText = newText;
|
_labelText = newText;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderableLabels::renderLabels(const RenderData& data,
|
void RenderableLabels::renderLabels(const RenderData& data,
|
||||||
const glm::dmat4& modelViewProjectionMatrix,
|
const glm::dmat4& modelViewProjectionMatrix,
|
||||||
const glm::dvec3& orthoRight,
|
const glm::dvec3& orthoRight,
|
||||||
const glm::dvec3& orthoUp, float fadeInVariable)
|
const glm::dvec3& orthoUp, float fadeInVariable)
|
||||||
{
|
{
|
||||||
glm::vec4 textColor = _labelColor;
|
glm::vec4 textColor = _labelColor;
|
||||||
|
|
||||||
textColor.a *= fadeInVariable;
|
textColor.a *= fadeInVariable;
|
||||||
textColor.a *= _opacity;
|
textColor.a *= _opacity;
|
||||||
|
|
||||||
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
|
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
|
||||||
|
|
||||||
labelInfo.orthoRight = orthoRight;
|
labelInfo.orthoRight = orthoRight;
|
||||||
labelInfo.orthoUp = orthoUp;
|
labelInfo.orthoUp = orthoUp;
|
||||||
labelInfo.minSize = static_cast<int>(_labelMinSize);
|
labelInfo.minSize = static_cast<int>(_labelMinSize);
|
||||||
@@ -716,7 +714,7 @@ void RenderableLabels::renderLabels(const RenderData& data,
|
|||||||
glm::vec3 transformedPos(
|
glm::vec3 transformedPos(
|
||||||
_transformationMatrix * glm::dvec4(data.modelTransform.translation, 1.0)
|
_transformationMatrix * glm::dvec4(data.modelTransform.translation, 1.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render(
|
ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render(
|
||||||
*_font,
|
*_font,
|
||||||
transformedPos,
|
transformedPos,
|
||||||
@@ -727,11 +725,11 @@ void RenderableLabels::renderLabels(const RenderData& data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
float RenderableLabels::changedPerlinSmoothStepFunc(float x, float startX,
|
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);
|
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;
|
10.f * powf((x - endX), 3.f) + 1.f;
|
||||||
float f3 = 1.f;
|
float f3 = 1.f;
|
||||||
|
|
||||||
@@ -743,7 +741,8 @@ float RenderableLabels::changedPerlinSmoothStepFunc(float x, float startX,
|
|||||||
}
|
}
|
||||||
else if (x >= endX) {
|
else if (x >= endX) {
|
||||||
return std::clamp(f2, 0.f, 1.f);
|
return std::clamp(f2, 0.f, 1.f);
|
||||||
}
|
}
|
||||||
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderableLabels::linearSmoothStepFunc(float x, float startX, float endX,
|
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 f1 = sdiv * (x - startX) + 1.f;
|
||||||
float f2 = ediv * (x - endX) + 1.f;
|
float f2 = ediv * (x - endX) + 1.f;
|
||||||
float f3 = 1.f;
|
float f3 = 1.f;
|
||||||
|
|
||||||
if (x <= startX) {
|
if (x <= startX) {
|
||||||
return std::clamp(f1, 0.f, 1.f);
|
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) {
|
else if (x >= endX) {
|
||||||
return std::clamp(f2, 0.f, 1.f);
|
return std::clamp(f2, 0.f, 1.f);
|
||||||
}
|
}
|
||||||
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderableLabels::unit(int unit) const {
|
float RenderableLabels::unit(int unit) const {
|
||||||
switch (static_cast<Unit>(unit)) {
|
switch (static_cast<Unit>(unit)) {
|
||||||
case Meter: return 1.f;
|
case Meter: return 1.f;
|
||||||
case Kilometer: return 1e3;
|
case Kilometer: return 1e3f;
|
||||||
case Megameter: return 1e6;
|
case Megameter: return 1e6f;
|
||||||
case Gigameter: return 1e9;
|
case Gigameter: return 1e9f;
|
||||||
case AU: return 149597870700.f;
|
case AU: return 149597870700.f;
|
||||||
case Terameter: return 1e12;
|
case Terameter: return 1e12f;
|
||||||
case Petameter: return 1e15;
|
case Petameter: return 1e15f;
|
||||||
case Parsec: return static_cast<float>(PARSEC);
|
case Parsec: return static_cast<float>(PARSEC);
|
||||||
case Kiloparsec: return static_cast<float>(1e3 * PARSEC);
|
case Kiloparsec: return static_cast<float>(1e3 * PARSEC);
|
||||||
case Megaparsec: return static_cast<float>(1e6 * PARSEC);
|
case Megaparsec: return static_cast<float>(1e6 * PARSEC);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ private:
|
|||||||
const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable);
|
const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable);
|
||||||
|
|
||||||
float changedPerlinSmoothStepFunc(float x, float startX, float endX) const;
|
float changedPerlinSmoothStepFunc(float x, float startX, float endX) const;
|
||||||
|
|
||||||
float linearSmoothStepFunc(float x, float startX, float endX, float sUnit,
|
float linearSmoothStepFunc(float x, float startX, float endX, float sUnit,
|
||||||
float eUnit) const;
|
float eUnit) const;
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,9 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
|
|||||||
_lineColor = dictionary.value<glm::vec3>(LineColorInfo.identifier);
|
_lineColor = dictionary.value<glm::vec3>(LineColorInfo.identifier);
|
||||||
}
|
}
|
||||||
if (dictionary.hasKey(LineWidthInfo.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(); });
|
_start.onChange([&]() { validateNodes(); });
|
||||||
@@ -238,13 +240,13 @@ void RenderableNodeLine::updateVertexData() {
|
|||||||
global::renderEngine.scene()->sceneGraphNode(_end)->worldPosition()
|
global::renderEngine.scene()->sceneGraphNode(_end)->worldPosition()
|
||||||
);
|
);
|
||||||
|
|
||||||
_vertexArray.push_back(_startPos.x);
|
_vertexArray.push_back(static_cast<float>(_startPos.x));
|
||||||
_vertexArray.push_back(_startPos.y);
|
_vertexArray.push_back(static_cast<float>(_startPos.y));
|
||||||
_vertexArray.push_back(_startPos.z);
|
_vertexArray.push_back(static_cast<float>(_startPos.z));
|
||||||
|
|
||||||
_vertexArray.push_back(_endPos.x);
|
_vertexArray.push_back(static_cast<float>(_endPos.x));
|
||||||
_vertexArray.push_back(_endPos.y);
|
_vertexArray.push_back(static_cast<float>(_endPos.y));
|
||||||
_vertexArray.push_back(_endPos.z);
|
_vertexArray.push_back(static_cast<float>(_endPos.z));
|
||||||
|
|
||||||
_vertexArray;
|
_vertexArray;
|
||||||
|
|
||||||
@@ -264,7 +266,7 @@ void RenderableNodeLine::updateVertexData() {
|
|||||||
|
|
||||||
void RenderableNodeLine::render(const RenderData& data, RendererTasks&) {
|
void RenderableNodeLine::render(const RenderData& data, RendererTasks&) {
|
||||||
updateVertexData();
|
updateVertexData();
|
||||||
|
|
||||||
_program->activate();
|
_program->activate();
|
||||||
|
|
||||||
glm::dmat4 anchorTranslation(1.0);
|
glm::dmat4 anchorTranslation(1.0);
|
||||||
@@ -316,7 +318,7 @@ void RenderableNodeLine::render(const RenderData& data, RendererTasks&) {
|
|||||||
// Bind and draw
|
// Bind and draw
|
||||||
bindGL();
|
bindGL();
|
||||||
glDrawArrays(GL_LINES, 0, 2);
|
glDrawArrays(GL_LINES, 0, 2);
|
||||||
|
|
||||||
// Restore GL State
|
// Restore GL State
|
||||||
unbindGL();
|
unbindGL();
|
||||||
_program->deactivate();
|
_program->deactivate();
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto render = [renderLines, renderPoints, p = _programObject, &data,
|
auto render = [renderLines, renderPoints, p = _programObject, &data,
|
||||||
&modelTransform, pointSize = _appearance.pointSize.value(),
|
&modelTransform, pointSize = _appearance.pointSize.value(),
|
||||||
c = _uniformCache, lw = _appearance.lineWidth]
|
c = _uniformCache, lw = _appearance.lineWidth]
|
||||||
(RenderInformation& info, int nVertices, int offset)
|
(RenderInformation& info, int nVertices, int offset)
|
||||||
{
|
{
|
||||||
@@ -366,14 +366,13 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
|
|||||||
|
|
||||||
p->setUniform(c.nVertices, nVertices);
|
p->setUniform(c.nVertices, nVertices);
|
||||||
|
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
glm::ivec2 resolution = global::renderEngine.renderingResolution();
|
glm::ivec2 resolution = global::renderEngine.renderingResolution();
|
||||||
p->setUniform(c.resolution, resolution);
|
p->setUniform(c.resolution, resolution);
|
||||||
|
|
||||||
p->setUniform(c.lineWidth, ceil((2.f * 1.f + lw) * std::sqrt(2.f)));
|
p->setUniform(c.lineWidth, ceil((2.f * 1.f + lw) * std::sqrt(2.f)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (renderPoints) {
|
if (renderPoints) {
|
||||||
// The stride parameter determines the distance between larger points and
|
// The stride parameter determines the distance between larger points and
|
||||||
// smaller ones
|
// smaller ones
|
||||||
@@ -444,7 +443,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
glm::dvec3 trailPosWorld = glm::dvec3(
|
glm::dvec3 trailPosWorld = glm::dvec3(
|
||||||
modelTransform * _primaryRenderInformation._localTransform *
|
modelTransform * _primaryRenderInformation._localTransform *
|
||||||
glm::dvec4(0.0, 0.0, 0.0, 1.0)
|
glm::dvec4(0.0, 0.0, 0.0, 1.0)
|
||||||
);
|
);
|
||||||
const double distance = glm::distance(
|
const double distance = glm::distance(
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ void RenderableTrailOrbit::update(const UpdateData& data) {
|
|||||||
|
|
||||||
std::for_each(_vertexArray.begin(), _vertexArray.end(), setMax);
|
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(
|
RenderableTrailOrbit::UpdateReport RenderableTrailOrbit::updateTrails(
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
|
|||||||
|
|
||||||
std::for_each(_vertexArray.begin(), _vertexArray.end(), setMax);
|
std::for_each(_vertexArray.begin(), _vertexArray.end(), setMax);
|
||||||
|
|
||||||
setBoundingSphere(glm::distance(maxVertex, minVertex) / 2.0);
|
setBoundingSphere(glm::distance(maxVertex, minVertex) / 2.f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace {
|
|||||||
"scaling factor for this transformation. The script needs to define a function "
|
"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 "
|
"'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 "
|
"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
|
} // namespace
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ LuaScale::LuaScale(const ghoul::Dictionary& dictionary) : LuaScale() {
|
|||||||
_luaScriptFile = absPath(dictionary.value<std::string>(ScriptInfo.identifier));
|
_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);
|
ghoul::lua::runScriptFile(_state, _luaScriptFile);
|
||||||
|
|
||||||
// Get the scaling function
|
// Get the scaling function
|
||||||
@@ -97,7 +97,7 @@ double LuaScale::scaleValue(const UpdateData& data) const {
|
|||||||
"LuaScale",
|
"LuaScale",
|
||||||
fmt::format("Script '{}' does not have a function 'scale'", _luaScriptFile)
|
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
|
// 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
|
} // namespace openspace
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
LuaScale();
|
LuaScale();
|
||||||
LuaScale(const ghoul::Dictionary& dictionary);
|
LuaScale(const ghoul::Dictionary& dictionary);
|
||||||
|
|
||||||
double scaleValue(const UpdateData& data) const override;
|
glm::dvec3 scaleValue(const UpdateData& data) const override;
|
||||||
|
|
||||||
static documentation::Documentation Documentation();
|
static documentation::Documentation Documentation();
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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__
|
||||||
@@ -54,8 +54,8 @@ documentation::Documentation StaticScale::Documentation() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
double StaticScale::scaleValue(const UpdateData&) const {
|
glm::dvec3 StaticScale::scaleValue(const UpdateData&) const {
|
||||||
return _scaleValue;
|
return glm::dvec3(_scaleValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
StaticScale::StaticScale() : _scaleValue(ScaleInfo, 1.f, 0.1f, 100.f) {
|
StaticScale::StaticScale() : _scaleValue(ScaleInfo, 1.f, 0.1f, 100.f) {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class StaticScale : public Scale {
|
|||||||
public:
|
public:
|
||||||
StaticScale();
|
StaticScale();
|
||||||
StaticScale(const ghoul::Dictionary& dictionary);
|
StaticScale(const ghoul::Dictionary& dictionary);
|
||||||
double scaleValue(const UpdateData& data) const override;
|
glm::dvec3 scaleValue(const UpdateData& data) const override;
|
||||||
|
|
||||||
static documentation::Documentation Documentation();
|
static documentation::Documentation Documentation();
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ TimeDependentScale::TimeDependentScale(const ghoul::Dictionary& dictionary)
|
|||||||
addProperty(_clampToPositive);
|
addProperty(_clampToPositive);
|
||||||
}
|
}
|
||||||
|
|
||||||
double TimeDependentScale::scaleValue(const UpdateData& data) const {
|
glm::dvec3 TimeDependentScale::scaleValue(const UpdateData& data) const {
|
||||||
if (_cachedReferenceDirty) {
|
if (_cachedReferenceDirty) {
|
||||||
_cachedReference = Time::convertTime(_referenceDate);
|
_cachedReference = Time::convertTime(_referenceDate);
|
||||||
_cachedReferenceDirty = false;
|
_cachedReferenceDirty = false;
|
||||||
@@ -118,10 +118,10 @@ double TimeDependentScale::scaleValue(const UpdateData& data) const {
|
|||||||
const double dt = now - _cachedReference;
|
const double dt = now - _cachedReference;
|
||||||
|
|
||||||
if (_clampToPositive) {
|
if (_clampToPositive) {
|
||||||
return std::max(0.0, dt) * _speed;
|
return glm::dvec3(std::max(0.0, dt) * _speed);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return dt * _speed;
|
return glm::dvec3(dt * _speed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace documentation { struct Documentation; }
|
|||||||
class TimeDependentScale : public Scale {
|
class TimeDependentScale : public Scale {
|
||||||
public:
|
public:
|
||||||
TimeDependentScale(const ghoul::Dictionary& dictionary);
|
TimeDependentScale(const ghoul::Dictionary& dictionary);
|
||||||
double scaleValue(const UpdateData& data) const override;
|
glm::dvec3 scaleValue(const UpdateData& data) const override;
|
||||||
|
|
||||||
static documentation::Documentation Documentation();
|
static documentation::Documentation Documentation();
|
||||||
|
|
||||||
|
|||||||
@@ -225,9 +225,9 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration)
|
|||||||
|
|
||||||
if (isGuiWindow && isMaster && _instance) {
|
if (isGuiWindow && isMaster && _instance) {
|
||||||
if (global::windowDelegate.windowHasResized() || _instance->_shouldReshape) {
|
if (global::windowDelegate.windowHasResized() || _instance->_shouldReshape) {
|
||||||
|
glm::ivec2 csws = global::windowDelegate.currentSubwindowSize();
|
||||||
_instance->reshape(static_cast<glm::ivec2>(
|
_instance->reshape(static_cast<glm::ivec2>(
|
||||||
static_cast<glm::vec2>(global::windowDelegate.currentSubwindowSize()) *
|
static_cast<glm::vec2>(csws) * global::windowDelegate.dpiScaling()
|
||||||
global::windowDelegate.dpiScaling()
|
|
||||||
));
|
));
|
||||||
_instance->_shouldReshape = false;
|
_instance->_shouldReshape = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -424,7 +424,10 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
|||||||
, _drawLabels(DrawLabelInfo, false)
|
, _drawLabels(DrawLabelInfo, false)
|
||||||
, _pixelSizeControl(PixelSizeControlInfo, false)
|
, _pixelSizeControl(PixelSizeControlInfo, false)
|
||||||
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
|
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||||
, _datavarSizeOption(SizeOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
|
, _datavarSizeOption(
|
||||||
|
SizeOptionInfo,
|
||||||
|
properties::OptionProperty::DisplayType::Dropdown
|
||||||
|
)
|
||||||
, _fadeInDistance(
|
, _fadeInDistance(
|
||||||
FadeInDistancesInfo,
|
FadeInDistancesInfo,
|
||||||
glm::vec2(0.f),
|
glm::vec2(0.f),
|
||||||
@@ -548,7 +551,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dictionary.hasKey(ExactColorMapInfo.identifier)) {
|
if (dictionary.hasKey(ExactColorMapInfo.identifier)) {
|
||||||
_isColorMapExact = dictionary.value<bool>(ExactColorMapInfo.identifier);
|
_isColorMapExact = dictionary.value<bool>(ExactColorMapInfo.identifier);
|
||||||
}
|
}
|
||||||
@@ -583,12 +586,12 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
|||||||
|
|
||||||
_datavarSizeOption.onChange([&]() {
|
_datavarSizeOption.onChange([&]() {
|
||||||
_dataIsDirty = true;
|
_dataIsDirty = true;
|
||||||
_datavarSizeOptionString = _optionConversionSizeMap[_datavarSizeOption.value()];
|
_datavarSizeOptionString = _optionConversionSizeMap[_datavarSizeOption];
|
||||||
});
|
});
|
||||||
addProperty(_datavarSizeOption);
|
addProperty(_datavarSizeOption);
|
||||||
|
|
||||||
_hasDatavarSize = true;
|
_hasDatavarSize = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dictionary.hasKey(PolygonSidesInfo.identifier)) {
|
if (dictionary.hasKey(PolygonSidesInfo.identifier)) {
|
||||||
_polygonSides = static_cast<int>(
|
_polygonSides = static_cast<int>(
|
||||||
@@ -673,13 +676,11 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
|||||||
|
|
||||||
addProperty(_correctionSizeFactor);
|
addProperty(_correctionSizeFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (dictionary.hasKey(PixelSizeControlInfo.identifier)) {
|
if (dictionary.hasKey(PixelSizeControlInfo.identifier)) {
|
||||||
_pixelSizeControl = dictionary.value<bool>(PixelSizeControlInfo.identifier);
|
_pixelSizeControl = dictionary.value<bool>(PixelSizeControlInfo.identifier);
|
||||||
addProperty(_pixelSizeControl);
|
addProperty(_pixelSizeControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderableBillboardsCloud::isReady() const {
|
bool RenderableBillboardsCloud::isReady() const {
|
||||||
@@ -1086,7 +1087,7 @@ void RenderableBillboardsCloud::update(const UpdateData&) {
|
|||||||
sizeof(float) * 9,
|
sizeof(float) * 9,
|
||||||
reinterpret_cast<void*>(sizeof(float) * 8)
|
reinterpret_cast<void*>(sizeof(float) * 8)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (_hasColorMapFile) {
|
else if (_hasColorMapFile) {
|
||||||
glEnableVertexAttribArray(positionAttrib);
|
glEnableVertexAttribArray(positionAttrib);
|
||||||
glVertexAttribPointer(
|
glVertexAttribPointer(
|
||||||
@@ -1607,10 +1608,11 @@ void RenderableBillboardsCloud::createDataSlice() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// what datavar in use for the index color
|
// 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)
|
// what datavar in use for the size scaling (if present)
|
||||||
int sizeScalingInUse = _hasDatavarSize ?
|
int sizeScalingInUse = _hasDatavarSize ?
|
||||||
_variableDataPositionMap[_datavarSizeOptionString] : -1;
|
_variableDataPositionMap[_datavarSizeOptionString] : -1;
|
||||||
|
|
||||||
auto addDatavarSizeScalling = [&](size_t i, int datavarInUse) {
|
auto addDatavarSizeScalling = [&](size_t i, int datavarInUse) {
|
||||||
@@ -1625,7 +1627,7 @@ void RenderableBillboardsCloud::createDataSlice() {
|
|||||||
|
|
||||||
float minColorIdx = std::numeric_limits<float>::max();
|
float minColorIdx = std::numeric_limits<float>::max();
|
||||||
float maxColorIdx = std::numeric_limits<float>::min();
|
float maxColorIdx = std::numeric_limits<float>::min();
|
||||||
|
|
||||||
for (size_t i = 0; i < _fullData.size(); i += _nValuesPerAstronomicalObject) {
|
for (size_t i = 0; i < _fullData.size(); i += _nValuesPerAstronomicalObject) {
|
||||||
float colorIdx = _fullData[i + 3 + colorMapInUse];
|
float colorIdx = _fullData[i + 3 + colorMapInUse];
|
||||||
maxColorIdx = colorIdx >= maxColorIdx ? colorIdx : maxColorIdx;
|
maxColorIdx = colorIdx >= maxColorIdx ? colorIdx : maxColorIdx;
|
||||||
@@ -1671,7 +1673,7 @@ void RenderableBillboardsCloud::createDataSlice() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
float ncmap = static_cast<float>(_colorMapData.size());
|
float ncmap = static_cast<float>(_colorMapData.size());
|
||||||
float normalization = ((cmax != cmin) && (ncmap > 2)) ?
|
float normalization = ((cmax != cmin) && (ncmap > 2)) ?
|
||||||
(ncmap - 2) / (cmax - cmin) : 0;
|
(ncmap - 2) / (cmax - cmin) : 0;
|
||||||
colorIndex = (variableColor - cmin) * normalization + 1;
|
colorIndex = (variableColor - cmin) * normalization + 1;
|
||||||
colorIndex = colorIndex < 0 ? 0 : colorIndex;
|
colorIndex = colorIndex < 0 ? 0 : colorIndex;
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ private:
|
|||||||
correctionSizeFactor, color, alphaValue, scaleFactor, up, right, fadeInValue,
|
correctionSizeFactor, color, alphaValue, scaleFactor, up, right, fadeInValue,
|
||||||
screenSize, spriteTexture, hasColormap, enabledRectSizeControl, hasDvarScaling
|
screenSize, spriteTexture, hasColormap, enabledRectSizeControl, hasDvarScaling
|
||||||
) _uniformCache;
|
) _uniformCache;
|
||||||
|
|
||||||
std::shared_ptr<ghoul::fontrendering::Font> _font;
|
std::shared_ptr<ghoul::fontrendering::Font> _font;
|
||||||
|
|
||||||
std::string _speckFile;
|
std::string _speckFile;
|
||||||
|
|||||||
@@ -110,6 +110,12 @@ namespace {
|
|||||||
"objects being rendered."
|
"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 = {
|
constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = {
|
||||||
"DrawElements",
|
"DrawElements",
|
||||||
"Draw Elements",
|
"Draw Elements",
|
||||||
@@ -215,6 +221,12 @@ documentation::Documentation RenderableDUMeshes::Documentation() {
|
|||||||
Optional::Yes,
|
Optional::Yes,
|
||||||
LabelMaxSizeInfo.description
|
LabelMaxSizeInfo.description
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
LineWidthInfo.identifier,
|
||||||
|
new DoubleVerifier,
|
||||||
|
Optional::Yes,
|
||||||
|
LineWidthInfo.description
|
||||||
|
},
|
||||||
{
|
{
|
||||||
TransformationMatrixInfo.identifier,
|
TransformationMatrixInfo.identifier,
|
||||||
new Matrix4x4Verifier<double>,
|
new Matrix4x4Verifier<double>,
|
||||||
@@ -242,6 +254,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
|||||||
, _drawLabels(DrawLabelInfo, false)
|
, _drawLabels(DrawLabelInfo, false)
|
||||||
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
|
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
|
||||||
, _textMaxSize(LabelMaxSizeInfo, 500.f, 0.f, 1000.f)
|
, _textMaxSize(LabelMaxSizeInfo, 500.f, 0.f, 1000.f)
|
||||||
|
, _lineWidth(LineWidthInfo, 2.f, 0.f, 16.f)
|
||||||
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
|
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||||
{
|
{
|
||||||
documentation::testSpecificationAndThrow(
|
documentation::testSpecificationAndThrow(
|
||||||
@@ -315,6 +328,13 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
|||||||
}
|
}
|
||||||
addProperty(_scaleFactor);*/
|
addProperty(_scaleFactor);*/
|
||||||
|
|
||||||
|
if (dictionary.hasKeyAndValue<double>(LineWidthInfo.identifier)) {
|
||||||
|
_lineWidth = static_cast<float>(
|
||||||
|
dictionary.value<double>(LineWidthInfo.identifier)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
addProperty(_lineWidth);
|
||||||
|
|
||||||
if (dictionary.hasKey(DrawLabelInfo.identifier)) {
|
if (dictionary.hasKey(DrawLabelInfo.identifier)) {
|
||||||
_drawLabels = dictionary.value<bool>(DrawLabelInfo.identifier);
|
_drawLabels = dictionary.value<bool>(DrawLabelInfo.identifier);
|
||||||
}
|
}
|
||||||
@@ -473,7 +493,7 @@ void RenderableDUMeshes::renderMeshes(const RenderData&,
|
|||||||
case Solid:
|
case Solid:
|
||||||
break;
|
break;
|
||||||
case Wire:
|
case Wire:
|
||||||
glLineWidth(2.0);
|
glLineWidth(_lineWidth);
|
||||||
glDrawArrays(GL_LINE_STRIP, 0, pair.second.numV);
|
glDrawArrays(GL_LINE_STRIP, 0, pair.second.numV);
|
||||||
glLineWidth(lineWidth);
|
glLineWidth(lineWidth);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ private:
|
|||||||
//properties::OptionProperty _blendMode;
|
//properties::OptionProperty _blendMode;
|
||||||
properties::FloatProperty _textMinSize;
|
properties::FloatProperty _textMinSize;
|
||||||
properties::FloatProperty _textMaxSize;
|
properties::FloatProperty _textMaxSize;
|
||||||
|
properties::FloatProperty _lineWidth;
|
||||||
|
|
||||||
// DEBUG:
|
// DEBUG:
|
||||||
properties::OptionProperty _renderOption;
|
properties::OptionProperty _renderOption;
|
||||||
|
|||||||
@@ -149,7 +149,10 @@ namespace {
|
|||||||
return;
|
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*>(&nPoints), sizeof(int64_t));
|
||||||
fileStream.write(reinterpret_cast<const char*>(&pointsRatio), sizeof(float));
|
fileStream.write(reinterpret_cast<const char*>(&pointsRatio), sizeof(float));
|
||||||
uint64_t nPositions = static_cast<uint64_t>(positions.size());
|
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);
|
_downScaleVolumeRendering.setVisibility(properties::Property::Visibility::Developer);
|
||||||
if (volumeDictionary.hasKey(DownscaleVolumeRenderingInfo.identifier)) {
|
if (volumeDictionary.hasKey(DownscaleVolumeRenderingInfo.identifier)) {
|
||||||
_downScaleVolumeRendering =
|
_downScaleVolumeRendering =
|
||||||
volumeDictionary.value<float>(DownscaleVolumeRenderingInfo.identifier);
|
volumeDictionary.value<float>(DownscaleVolumeRenderingInfo.identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,7 +334,7 @@ void RenderableGalaxy::initializeGL() {
|
|||||||
_aspect = static_cast<glm::vec3>(_volumeDimensions);
|
_aspect = static_cast<glm::vec3>(_volumeDimensions);
|
||||||
_aspect /= std::max(std::max(_aspect.x, _aspect.y), _aspect.z);
|
_aspect /= std::max(std::max(_aspect.x, _aspect.y), _aspect.z);
|
||||||
|
|
||||||
// The volume
|
// The volume
|
||||||
volume::RawVolumeReader<glm::tvec4<GLubyte>> reader(
|
volume::RawVolumeReader<glm::tvec4<GLubyte>> reader(
|
||||||
_volumeFilename,
|
_volumeFilename,
|
||||||
_volumeDimensions
|
_volumeDimensions
|
||||||
@@ -460,9 +463,9 @@ void RenderableGalaxy::initializeGL() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FileSys.cacheManager()->removeCacheFile(_pointsFilename);
|
FileSys.cacheManager()->removeCacheFile(_pointsFilename);
|
||||||
Result res = loadPointFile(_pointsFilename);
|
Result resPoint = loadPointFile(_pointsFilename);
|
||||||
pointPositions = std::move(res.positions);
|
pointPositions = std::move(resPoint.positions);
|
||||||
pointColors = std::move(res.color);
|
pointColors = std::move(resPoint.color);
|
||||||
saveCachedFile(
|
saveCachedFile(
|
||||||
cachedPointsFile,
|
cachedPointsFile,
|
||||||
pointPositions,
|
pointPositions,
|
||||||
@@ -558,7 +561,7 @@ void RenderableGalaxy::update(const UpdateData& data) {
|
|||||||
_pointTransform[3] += translation;
|
_pointTransform[3] += translation;
|
||||||
|
|
||||||
_raycaster->setDownscaleRender(_downScaleVolumeRendering);
|
_raycaster->setDownscaleRender(_downScaleVolumeRendering);
|
||||||
_raycaster->setMaxSteps(_numberOfRayCastingSteps);
|
_raycaster->setMaxSteps(static_cast<int>(_numberOfRayCastingSteps));
|
||||||
_raycaster->setStepSize(_stepSize);
|
_raycaster->setStepSize(_stepSize);
|
||||||
_raycaster->setAspect(_aspect);
|
_raycaster->setAspect(_aspect);
|
||||||
_raycaster->setModelTransform(volumeTransform);
|
_raycaster->setModelTransform(volumeTransform);
|
||||||
@@ -657,7 +660,7 @@ void RenderableGalaxy::renderPoints(const RenderData& data) {
|
|||||||
glm::dmat4(1.0),
|
glm::dmat4(1.0),
|
||||||
glm::pi<double>(),
|
glm::pi<double>(),
|
||||||
glm::dvec3(1.0, 0.0, 0.0)) *
|
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)
|
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::dmat4(1.0),
|
||||||
glm::pi<double>(),
|
glm::pi<double>(),
|
||||||
glm::dvec3(1.0, 0.0, 0.0)) *
|
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)
|
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;
|
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> pointPositions;
|
||||||
std::vector<glm::vec3> pointColors;
|
std::vector<glm::vec3> pointColors;
|
||||||
int64_t nPoints;
|
int64_t nPoints;
|
||||||
|
|||||||
@@ -626,8 +626,7 @@ void GlobeBrowsingModule::goToGeodetic2(const globebrowsing::RenderableGlobe& gl
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GlobeBrowsingModule::goToGeodetic3(const globebrowsing::RenderableGlobe& globe,
|
void GlobeBrowsingModule::goToGeodetic3(const globebrowsing::RenderableGlobe& globe,
|
||||||
globebrowsing::Geodetic3 geo3,
|
globebrowsing::Geodetic3 geo3, bool)
|
||||||
bool doResetCameraDirection)
|
|
||||||
{
|
{
|
||||||
using namespace globebrowsing;
|
using namespace globebrowsing;
|
||||||
const glm::dvec3 positionModelSpace = globe.ellipsoid().cartesianPosition(geo3);
|
const glm::dvec3 positionModelSpace = globe.ellipsoid().cartesianPosition(geo3);
|
||||||
|
|||||||
@@ -377,16 +377,16 @@ vec4 calculateShadedColor(vec4 currentColor, vec3 ellipsoidNormalCameraSpace,
|
|||||||
vec3 shadedColor = currentColor.rgb * 0.05;
|
vec3 shadedColor = currentColor.rgb * 0.05;
|
||||||
|
|
||||||
vec3 n = normalize(ellipsoidNormalCameraSpace);
|
vec3 n = normalize(ellipsoidNormalCameraSpace);
|
||||||
vec3 l = lightDirectionCameraSpace;
|
|
||||||
|
|
||||||
float power = orenNayarDiffuse(
|
float power = orenNayarDiffuse(
|
||||||
-lightDirectionCameraSpace,
|
-lightDirectionCameraSpace,
|
||||||
viewDirectionCameraSpace,
|
viewDirectionCameraSpace,
|
||||||
ellipsoidNormalCameraSpace,
|
ellipsoidNormalCameraSpace,
|
||||||
roughness);
|
roughness);
|
||||||
|
|
||||||
|
vec3 l = lightDirectionCameraSpace;
|
||||||
power = max(smoothstep(0.0f, 0.1f, max(dot(-l, n), 0.0f)) * power, 0.0f);
|
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);
|
vec4 color = vec4(shadedColor + currentColor.rgb * power, currentColor.a);
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -394,7 +394,8 @@ PixelRegion highestResPixelRegion(const GeodeticPatch& geodeticPatch,
|
|||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
RawTile::ReadError postProcessErrorCheck(const RawTile& rawTile, size_t nRasters,
|
RawTile::ReadError postProcessErrorCheck(const RawTile& rawTile,
|
||||||
|
[[ maybe_unused ]] size_t nRasters,
|
||||||
float noDataValue)
|
float noDataValue)
|
||||||
{
|
{
|
||||||
// This check was implicit before and just made explicit here
|
// This check was implicit before and just made explicit here
|
||||||
|
|||||||
@@ -697,7 +697,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
|
|||||||
_ringsComponent.initialize();
|
_ringsComponent.initialize();
|
||||||
addPropertySubOwner(_ringsComponent);
|
addPropertySubOwner(_ringsComponent);
|
||||||
_hasRings = true;
|
_hasRings = true;
|
||||||
|
|
||||||
ghoul::Dictionary ringsDic;
|
ghoul::Dictionary ringsDic;
|
||||||
dictionary.getValue("Rings", ringsDic);
|
dictionary.getValue("Rings", ringsDic);
|
||||||
}
|
}
|
||||||
@@ -799,7 +799,7 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
|
|||||||
if (_hasRings && _ringsComponent.isEnabled()) {
|
if (_hasRings && _ringsComponent.isEnabled()) {
|
||||||
_ringsComponent.draw(lightRenderData, RingsComponent::GeometryOnly);
|
_ringsComponent.draw(lightRenderData, RingsComponent::GeometryOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
_shadowComponent.setViewDepthMap(false);
|
_shadowComponent.setViewDepthMap(false);
|
||||||
@@ -897,15 +897,13 @@ void RenderableGlobe::update(const UpdateData& data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setBoundingSphere(static_cast<float>(
|
setBoundingSphere(static_cast<float>(
|
||||||
_ellipsoid.maximumRadius() * data.modelTransform.scale
|
_ellipsoid.maximumRadius() * glm::compMax(data.modelTransform.scale)
|
||||||
));
|
));
|
||||||
|
|
||||||
glm::dmat4 translation =
|
glm::dmat4 translation =
|
||||||
glm::translate(glm::dmat4(1.0), data.modelTransform.translation);
|
glm::translate(glm::dmat4(1.0), data.modelTransform.translation);
|
||||||
glm::dmat4 rotation = glm::dmat4(data.modelTransform.rotation);
|
glm::dmat4 rotation = glm::dmat4(data.modelTransform.rotation);
|
||||||
glm::dmat4 scaling =
|
glm::dmat4 scaling = glm::scale(glm::dmat4(1.0), data.modelTransform.scale);
|
||||||
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale,
|
|
||||||
data.modelTransform.scale, data.modelTransform.scale));
|
|
||||||
|
|
||||||
_cachedModelTransform = translation * rotation * scaling;
|
_cachedModelTransform = translation * rotation * scaling;
|
||||||
_cachedInverseModelTransform = glm::inverse(_cachedModelTransform);
|
_cachedInverseModelTransform = glm::inverse(_cachedModelTransform);
|
||||||
@@ -968,7 +966,7 @@ const glm::dmat4& RenderableGlobe::modelTransform() const {
|
|||||||
// Rendering code
|
// Rendering code
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
|
void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
|
||||||
const ShadowComponent::ShadowMapData& shadowData,
|
const ShadowComponent::ShadowMapData& shadowData,
|
||||||
bool renderGeomOnly)
|
bool renderGeomOnly)
|
||||||
{
|
{
|
||||||
@@ -986,7 +984,7 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
|
|||||||
const float dsf = static_cast<float>(
|
const float dsf = static_cast<float>(
|
||||||
_generalProperties.currentLodScaleFactor * _ellipsoid.minimumRadius()
|
_generalProperties.currentLodScaleFactor * _ellipsoid.minimumRadius()
|
||||||
);
|
);
|
||||||
|
|
||||||
// We are setting the setIgnoreUniformLocationError as it is not super trivial
|
// We are setting the setIgnoreUniformLocationError as it is not super trivial
|
||||||
// and brittle to figure out apriori whether the uniform was optimized away
|
// and brittle to figure out apriori whether the uniform was optimized away
|
||||||
// or not. It should be something long the lines of:
|
// 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(
|
const bool hasWaterLayer = !_layerManager.layerGroup(
|
||||||
layergroupid::GroupID::WaterMasks
|
layergroupid::GroupID::WaterMasks
|
||||||
).activeLayers().empty();
|
).activeLayers().empty();
|
||||||
|
|
||||||
_globalRenderer.program->setUniform("modelViewTransform", modelViewTransform);
|
_globalRenderer.program->setUniform("modelViewTransform", modelViewTransform);
|
||||||
|
|
||||||
const bool hasHeightLayer = !_layerManager.layerGroup(
|
const bool hasHeightLayer = !_layerManager.layerGroup(
|
||||||
layergroupid::HeightLayers
|
layergroupid::HeightLayers
|
||||||
).activeLayers().empty();
|
).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
|
// Apply an extra scaling to the height if the object is scaled
|
||||||
_globalRenderer.program->setUniform(
|
_globalRenderer.program->setUniform(
|
||||||
"heightScale",
|
"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 *
|
const glm::vec3 directionToSunCameraSpace = glm::vec3(viewTransform *
|
||||||
glm::dvec4(directionToSunWorldSpace, 0));
|
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",
|
"lightDirectionCameraSpace",
|
||||||
-glm::normalize(directionToSunCameraSpace)
|
-glm::normalize(directionToSunCameraSpace)
|
||||||
);
|
);
|
||||||
|
_localRenderer.program->setIgnoreUniformLocationError(IgnoreError::Yes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Local shader
|
// Local shader
|
||||||
_localRenderer.program->setUniform(
|
_localRenderer.program->setUniform(
|
||||||
"projectionTransform",
|
"projectionTransform",
|
||||||
@@ -1156,10 +1165,18 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
|
|||||||
|
|
||||||
const glm::vec3 directionToSunCameraSpace = glm::vec3(viewTransform *
|
const glm::vec3 directionToSunCameraSpace = glm::vec3(viewTransform *
|
||||||
glm::dvec4(directionToSunWorldSpace, 0));
|
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",
|
"lightDirectionCameraSpace",
|
||||||
-glm::normalize(directionToSunCameraSpace)
|
-glm::normalize(directionToSunCameraSpace)
|
||||||
);
|
);
|
||||||
|
_globalRenderer.program->setIgnoreUniformLocationError(IgnoreError::Yes);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr const int ChunkBufferSize = 2048;
|
constexpr const int ChunkBufferSize = 2048;
|
||||||
@@ -1329,9 +1346,9 @@ void RenderableGlobe::renderChunkGlobally(const Chunk& chunk, const RenderData&
|
|||||||
// Shadow Mapping
|
// Shadow Mapping
|
||||||
ghoul::opengl::TextureUnit shadowMapUnit;
|
ghoul::opengl::TextureUnit shadowMapUnit;
|
||||||
if (_generalProperties.shadowMapping && shadowData.shadowDepthTexture != 0) {
|
if (_generalProperties.shadowMapping && shadowData.shadowDepthTexture != 0) {
|
||||||
// Adding the model transformation to the final shadow matrix so we have a
|
// Adding the model transformation to the final shadow matrix so we have a
|
||||||
// complete transformation from the model coordinates to the clip space of
|
// complete transformation from the model coordinates to the clip space of the
|
||||||
// the light position.
|
// light position.
|
||||||
program.setUniform(
|
program.setUniform(
|
||||||
"shadowMatrix",
|
"shadowMatrix",
|
||||||
shadowData.shadowMatrix * modelTransform()
|
shadowData.shadowMatrix * modelTransform()
|
||||||
@@ -1345,14 +1362,14 @@ void RenderableGlobe::renderChunkGlobally(const Chunk& chunk, const RenderData&
|
|||||||
}
|
}
|
||||||
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
if (!renderGeomOnly) {
|
if (!renderGeomOnly) {
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
glCullFace(GL_BACK);
|
glCullFace(GL_BACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
_grid.drawUsingActiveProgram();
|
_grid.drawUsingActiveProgram();
|
||||||
|
|
||||||
for (GPULayerGroup& l : _globalRenderer.gpuLayerGroups) {
|
for (GPULayerGroup& l : _globalRenderer.gpuLayerGroups) {
|
||||||
l.deactivate();
|
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
|
// Apply an extra scaling to the height if the object is scaled
|
||||||
program.setUniform(
|
program.setUniform(
|
||||||
"heightScale",
|
"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
|
// Shadow Mapping
|
||||||
ghoul::opengl::TextureUnit shadowMapUnit;
|
ghoul::opengl::TextureUnit shadowMapUnit;
|
||||||
if (_generalProperties.shadowMapping && shadowData.shadowDepthTexture != 0) {
|
if (_generalProperties.shadowMapping && shadowData.shadowDepthTexture != 0) {
|
||||||
// Adding the model transformation to the final shadow matrix so we have a
|
// Adding the model transformation to the final shadow matrix so we have a
|
||||||
// complete transformation from the model coordinates to the clip space of
|
// complete transformation from the model coordinates to the clip space of the
|
||||||
// the light position.
|
// light position.
|
||||||
program.setUniform(
|
program.setUniform(
|
||||||
"shadowMatrix",
|
"shadowMatrix",
|
||||||
shadowData.shadowMatrix * modelTransform()
|
shadowData.shadowMatrix * modelTransform()
|
||||||
@@ -1479,7 +1498,7 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d
|
|||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
glCullFace(GL_BACK);
|
glCullFace(GL_BACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
_grid.drawUsingActiveProgram();
|
_grid.drawUsingActiveProgram();
|
||||||
|
|
||||||
for (GPULayerGroup& l : _localRenderer.gpuLayerGroups) {
|
for (GPULayerGroup& l : _localRenderer.gpuLayerGroups) {
|
||||||
@@ -1616,7 +1635,7 @@ void RenderableGlobe::recompileShaders() {
|
|||||||
//);
|
//);
|
||||||
layeredTextureInfo.lastLayerIdx = static_cast<int>(
|
layeredTextureInfo.lastLayerIdx = static_cast<int>(
|
||||||
layerGroup.activeLayers().size() - 1
|
layerGroup.activeLayers().size() - 1
|
||||||
);
|
);
|
||||||
layeredTextureInfo.layerBlendingEnabled = layerGroup.layerBlendingEnabled();
|
layeredTextureInfo.layerBlendingEnabled = layerGroup.layerBlendingEnabled();
|
||||||
|
|
||||||
for (Layer* layer : layers) {
|
for (Layer* layer : layers) {
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
float getHeight(const glm::dvec3& position) const;
|
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
|
const ShadowComponent::ShadowMapData& shadowData = {}, bool renderGeomOnly = false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace {
|
|||||||
constexpr const char* _loggerCat = "RingsComponent";
|
constexpr const char* _loggerCat = "RingsComponent";
|
||||||
|
|
||||||
constexpr const std::array<const char*, 9> UniformNames = {
|
constexpr const std::array<const char*, 9> UniformNames = {
|
||||||
"modelViewProjectionMatrix", "textureOffset", "transparency", "_nightFactor",
|
"modelViewProjectionMatrix", "textureOffset", "transparency", "_nightFactor",
|
||||||
"sunPosition", "ringTexture", "shadowMatrix", "shadowMapTexture",
|
"sunPosition", "ringTexture", "shadowMatrix", "shadowMapTexture",
|
||||||
"zFightingPercentage"
|
"zFightingPercentage"
|
||||||
};
|
};
|
||||||
@@ -180,7 +180,7 @@ RingsComponent::RingsComponent(const ghoul::Dictionary& dictionary)
|
|||||||
, _ringsDictionary(dictionary)
|
, _ringsDictionary(dictionary)
|
||||||
{
|
{
|
||||||
using ghoul::filesystem::File;
|
using ghoul::filesystem::File;
|
||||||
|
|
||||||
if (dictionary.hasKey("Rings")) {
|
if (dictionary.hasKey("Rings")) {
|
||||||
// @TODO (abock, 2019-12-16) It would be better to not store the dictionary long
|
// @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
|
// 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
|
// class-initializer list though
|
||||||
dictionary.getValue("Rings", _ringsDictionary);
|
dictionary.getValue("Rings", _ringsDictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
documentation::testSpecificationAndThrow(
|
documentation::testSpecificationAndThrow(
|
||||||
Documentation(),
|
Documentation(),
|
||||||
_ringsDictionary,
|
_ringsDictionary,
|
||||||
@@ -310,20 +310,20 @@ void RingsComponent::draw(const RenderData& data,
|
|||||||
else if (renderPass == GeometryOnly) {
|
else if (renderPass == GeometryOnly) {
|
||||||
_geometryOnlyShader->activate();
|
_geometryOnlyShader->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
const glm::dmat4 modelTransform =
|
const glm::dmat4 modelTransform =
|
||||||
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) *
|
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) *
|
||||||
glm::dmat4(data.modelTransform.rotation) *
|
glm::dmat4(data.modelTransform.rotation) *
|
||||||
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
|
glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale));
|
||||||
|
|
||||||
const glm::dmat4 modelViewProjectionTransform =
|
const glm::dmat4 modelViewProjectionTransform =
|
||||||
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix()
|
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix()
|
||||||
* modelTransform;
|
* modelTransform;
|
||||||
|
|
||||||
ghoul::opengl::TextureUnit ringTextureUnit;
|
ghoul::opengl::TextureUnit ringTextureUnit;
|
||||||
if (renderPass == GeometryAndShading) {
|
if (renderPass == GeometryAndShading) {
|
||||||
_shader->setUniform(
|
_shader->setUniform(
|
||||||
_uniformCache.modelViewProjectionMatrix,
|
_uniformCache.modelViewProjectionMatrix,
|
||||||
modelViewProjectionTransform
|
modelViewProjectionTransform
|
||||||
);
|
);
|
||||||
_shader->setUniform(_uniformCache.textureOffset, _offset);
|
_shader->setUniform(_uniformCache.textureOffset, _offset);
|
||||||
@@ -336,18 +336,18 @@ void RingsComponent::draw(const RenderData& data,
|
|||||||
_texture->bind();
|
_texture->bind();
|
||||||
_shader->setUniform(_uniformCache.ringTexture, ringTextureUnit);
|
_shader->setUniform(_uniformCache.ringTexture, ringTextureUnit);
|
||||||
|
|
||||||
// Adding the model transformation to the final shadow matrix so we have a
|
// Adding the model transformation to the final shadow matrix so we have a
|
||||||
// complete transformation from the model coordinates to the clip space of
|
// complete transformation from the model coordinates to the clip space of
|
||||||
// the light position.
|
// the light position.
|
||||||
_shader->setUniform(
|
_shader->setUniform(
|
||||||
_uniformCache.shadowMatrix,
|
_uniformCache.shadowMatrix,
|
||||||
shadowData.shadowMatrix * modelTransform
|
shadowData.shadowMatrix * modelTransform
|
||||||
);
|
);
|
||||||
|
|
||||||
ghoul::opengl::TextureUnit shadowMapUnit;
|
ghoul::opengl::TextureUnit shadowMapUnit;
|
||||||
shadowMapUnit.activate();
|
shadowMapUnit.activate();
|
||||||
glBindTexture(GL_TEXTURE_2D, shadowData.shadowDepthTexture);
|
glBindTexture(GL_TEXTURE_2D, shadowData.shadowDepthTexture);
|
||||||
|
|
||||||
_shader->setUniform(_uniformCache.shadowMapTexture, shadowMapUnit);
|
_shader->setUniform(_uniformCache.shadowMapTexture, shadowMapUnit);
|
||||||
}
|
}
|
||||||
else if (renderPass == GeometryOnly) {
|
else if (renderPass == GeometryOnly) {
|
||||||
@@ -386,8 +386,8 @@ void RingsComponent::update(const UpdateData& data) {
|
|||||||
if (_geometryOnlyShader->isDirty()) {
|
if (_geometryOnlyShader->isDirty()) {
|
||||||
_geometryOnlyShader->rebuildFromFile();
|
_geometryOnlyShader->rebuildFromFile();
|
||||||
ghoul::opengl::updateUniformLocations(
|
ghoul::opengl::updateUniformLocations(
|
||||||
*_geometryOnlyShader,
|
*_geometryOnlyShader,
|
||||||
_geomUniformCache,
|
_geomUniformCache,
|
||||||
GeomUniformNames
|
GeomUniformNames
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,18 +54,16 @@ public:
|
|||||||
GeometryOnly,
|
GeometryOnly,
|
||||||
GeometryAndShading
|
GeometryAndShading
|
||||||
};
|
};
|
||||||
|
|
||||||
RingsComponent(const ghoul::Dictionary& dictionary);
|
RingsComponent(const ghoul::Dictionary& dictionary);
|
||||||
|
|
||||||
void initialize();
|
void initialize();
|
||||||
void initializeGL();
|
void initializeGL();
|
||||||
void deinitializeGL();
|
void deinitializeGL();
|
||||||
|
|
||||||
bool isReady() const;
|
bool isReady() const;
|
||||||
|
|
||||||
void draw(
|
void draw(const RenderData& data, const RingsComponent::RenderPass renderPass,
|
||||||
const RenderData& data,
|
|
||||||
const RingsComponent::RenderPass renderPass,
|
|
||||||
const ShadowComponent::ShadowMapData& shadowData = {}
|
const ShadowComponent::ShadowMapData& shadowData = {}
|
||||||
);
|
);
|
||||||
void update(const UpdateData& data);
|
void update(const UpdateData& data);
|
||||||
@@ -90,11 +88,11 @@ private:
|
|||||||
|
|
||||||
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
|
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
|
||||||
std::unique_ptr<ghoul::opengl::ProgramObject> _geometryOnlyShader;
|
std::unique_ptr<ghoul::opengl::ProgramObject> _geometryOnlyShader;
|
||||||
UniformCache(modelViewProjectionMatrix, textureOffset, transparency, nightFactor,
|
UniformCache(modelViewProjectionMatrix, textureOffset, transparency, nightFactor,
|
||||||
sunPosition, ringTexture, shadowMatrix, shadowMapTexture, zFightingPercentage
|
sunPosition, ringTexture, shadowMatrix, shadowMapTexture, zFightingPercentage
|
||||||
) _uniformCache;
|
) _uniformCache;
|
||||||
UniformCache(modelViewProjectionMatrix, textureOffset, ringTexture)
|
UniformCache(modelViewProjectionMatrix, textureOffset, ringTexture
|
||||||
_geomUniformCache;
|
) _geomUniformCache;
|
||||||
std::unique_ptr<ghoul::opengl::Texture> _texture;
|
std::unique_ptr<ghoul::opengl::Texture> _texture;
|
||||||
std::unique_ptr<ghoul::filesystem::File> _textureFile;
|
std::unique_ptr<ghoul::filesystem::File> _textureFile;
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr const char* _loggerCat = "ShadowComponent";
|
constexpr const char* _loggerCat = "ShadowComponent";
|
||||||
|
|
||||||
constexpr openspace::properties::Property::PropertyInfo SaveDepthTextureInfo = {
|
constexpr openspace::properties::Property::PropertyInfo SaveDepthTextureInfo = {
|
||||||
"SaveDepthTextureInfo",
|
"SaveDepthTextureInfo",
|
||||||
"Save Depth Texture",
|
"Save Depth Texture",
|
||||||
@@ -197,10 +197,10 @@ ShadowComponent::ShadowComponent(const ghoul::Dictionary& dictionary)
|
|||||||
|
|
||||||
|
|
||||||
if (_shadowMapDictionary.hasKey(DepthMapSizeInfo.identifier)) {
|
if (_shadowMapDictionary.hasKey(DepthMapSizeInfo.identifier)) {
|
||||||
glm::vec2 depthMapSize =
|
glm::vec2 depthMapSize =
|
||||||
_shadowMapDictionary.value<glm::vec2>(DepthMapSizeInfo.identifier);
|
_shadowMapDictionary.value<glm::vec2>(DepthMapSizeInfo.identifier);
|
||||||
_shadowDepthTextureWidth = depthMapSize.x;
|
_shadowDepthTextureWidth = static_cast<int>(depthMapSize.x);
|
||||||
_shadowDepthTextureHeight = depthMapSize.y;
|
_shadowDepthTextureHeight = static_cast<int>(depthMapSize.y);
|
||||||
_dynamicDepthTextureRes = false;
|
_dynamicDepthTextureRes = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -240,42 +240,42 @@ RenderData ShadowComponent::begin(const RenderData& data) {
|
|||||||
// ===========================================
|
// ===========================================
|
||||||
// Builds light's ModelViewProjectionMatrix:
|
// Builds light's ModelViewProjectionMatrix:
|
||||||
// ===========================================
|
// ===========================================
|
||||||
|
|
||||||
glm::dvec3 diffVector = glm::dvec3(_sunPosition) - data.modelTransform.translation;
|
glm::dvec3 diffVector = glm::dvec3(_sunPosition) - data.modelTransform.translation;
|
||||||
double originalLightDistance = glm::length(diffVector);
|
double originalLightDistance = glm::length(diffVector);
|
||||||
glm::dvec3 lightDirection = glm::normalize(diffVector);
|
glm::dvec3 lightDirection = glm::normalize(diffVector);
|
||||||
|
|
||||||
// Percentage of the original light source distance (to avoid artifacts)
|
// Percentage of the original light source distance (to avoid artifacts)
|
||||||
//double multiplier = originalLightDistance *
|
//double multiplier = originalLightDistance *
|
||||||
// (static_cast<double>(_distanceFraction)/1.0E5);
|
// (static_cast<double>(_distanceFraction)/1.0E5);
|
||||||
|
|
||||||
double multiplier = originalLightDistance *
|
double multiplier = originalLightDistance *
|
||||||
(static_cast<double>(_distanceFraction) / 1E17);
|
(static_cast<double>(_distanceFraction) / 1E17);
|
||||||
|
|
||||||
// New light source position
|
// New light source position
|
||||||
//glm::dvec3 lightPosition = data.modelTransform.translation +
|
//glm::dvec3 lightPosition = data.modelTransform.translation +
|
||||||
// (lightDirection * multiplier);
|
// (lightDirection * multiplier);
|
||||||
glm::dvec3 lightPosition = data.modelTransform.translation +
|
glm::dvec3 lightPosition = data.modelTransform.translation +
|
||||||
(diffVector * multiplier);
|
(diffVector * multiplier);
|
||||||
|
|
||||||
//// Light Position
|
//// Light Position
|
||||||
//glm::dvec3 lightPosition = glm::dvec3(_sunPosition);
|
//glm::dvec3 lightPosition = glm::dvec3(_sunPosition);
|
||||||
|
|
||||||
//=============== Manually Created Camera Matrix ===================
|
//=============== Manually Created Camera Matrix ===================
|
||||||
//==================================================================
|
//==================================================================
|
||||||
// camera Z
|
// camera Z
|
||||||
glm::dvec3 cameraZ = lightDirection;
|
glm::dvec3 cameraZ = lightDirection;
|
||||||
|
|
||||||
// camera X
|
// camera X
|
||||||
glm::dvec3 upVector = glm::dvec3(0.0, 1.0, 0.0);
|
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
|
// camera Y
|
||||||
glm::dvec3 cameraY = glm::cross(cameraZ, cameraX);
|
glm::dvec3 cameraY = glm::cross(cameraZ, cameraX);
|
||||||
|
|
||||||
// init 4x4 matrix
|
// init 4x4 matrix
|
||||||
glm::dmat4 cameraRotationMatrix(1.0);
|
glm::dmat4 cameraRotationMatrix(1.0);
|
||||||
|
|
||||||
double* matrix = glm::value_ptr(cameraRotationMatrix);
|
double* matrix = glm::value_ptr(cameraRotationMatrix);
|
||||||
matrix[0] = cameraX.x;
|
matrix[0] = cameraX.x;
|
||||||
matrix[4] = cameraX.y;
|
matrix[4] = cameraX.y;
|
||||||
@@ -288,31 +288,31 @@ RenderData ShadowComponent::begin(const RenderData& data) {
|
|||||||
matrix[10] = cameraZ.z;
|
matrix[10] = cameraZ.z;
|
||||||
|
|
||||||
// set translation part
|
// 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()
|
// the camera->setPosition()
|
||||||
//matrix[12] = -glm::dot(cameraX, lightPosition);
|
//matrix[12] = -glm::dot(cameraX, lightPosition);
|
||||||
//matrix[13] = -glm::dot(cameraY, lightPosition);
|
//matrix[13] = -glm::dot(cameraY, lightPosition);
|
||||||
//matrix[14] = -glm::dot(cameraZ, lightPosition);
|
//matrix[14] = -glm::dot(cameraZ, lightPosition);
|
||||||
|
|
||||||
|
|
||||||
_lightCamera = std::move(std::unique_ptr<Camera>(new Camera(data.camera)));
|
_lightCamera = std::move(std::unique_ptr<Camera>(new Camera(data.camera)));
|
||||||
_lightCamera->setPositionVec3(lightPosition);
|
_lightCamera->setPositionVec3(lightPosition);
|
||||||
_lightCamera->setRotation(glm::dquat(glm::inverse(cameraRotationMatrix)));
|
_lightCamera->setRotation(glm::dquat(glm::inverse(cameraRotationMatrix)));
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
|
|
||||||
//============= Light Matrix by Camera Matrices Composition =============
|
//============= Light Matrix by Camera Matrices Composition =============
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
glm::dmat4 lightProjectionMatrix = glm::dmat4(_lightCamera->projectionMatrix());
|
glm::dmat4 lightProjectionMatrix = glm::dmat4(_lightCamera->projectionMatrix());
|
||||||
|
|
||||||
// The model transformation missing in the final shadow matrix is add when rendering each
|
// The model transformation missing in the final shadow matrix is add when rendering
|
||||||
// object (using its transformations provided by the RenderData structure)
|
// each object (using its transformations provided by the RenderData structure)
|
||||||
_shadowData.shadowMatrix =
|
_shadowData.shadowMatrix =
|
||||||
_toTextureCoordsMatrix * lightProjectionMatrix *
|
_toTextureCoordsMatrix * lightProjectionMatrix *
|
||||||
_lightCamera->combinedViewMatrix();
|
_lightCamera->combinedViewMatrix();
|
||||||
|
|
||||||
|
|
||||||
// Saves current state
|
// Saves current state
|
||||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO);
|
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO);
|
||||||
glGetIntegerv(GL_VIEWPORT, _mViewport);
|
glGetIntegerv(GL_VIEWPORT, _mViewport);
|
||||||
@@ -337,8 +337,7 @@ RenderData ShadowComponent::begin(const RenderData& data) {
|
|||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
|
||||||
//glEnable(GL_CULL_FACE);
|
//glEnable(GL_CULL_FACE);
|
||||||
//checkGLError("begin() -- enabled cull face");
|
//checkGLError("begin() -- enabled cull face");
|
||||||
//glCullFace(GL_FRONT);
|
//glCullFace(GL_FRONT);
|
||||||
@@ -372,7 +371,7 @@ void ShadowComponent::end() {
|
|||||||
};
|
};
|
||||||
glDrawBuffers(3, drawBuffers);
|
glDrawBuffers(3, drawBuffers);
|
||||||
glViewport(_mViewport[0], _mViewport[1], _mViewport[2], _mViewport[3]);
|
glViewport(_mViewport[0], _mViewport[1], _mViewport[2], _mViewport[3]);
|
||||||
|
|
||||||
if (_faceCulling) {
|
if (_faceCulling) {
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
glCullFace(_faceToCull);
|
glCullFace(_faceToCull);
|
||||||
@@ -399,9 +398,9 @@ void ShadowComponent::end() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
glClearColor(
|
glClearColor(
|
||||||
_colorClearValue[0],
|
_colorClearValue[0],
|
||||||
_colorClearValue[1],
|
_colorClearValue[1],
|
||||||
_colorClearValue[2],
|
_colorClearValue[2],
|
||||||
_colorClearValue[3]
|
_colorClearValue[3]
|
||||||
);
|
);
|
||||||
glClearDepth(_depthClearValue);
|
glClearDepth(_depthClearValue);
|
||||||
@@ -433,14 +432,14 @@ void ShadowComponent::end() {
|
|||||||
|
|
||||||
glBindVertexArray(_quadVAO);
|
glBindVertexArray(_quadVAO);
|
||||||
glDrawArrays(GL_TRIANGLES, 0, 6);
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
|
|
||||||
_renderDMProgram->deactivate();
|
_renderDMProgram->deactivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShadowComponent::update(const UpdateData&) {
|
void ShadowComponent::update(const UpdateData&) {
|
||||||
_sunPosition = global::renderEngine.scene()->sceneGraphNode("Sun")->worldPosition();
|
_sunPosition = global::renderEngine.scene()->sceneGraphNode("Sun")->worldPosition();
|
||||||
|
|
||||||
glm::ivec2 renderingResolution = global::renderEngine.renderingResolution();
|
glm::ivec2 renderingResolution = global::renderEngine.renderingResolution();
|
||||||
if (_dynamicDepthTextureRes && ((_shadowDepthTextureWidth != renderingResolution.x) ||
|
if (_dynamicDepthTextureRes && ((_shadowDepthTextureWidth != renderingResolution.x) ||
|
||||||
(_shadowDepthTextureHeight != renderingResolution.y)))
|
(_shadowDepthTextureHeight != renderingResolution.y)))
|
||||||
@@ -454,7 +453,7 @@ void ShadowComponent::update(const UpdateData&) {
|
|||||||
void ShadowComponent::createDepthTexture() {
|
void ShadowComponent::createDepthTexture() {
|
||||||
glGenTextures(1, &_shadowDepthTexture);
|
glGenTextures(1, &_shadowDepthTexture);
|
||||||
updateDepthTexture();
|
updateDepthTexture();
|
||||||
|
|
||||||
_shadowData.shadowDepthTexture = _shadowDepthTexture;
|
_shadowData.shadowDepthTexture = _shadowDepthTexture;
|
||||||
//_shadowData.positionInLightSpaceTexture = _positionInLightSpaceTexture;
|
//_shadowData.positionInLightSpaceTexture = _positionInLightSpaceTexture;
|
||||||
}
|
}
|
||||||
@@ -462,13 +461,13 @@ void ShadowComponent::createDepthTexture() {
|
|||||||
void ShadowComponent::createShadowFBO() {
|
void ShadowComponent::createShadowFBO() {
|
||||||
// Saves current FBO first
|
// Saves current FBO first
|
||||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO);
|
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO);
|
||||||
|
|
||||||
glGenFramebuffers(1, &_shadowFBO);
|
glGenFramebuffers(1, &_shadowFBO);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, _shadowFBO);
|
glBindFramebuffer(GL_FRAMEBUFFER, _shadowFBO);
|
||||||
glFramebufferTexture(
|
glFramebufferTexture(
|
||||||
GL_FRAMEBUFFER,
|
GL_FRAMEBUFFER,
|
||||||
GL_DEPTH_ATTACHMENT,
|
GL_DEPTH_ATTACHMENT,
|
||||||
_shadowDepthTexture,
|
_shadowDepthTexture,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -478,7 +477,7 @@ void ShadowComponent::createShadowFBO() {
|
|||||||
// _positionInLightSpaceTexture,
|
// _positionInLightSpaceTexture,
|
||||||
// 0
|
// 0
|
||||||
//);
|
//);
|
||||||
|
|
||||||
//GLenum drawBuffers[] = { GL_COLOR_ATTACHMENT0, GL_NONE, GL_NONE };
|
//GLenum drawBuffers[] = { GL_COLOR_ATTACHMENT0, GL_NONE, GL_NONE };
|
||||||
GLenum drawBuffers[] = { GL_NONE, GL_NONE, GL_NONE };
|
GLenum drawBuffers[] = { GL_NONE, GL_NONE, GL_NONE };
|
||||||
glDrawBuffers(3, drawBuffers);
|
glDrawBuffers(3, drawBuffers);
|
||||||
@@ -561,7 +560,7 @@ void ShadowComponent::saveDepthBuffer() {
|
|||||||
if (ppmFile.is_open()) {
|
if (ppmFile.is_open()) {
|
||||||
|
|
||||||
ppmFile << "P3" << std::endl;
|
ppmFile << "P3" << std::endl;
|
||||||
ppmFile << _shadowDepthTextureWidth << " " << _shadowDepthTextureHeight
|
ppmFile << _shadowDepthTextureWidth << " " << _shadowDepthTextureHeight
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
ppmFile << "255" << std::endl;
|
ppmFile << "255" << std::endl;
|
||||||
|
|
||||||
@@ -601,7 +600,7 @@ void ShadowComponent::saveDepthBuffer() {
|
|||||||
if (ppmFile.is_open()) {
|
if (ppmFile.is_open()) {
|
||||||
|
|
||||||
ppmFile << "P3" << std::endl;
|
ppmFile << "P3" << std::endl;
|
||||||
ppmFile << _shadowDepthTextureWidth << " " << _shadowDepthTextureHeight
|
ppmFile << _shadowDepthTextureWidth << " " << _shadowDepthTextureHeight
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
ppmFile << "255" << std::endl;
|
ppmFile << "255" << std::endl;
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public:
|
|||||||
RenderData begin(const RenderData& data);
|
RenderData begin(const RenderData& data);
|
||||||
void end();
|
void end();
|
||||||
void update(const UpdateData& data);
|
void update(const UpdateData& data);
|
||||||
|
|
||||||
static documentation::Documentation Documentation();
|
static documentation::Documentation Documentation();
|
||||||
|
|
||||||
bool isEnabled() const;
|
bool isEnabled() const;
|
||||||
@@ -101,13 +101,13 @@ private:
|
|||||||
properties::TriggerProperty _saveDepthTexture;
|
properties::TriggerProperty _saveDepthTexture;
|
||||||
properties::IntProperty _distanceFraction;
|
properties::IntProperty _distanceFraction;
|
||||||
properties::BoolProperty _enabled;
|
properties::BoolProperty _enabled;
|
||||||
|
|
||||||
ghoul::Dictionary _shadowMapDictionary;
|
ghoul::Dictionary _shadowMapDictionary;
|
||||||
|
|
||||||
int _shadowDepthTextureHeight = 4096;
|
int _shadowDepthTextureHeight = 4096;
|
||||||
int _shadowDepthTextureWidth = 4096;
|
int _shadowDepthTextureWidth = 4096;
|
||||||
bool _dynamicDepthTextureRes = true;
|
bool _dynamicDepthTextureRes = true;
|
||||||
|
|
||||||
GLuint _shadowDepthTexture = 0;
|
GLuint _shadowDepthTexture = 0;
|
||||||
GLuint _positionInLightSpaceTexture = 0;
|
GLuint _positionInLightSpaceTexture = 0;
|
||||||
GLuint _shadowFBO = 0;
|
GLuint _shadowFBO = 0;
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ void TimeQuantizer::doFirstApproximation(DateTime& quantized, DateTime& unQ,
|
|||||||
static_cast<double>(_start.year());
|
static_cast<double>(_start.year());
|
||||||
minIncrementsAdjust = minYearsToAdjust / value;
|
minIncrementsAdjust = minYearsToAdjust / value;
|
||||||
quantized.setYear(
|
quantized.setYear(
|
||||||
_start.year() + static_cast<int>(minIncrementsAdjust) * value
|
_start.year() + static_cast<int>(minIncrementsAdjust * value)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
*
|
*
|
||||||
* \param checkTime An ISO8601 date/time string to clamp if falls outside of range
|
* \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
|
* less than start, equal to end if greater than end, or equal to input
|
||||||
* parameter if falls in-between
|
* parameter if falls in-between
|
||||||
*/
|
*/
|
||||||
@@ -227,7 +227,7 @@ public:
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Increment operation for the date/time
|
* Increment operation for the date/time
|
||||||
*
|
*
|
||||||
* \param value integer value for number of units in an operation
|
* \param value integer value for number of units in an operation
|
||||||
* \param unit single char that specifies the unit of increment. Allowable units are:
|
* \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
|
* (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
|
* \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 &
|
* possible to the target, where each decrement is defined by the value &
|
||||||
* unit (and approximated but not fixed by the resolution param)
|
* unit (and approximated but not fixed by the resolution param)
|
||||||
*/
|
*/
|
||||||
int decrement(int value, char unit, double error, double resolution);
|
int decrement(int value, char unit, double error, double resolution);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -154,9 +154,6 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
|
|||||||
global::callback::draw2D.emplace_back([&]() {
|
global::callback::draw2D.emplace_back([&]() {
|
||||||
ZoneScopedN("ImGUI")
|
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;
|
WindowDelegate& delegate = global::windowDelegate;
|
||||||
const bool showGui = delegate.hasGuiWindow() ? delegate.isGuiWindow() : true;
|
const bool showGui = delegate.hasGuiWindow() ? delegate.isGuiWindow() : true;
|
||||||
if (delegate.isMaster() && showGui) {
|
if (delegate.isMaster() && showGui) {
|
||||||
@@ -167,22 +164,15 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec2 mousePosition = delegate.mousePosition();
|
|
||||||
uint32_t mouseButtons = delegate.mouseButtons(2);
|
|
||||||
|
|
||||||
const double dt = std::max(delegate.averageDeltaTime(), 0.0);
|
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
|
// We don't do any collection of immediate mode user interface, so it
|
||||||
// is fine to open and close a frame immediately
|
// is fine to open and close a frame immediately
|
||||||
gui.startFrame(
|
gui.startFrame(
|
||||||
static_cast<float>(dt),
|
static_cast<float>(dt),
|
||||||
glm::vec2(windowSize),
|
glm::vec2(windowSize),
|
||||||
resolution / windowSize,
|
resolution / windowSize,
|
||||||
mousePosition,
|
_mousePosition,
|
||||||
mouseButtons
|
_mouseButtons
|
||||||
);
|
);
|
||||||
|
|
||||||
gui.endFrame();
|
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(
|
global::callback::mouseButton.emplace_back(
|
||||||
[&](MouseButton button, MouseAction action, KeyModifier) -> bool {
|
[&](MouseButton button, MouseAction action, KeyModifier) -> bool {
|
||||||
ZoneScopedN("ImGUI")
|
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
|
// A list of all the windows that can show up by themselves
|
||||||
if (gui.isEnabled() || gui._performance.isEnabled() ||
|
if (gui.isEnabled() || gui._performance.isEnabled() ||
|
||||||
gui._sceneProperty.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
|
} // namespace openspace
|
||||||
|
|||||||
@@ -31,13 +31,6 @@
|
|||||||
|
|
||||||
namespace openspace {
|
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 {
|
class ImGUIModule : public OpenSpaceModule {
|
||||||
public:
|
public:
|
||||||
constexpr static const char* Name = "ImGUI";
|
constexpr static const char* Name = "ImGUI";
|
||||||
@@ -45,7 +38,10 @@ public:
|
|||||||
ImGUIModule();
|
ImGUIModule();
|
||||||
|
|
||||||
gui::GUI gui;
|
gui::GUI gui;
|
||||||
Touch touchInput = { false, glm::vec2(0), 0 };
|
|
||||||
|
private:
|
||||||
|
glm::vec2 _mousePosition = glm::vec2(0.f);
|
||||||
|
uint32_t _mouseButtons = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace openspace
|
} // namespace openspace
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include <openspace/properties/scalar/floatproperty.h>
|
#include <openspace/properties/scalar/floatproperty.h>
|
||||||
#include <openspace/util/keys.h>
|
#include <openspace/util/keys.h>
|
||||||
#include <openspace/util/mouse.h>
|
#include <openspace/util/mouse.h>
|
||||||
|
#include <openspace/util/touch.h>
|
||||||
#include <ghoul/glm.h>
|
#include <ghoul/glm.h>
|
||||||
#include <ghoul/opengl/ghoul_gl.h>
|
#include <ghoul/opengl/ghoul_gl.h>
|
||||||
#include <ghoul/opengl/uniformcache.h>
|
#include <ghoul/opengl/uniformcache.h>
|
||||||
@@ -89,6 +90,10 @@ public:
|
|||||||
bool keyCallback(Key key, KeyModifier modifier, KeyAction action);
|
bool keyCallback(Key key, KeyModifier modifier, KeyAction action);
|
||||||
bool charCallback(unsigned int character, KeyModifier modifier);
|
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,
|
void startFrame(float deltaTime, const glm::vec2& windowSize,
|
||||||
const glm::vec2& dpiScaling, const glm::vec2& mousePos,
|
const glm::vec2& dpiScaling, const glm::vec2& mousePos,
|
||||||
uint32_t mouseButtonsPressed);
|
uint32_t mouseButtonsPressed);
|
||||||
@@ -169,6 +174,8 @@ private:
|
|||||||
properties::Property::Visibility::Developer;
|
properties::Property::Visibility::Developer;
|
||||||
|
|
||||||
std::vector<ImGuiContext*> _contexts;
|
std::vector<ImGuiContext*> _contexts;
|
||||||
|
|
||||||
|
std::vector<TouchInput> _validTouchStates;
|
||||||
};
|
};
|
||||||
|
|
||||||
void CaptionText(const char* text);
|
void CaptionText(const char* text);
|
||||||
|
|||||||
@@ -637,6 +637,77 @@ bool GUI::charCallback(unsigned int character, KeyModifier) {
|
|||||||
return consumeEvent;
|
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() {
|
void GUI::render() {
|
||||||
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user