diff --git a/ext/ghoul b/ext/ghoul index 132f5d343d..721b830c79 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 132f5d343d087ade95f4b8c01e40b2abb31a7be8 +Subproject commit 721b830c790243b58a8b9029f2fe544c38562f2e diff --git a/src/scenegraph/scenegraph.cpp b/src/scenegraph/scenegraph.cpp index 90e80ea0fd..64c0137886 100644 --- a/src/scenegraph/scenegraph.cpp +++ b/src/scenegraph/scenegraph.cpp @@ -178,11 +178,17 @@ bool SceneGraph::initialize() // TODO: Set scaling dependent on the position and distance // set position for camera const pss bound = positionNode->calculateBoundingSphere(); + + // this part is full of magic! + glm::vec2 boundf = bound.getVec2f(); + glm::vec2 scaling{1.0f, -boundf[1]}; + boundf[0] *= 5.0f; + psc cameraPosition = positionNode->getPosition(); - cameraPosition += psc(glm::vec4(0.f, 0.f, bound.getVec2f())); + cameraPosition += psc(glm::vec4(0.f, 0.f, boundf)); c->setPosition(cameraPosition); c->setCameraDirection(glm::vec3(0, 0, -1)); - c->setScaling(glm::vec2(1.0, 0.0)); + c->setScaling(scaling); // Set the focus node for the interactionhandler OsEng.interactionHandler().setFocusNode(focusNode); diff --git a/src/util/camera.cpp b/src/util/camera.cpp index b3957c6dc4..e28f62d643 100644 --- a/src/util/camera.cpp +++ b/src/util/camera.cpp @@ -35,9 +35,9 @@ namespace openspace { Camera::Camera() - : _scaling(1.f, 0.f) + : _cameraDirection(0.f, 0.f, 0.f) + , _scaling(1.f, 0.f) , _viewRotation(glm::quat(glm::vec3(0.f, 0.f, 0.f))) - , _cameraDirection(0.f, 0.f, 0.f) { }