From 4954dda5618273dcfe7e65cb745f09937ae0e604 Mon Sep 17 00:00:00 2001 From: wundahlful Date: Thu, 23 Jun 2016 15:32:10 -0600 Subject: [PATCH 1/4] Updating deprecated cppformat/format.h to fmt/format.h The warning in cppformat's version throws a fatal error in the VS compiler --- modules/onscreengui/src/guiperformancecomponent.cpp | 2 +- src/util/spicemanager.cpp | 2 +- src/util/time_lua.inl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/onscreengui/src/guiperformancecomponent.cpp b/modules/onscreengui/src/guiperformancecomponent.cpp index 0bd4511ab3..9f161dc68d 100644 --- a/modules/onscreengui/src/guiperformancecomponent.cpp +++ b/modules/onscreengui/src/guiperformancecomponent.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index 7c6ecb08d6..919ee21557 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include namespace { const std::string _loggerCat = "SpiceManager"; diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index 687780c459..89681cf9fc 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -24,7 +24,7 @@ #include -#include +#include #include namespace openspace { From b32262390ce0895a4bd3c4c94391f214f7f0a753 Mon Sep 17 00:00:00 2001 From: wundahlful Date: Thu, 23 Jun 2016 16:00:26 -0600 Subject: [PATCH 2/4] Updated Ghoul version for cppformat changes --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index 9b822d0133..f519946a02 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 9b822d01339fcc216fb35582977b91ac85ff099a +Subproject commit f519946a026e8bf538d8caa5d258fe5b623366d9 From 9705c33c169ffd0ce14fb2737693e2ee22acdc4f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 24 Jun 2016 10:55:49 +0200 Subject: [PATCH 3/4] Disable default module setting for galaxy, globebrowsing, and multiresvolume Update Ghoul repository --- ext/ghoul | 2 +- modules/galaxy/include.cmake | 1 - modules/globebrowsing/include.cmake | 1 - modules/multiresvolume/include.cmake | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 9b822d0133..f519946a02 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 9b822d01339fcc216fb35582977b91ac85ff099a +Subproject commit f519946a026e8bf538d8caa5d258fe5b623366d9 diff --git a/modules/galaxy/include.cmake b/modules/galaxy/include.cmake index 163c5a64bf..1fbd4a3ae5 100644 --- a/modules/galaxy/include.cmake +++ b/modules/galaxy/include.cmake @@ -1,4 +1,3 @@ -set (DEFAULT_MODULE ON) set (OPENSPACE_DEPENDENCIES volume ) \ No newline at end of file diff --git a/modules/globebrowsing/include.cmake b/modules/globebrowsing/include.cmake index ffea0ac430..e69de29bb2 100644 --- a/modules/globebrowsing/include.cmake +++ b/modules/globebrowsing/include.cmake @@ -1 +0,0 @@ -set(DEFAULT_MODULE ON) diff --git a/modules/multiresvolume/include.cmake b/modules/multiresvolume/include.cmake index 3ccace7c97..e69de29bb2 100644 --- a/modules/multiresvolume/include.cmake +++ b/modules/multiresvolume/include.cmake @@ -1 +0,0 @@ -set (DEFAULT_MODULE ON) From 8886eeec9d0e2643b4b9b89c7a444e233b5c1142 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 26 Jun 2016 03:38:42 +0200 Subject: [PATCH 4/4] Compile fix for when globebrowsing is not available --- .../interaction/interactionhandler.h | 10 +++ src/interaction/interactionhandler.cpp | 71 ++++++++++--------- src/interaction/interactionhandler_lua.inl | 4 ++ tests/main.cpp | 12 +--- 4 files changed, 53 insertions(+), 44 deletions(-) diff --git a/include/openspace/interaction/interactionhandler.h b/include/openspace/interaction/interactionhandler.h index ba3d8a022a..72e73d3566 100644 --- a/include/openspace/interaction/interactionhandler.h +++ b/include/openspace/interaction/interactionhandler.h @@ -34,7 +34,10 @@ #include #include + +#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED #include +#endif #include @@ -273,6 +276,7 @@ protected: glm::dquat _globalCameraRotation; }; +#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED class GlobeBrowsingInteractionMode : public OrbitalInteractionMode { public: @@ -288,6 +292,7 @@ private: void updateCameraStateFromMouseStates(); RenderableGlobe* _globe; }; +#endif class InteractionHandler : public properties::PropertyOwner @@ -302,7 +307,9 @@ public: // Interaction mode setters void setInteractionModeToOrbital(); +#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED void setInteractionModeToGlobeBrowsing(); +#endif void resetKeyBindings(); @@ -345,7 +352,10 @@ private: std::shared_ptr _currentInteractionMode; std::shared_ptr _orbitalInteractionMode; + +#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED std::shared_ptr _globebrowsingInteractionMode; +#endif // Properties properties::StringProperty _origin; diff --git a/src/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index d0c7dfa78a..6b238546a0 100644 --- a/src/interaction/interactionhandler.cpp +++ b/src/interaction/interactionhandler.cpp @@ -269,43 +269,43 @@ void InteractionHandler::orbit(const float &dx, const float &dy, const float &dz float rollSpeed = 100.0f; - glm::mat4 transform; - transform = glm::rotate(glm::radians(dx * rotationSpeed), cameraUp) * transform; - transform = glm::rotate(glm::radians(dy * rotationSpeed), cameraRight) * transform; - transform = glm::rotate(glm::radians(dz * rollSpeed), _camera->viewDirection()) * transform; + glm::mat4 transform; + transform = glm::rotate(glm::radians(dx * rotationSpeed), cameraUp) * transform; + transform = glm::rotate(glm::radians(dy * rotationSpeed), cameraRight) * transform; + transform = glm::rotate(glm::radians(dz * rollSpeed), _camera->viewDirection()) * transform; - - - - //// get camera position - //psc relative = _camera->position(); + + + + //// get camera position + //psc relative = _camera->position(); - // get camera position (UNSYNCHRONIZED) - psc relative = _camera->unsynchedPosition(); + // get camera position (UNSYNCHRONIZED) + psc relative = _camera->unsynchedPosition(); - //get relative vector - psc relative_focus_coordinate = relative - focusPos; - //rotate relative vector - relative_focus_coordinate = glm::inverse(transform) * relative_focus_coordinate.vec4(); - - //get new new position of focus node - psc origin; - if (_focusNode) { - origin = _focusNode->worldPosition(); - } + //get relative vector + psc relative_focus_coordinate = relative - focusPos; + //rotate relative vector + relative_focus_coordinate = glm::inverse(transform) * relative_focus_coordinate.vec4(); + + //get new new position of focus node + psc origin; + if (_focusNode) { + origin = _focusNode->worldPosition(); + } - //new camera position - relative = origin + relative_focus_coordinate; + //new camera position + relative = origin + relative_focus_coordinate; - psc target = relative + relative_focus_coordinate * dist * zoomSpeed; + psc target = relative + relative_focus_coordinate * dist * zoomSpeed; - //don't fly into objects - if ((target - origin).length() < focusNodeBounds){ - //target = relative; - } + //don't fly into objects + if ((target - origin).length() < focusNodeBounds){ + //target = relative; + } - unlockControls(); + unlockControls(); _camera->setFocusPosition(origin); @@ -885,6 +885,7 @@ void OrbitalInteractionMode::update(double deltaTime) { updateCameraStateFromMouseStates(); } +#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED GlobeBrowsingInteractionMode::GlobeBrowsingInteractionMode( std::shared_ptr inputState, double sensitivity, @@ -893,9 +894,7 @@ GlobeBrowsingInteractionMode::GlobeBrowsingInteractionMode( } -GlobeBrowsingInteractionMode::~GlobeBrowsingInteractionMode() { - -} +GlobeBrowsingInteractionMode::~GlobeBrowsingInteractionMode() {} void GlobeBrowsingInteractionMode::setFocusNode(SceneGraphNode* focusNode) { _focusNode = focusNode; @@ -911,7 +910,6 @@ void GlobeBrowsingInteractionMode::setFocusNode(SceneGraphNode* focusNode) { } - void GlobeBrowsingInteractionMode::updateCameraStateFromMouseStates() { if (_focusNode && _globe) { // Declare variables to use in interaction calculations @@ -989,6 +987,8 @@ void GlobeBrowsingInteractionMode::update(double deltaTime) { updateCameraStateFromMouseStates(); } +#endif + // InteractionHandler InteractionHandler::InteractionHandler() : _origin("origin", "Origin", "") @@ -1014,8 +1014,11 @@ InteractionHandler::InteractionHandler() _inputState = std::shared_ptr(new InputState()); _orbitalInteractionMode = std::shared_ptr( new OrbitalInteractionMode(_inputState, 0.002, 0.02)); + +#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED _globebrowsingInteractionMode = std::shared_ptr( new GlobeBrowsingInteractionMode(_inputState, 0.002, 0.02)); +#endif // Set the interactionMode _currentInteractionMode = _orbitalInteractionMode; @@ -1050,9 +1053,11 @@ void InteractionHandler::setInteractionModeToOrbital() { setInteractionMode(_orbitalInteractionMode); } +#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED void InteractionHandler::setInteractionModeToGlobeBrowsing() { setInteractionMode(_globebrowsingInteractionMode); } +#endif void InteractionHandler::lockControls() { diff --git a/src/interaction/interactionhandler_lua.inl b/src/interaction/interactionhandler_lua.inl index 9fdbf19a61..dbf83aac88 100644 --- a/src/interaction/interactionhandler_lua.inl +++ b/src/interaction/interactionhandler_lua.inl @@ -134,7 +134,11 @@ int setInteractionMode(lua_State* L) { OsEng.interactionHandler().setInteractionModeToOrbital(); } else if (interactionModeName == "GlobeBrowsingInteractionMode") { +#ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED OsEng.interactionHandler().setInteractionModeToGlobeBrowsing(); +#else + return luaL_error(L, "OpenSpace compiled without support for GlobeBrowsing"); +#endif } else { // Default return luaL_error(L, "Unknown interaction mode. default is 'OrbitalInteractionMode'"); diff --git a/tests/main.cpp b/tests/main.cpp index e370ac5c3b..5f978b987d 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -31,7 +31,6 @@ #include // test files -<<<<<<< HEAD //#include //#include //#include @@ -39,7 +38,7 @@ //#include //#include //#include -#include +//#include //#include //#include @@ -53,15 +52,6 @@ //#include //#include //#include -======= -#include -#include -#include -#include -#include -#include -#include ->>>>>>> develop #include #include