Merge branch 'master' of github.com:OpenSpace/OpenSpace into feature/data-management

This commit is contained in:
Emil Axelsson
2017-11-05 20:04:47 +01:00
16 changed files with 6260 additions and 12 deletions
+6
View File
@@ -1170,6 +1170,12 @@ void OpenSpaceEngine::postDraw() {
if (isGuiWindow) {
_renderEngine->renderScreenLog();
_renderEngine->renderVersionInformation();
if (!_shutdown.inShutdown) {
// We render the camera information in the same location as the shutdown info
// and we won't need this if we are shutting down
_renderEngine->renderCameraInformation();
}
_console->render();
}
+12
View File
@@ -300,6 +300,18 @@ SceneGraphNode* OrbitalNavigator::focusNode() const {
return _focusNode;
}
bool OrbitalNavigator::hasRotationalFriction() const {
return _friction.rotational;
}
bool OrbitalNavigator::hasZoomFriction() const {
return _friction.zoom;
}
bool OrbitalNavigator::hasRollFriction() const {
return _friction.roll;
}
OrbitalNavigator::CameraRotationDecomposition
OrbitalNavigator::decomposeCameraRotation(
const glm::dvec3& cameraPosition,
+72 -1
View File
@@ -131,10 +131,17 @@ namespace {
static const openspace::properties::Property::PropertyInfo ShowVersionInfo = {
"ShowVersion",
"Shows the version on-screen information",
"This value determines whether the GIT version information (branch and commit ) "
"This value determines whether the Git version information (branch and commit) "
"hash are shown on the screen."
};
static const openspace::properties::Property::PropertyInfo ShowCameraInfo = {
"ShowCamera",
"Shows information about the current camera state, such as friction",
"This value determines whether the information about the current camrea state is "
"shown on the screen"
};
static const openspace::properties::Property::PropertyInfo TakeScreenshotInfo = {
"TakeScreenshot",
"Take Screenshot",
@@ -206,6 +213,7 @@ RenderEngine::RenderEngine()
, _showInfo(ShowInfoInfo, true)
, _showLog(ShowLogInfo, true)
, _showVersionInfo(ShowVersionInfo, true)
, _showCameraInfo(ShowCameraInfo, true)
, _takeScreenshot(TakeScreenshotInfo)
, _shouldTakeScreenshot(false)
, _applyWarping(ApplyWarpingInfo, false)
@@ -260,6 +268,7 @@ RenderEngine::RenderEngine()
addProperty(_showInfo);
addProperty(_showLog);
addProperty(_showVersionInfo);
addProperty(_showCameraInfo);
_nAaSamples.onChange([this](){
if (_renderer) {
@@ -1301,6 +1310,68 @@ void RenderEngine::renderInformation() {
}
}
void RenderEngine::renderCameraInformation() {
if (!_showCameraInfo) {
return;
}
const glm::vec4 enabled = glm::vec4(0.2f, 0.75f, 0.2f, 1.f);
const glm::vec4 disabled = glm::vec4(0.55f, 0.2f, 0.2f, 1.f);
using FR = ghoul::fontrendering::FontRenderer;
FR::BoundingBoxInformation rotationBox = FR::defaultRenderer().boundingBox(
*_fontInfo,
"%s",
"Rotation"
);
float penPosY = fontResolution().y - rotationBox.boundingBox.y;
const float ySeparation = 5.f;
const float xSeparation = 5.f;
interaction::OrbitalNavigator nav = OsEng.navigationHandler().orbitalNavigator();
FR::defaultRenderer().render(
*_fontInfo,
glm::vec2(fontResolution().x - rotationBox.boundingBox.x - xSeparation, penPosY),
nav.hasRotationalFriction() ? enabled : disabled,
"%s",
"Rotation"
);
penPosY -= rotationBox.boundingBox.y + ySeparation;
FR::BoundingBoxInformation zoomBox = FR::defaultRenderer().boundingBox(
*_fontInfo,
"%s",
"Zoom"
);
FR::defaultRenderer().render(
*_fontInfo,
glm::vec2(fontResolution().x - zoomBox.boundingBox.x - xSeparation, penPosY),
nav.hasZoomFriction() ? enabled : disabled,
"%s",
"Zoom"
);
penPosY -= zoomBox.boundingBox.y + ySeparation;
FR::BoundingBoxInformation rollBox = FR::defaultRenderer().boundingBox(
*_fontInfo,
"%s",
"Roll"
);
FR::defaultRenderer().render(
*_fontInfo,
glm::vec2(fontResolution().x - rollBox.boundingBox.x - xSeparation, penPosY),
nav.hasRollFriction() ? enabled : disabled,
"%s",
"Roll"
);
}
void RenderEngine::renderVersionInformation() {
if (!_showVersionInfo) {
return;