Merge branch 'feature/interaction' into feature/globebrowsing

This commit is contained in:
Kalle Bladin
2016-05-25 16:37:20 -04:00

View File

@@ -820,7 +820,11 @@ void OrbitalInteractionMode::updateCameraStateFromMouseStates() {
glm::normalize(glm::quat_cast(glm::inverse(lookAtMat)));
}
{ // Move position towards or away from focus node
newPosition += -posDiff * _truckMovementMouseState.velocity.get().y;
glm::dvec3 centerToBoundingSphere =
glm::normalize(posDiff) *
static_cast<double>(_focusNode->boundingSphere().lengthf());
newPosition += -(posDiff + centerToBoundingSphere) *
_truckMovementMouseState.velocity.get().y;
}
{ // Do roll
glm::dquat cameraRollRotation =