Fixes to remove warnings and camera distance fix

This commit is contained in:
Jonas Strandstedt
2014-05-06 12:45:18 -04:00
parent d09a1e0b54
commit 541f080bfe
3 changed files with 11 additions and 5 deletions

View File

@@ -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);

View File

@@ -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)
{
}