From 7e7a1cb720ff0a8977af366dd08c1cedbe258261 Mon Sep 17 00:00:00 2001 From: Kalle Date: Wed, 13 Jul 2016 11:29:29 -0400 Subject: [PATCH 1/3] Change friction to bool properties --- data/scene/globebrowsing.scene | 4 ++-- include/openspace/interaction/interactionhandler.h | 6 +++--- src/interaction/interactionhandler.cpp | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/scene/globebrowsing.scene b/data/scene/globebrowsing.scene index fa727424f5..7bcb2ff1ff 100644 --- a/data/scene/globebrowsing.scene +++ b/data/scene/globebrowsing.scene @@ -6,8 +6,8 @@ function preInitialization() critical objects. ]]-- - --openspace.time.setTime("2015 NOV 24 00:00:00") - openspace.time.setTime(openspace.time.currentWallTime()) + openspace.time.setTime("2015 NOV 24 00:00:00") + --openspace.time.setTime(openspace.time.currentWallTime()) dofile(openspace.absPath('${SCRIPTS}/bind_keys.lua')) --openspace.bindKey("v", "openspace.setPropertyValue('DebugGlobe.saveOrThrowCamera', true)") end diff --git a/include/openspace/interaction/interactionhandler.h b/include/openspace/interaction/interactionhandler.h index 589e4f1c4a..ea9c39169c 100644 --- a/include/openspace/interaction/interactionhandler.h +++ b/include/openspace/interaction/interactionhandler.h @@ -219,9 +219,9 @@ private: properties::StringProperty _origin; properties::StringProperty _coordinateSystem; - properties::FloatProperty _rotationalFriction; - properties::FloatProperty _horizontalFriction; - properties::FloatProperty _verticalFriction; + properties::BoolProperty _rotationalFriction; + properties::BoolProperty _horizontalFriction; + properties::BoolProperty _verticalFriction; properties::FloatProperty _sensitivity; properties::FloatProperty _rapidness; diff --git a/src/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index b35342471e..a902ff1de3 100644 --- a/src/interaction/interactionhandler.cpp +++ b/src/interaction/interactionhandler.cpp @@ -621,9 +621,9 @@ void InteractionHandler::clearKeyframes(){ InteractionHandler::InteractionHandler() : _origin("origin", "Origin", "") , _coordinateSystem("coordinateSystem", "Coordinate System", "") - , _rotationalFriction("rotationalFriction", "Rotational Friction", 1, 0, 1) - , _horizontalFriction("horizontalFriction", "Horizontal Friction", 1, 0, 1) - , _verticalFriction("verticalFriction", "Vertical Friction", 1, 0, 1) + , _rotationalFriction("rotationalFriction", "Rotational Friction", true) + , _horizontalFriction("horizontalFriction", "Horizontal Friction", true) + , _verticalFriction("verticalFriction", "Vertical Friction", true) , _sensitivity("sensitivity", "Sensitivity", 0.002, 0.0001, 0.02) , _rapidness("rapidness", "Rapidness", 1, 0.1, 60) { @@ -637,13 +637,10 @@ InteractionHandler::InteractionHandler() } setFocusNode(node); }); - addProperty(_origin); _coordinateSystem.onChange([this]() { OsEng.renderEngine().changeViewPoint(_coordinateSystem.value()); }); - addProperty(_coordinateSystem); - // Create the interactionModes _inputState = std::make_unique(); @@ -681,6 +678,9 @@ InteractionHandler::InteractionHandler() }); // Add the properties + addProperty(_origin); + addProperty(_coordinateSystem); + addProperty(_rotationalFriction); addProperty(_horizontalFriction); addProperty(_verticalFriction); From 2c005406fde168f43307f50b7d44823240ffe16d Mon Sep 17 00:00:00 2001 From: Kalle Date: Wed, 13 Jul 2016 11:49:57 -0400 Subject: [PATCH 2/3] Fix horizon culling bug --- modules/globebrowsing/chunk/culling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/globebrowsing/chunk/culling.cpp b/modules/globebrowsing/chunk/culling.cpp index a8eeef6309..ff352f58fb 100644 --- a/modules/globebrowsing/chunk/culling.cpp +++ b/modules/globebrowsing/chunk/culling.cpp @@ -101,7 +101,7 @@ namespace openspace { const Ellipsoid& ellipsoid = chunk.owner()->ellipsoid(); const GeodeticPatch& patch = chunk.surfacePatch(); float maxHeight = chunk.getBoundingHeights().max; - Vec3 globePosition = data.position.dvec3(); + Vec3 globePosition = glm::dvec3(0,0,0); // In model space it is 0 Scalar minimumGlobeRadius = ellipsoid.minimumRadius(); Vec3 cameraPosition = From 718a5d69e695d9457e02a0c6c21e07cd9ed74e82 Mon Sep 17 00:00:00 2001 From: Kalle Date: Wed, 13 Jul 2016 12:01:50 -0400 Subject: [PATCH 3/3] Change lua common script to toggle three types of interaction friction. --- scripts/common.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/common.lua b/scripts/common.lua index 7861bbf263..2083c2e5d3 100644 --- a/scripts/common.lua +++ b/scripts/common.lua @@ -17,8 +17,9 @@ helper.setCommonKeys = function() openspace.bindKey("COMMA", "openspace.setRenderer('Framebuffer');") openspace.bindKey("PERIOD", "openspace.setRenderer('ABuffer');") - openspace.bindKey("f", helper.property.invert('Interaction.rotationalFriction')) - openspace.bindKey("Shift+f", helper.property.invert('Interaction.zoomFriction')) + openspace.bindKey("f", helper.property.invert('Interaction.horizontalFriction')) + openspace.bindKey("Shift+f", helper.property.invert('Interaction.rotationalFriction')) + openspace.bindKey("Shift+Ctrl+f", helper.property.invert('Interaction.verticalFriction')) end helper.setDeltaTimeKeys = function(t)