mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 20:21:24 -06:00
Fix on camera issues with it not following rotation/position of focus node. configSensitivites() only done during globebrowsing now
This commit is contained in:
@@ -160,7 +160,7 @@ void TouchInteraction::step(double dt) {
|
||||
dvec3 centerPos = _focusNode->worldPosition();
|
||||
dvec3 focusNodeDiff = centerPos - _previousFocusNodePosition;
|
||||
_previousFocusNodePosition = centerPos;
|
||||
camPos += focusNodeDiff;
|
||||
//camPos += focusNodeDiff;
|
||||
|
||||
dvec3 directionToCenter = normalize(centerPos - camPos);
|
||||
dvec3 centerToCamera = camPos - centerPos;
|
||||
@@ -236,10 +236,8 @@ void TouchInteraction::step(double dt) {
|
||||
_camera->setPositionVec3(camPos);
|
||||
_camera->setRotation(globalCamRot * localCamRot);
|
||||
}
|
||||
else {
|
||||
else
|
||||
setFocusNode(OsEng.interactionHandler().focusNode());
|
||||
std::cout << "focus node set\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <modules/globebrowsing/geometry/geodetic2.h>
|
||||
#endif
|
||||
|
||||
#include <glm/gtx/string_cast.hpp>
|
||||
|
||||
namespace {
|
||||
const std::string _loggerCat = "InteractionMode";
|
||||
@@ -395,7 +396,7 @@ void OrbitalInteractionMode::updateCameraStateFromMouseStates(Camera& camera, do
|
||||
// Follow focus nodes movement
|
||||
dvec3 centerPos = _focusNode->worldPosition();
|
||||
dvec3 focusNodeDiff = centerPos - _previousFocusNodePosition;
|
||||
_previousFocusNodePosition = centerPos;
|
||||
_previousFocusNodePosition = centerPos;
|
||||
camPos += focusNodeDiff;
|
||||
|
||||
dquat totalRotation = camera.rotationQuaternion();
|
||||
@@ -481,8 +482,8 @@ void OrbitalInteractionMode::updateCameraStateFromMouseStates(Camera& camera, do
|
||||
}
|
||||
|
||||
// Update the camera state
|
||||
//camera.setPositionVec3(camPos);
|
||||
//camera.setRotation(globalCameraRotation * localCameraRotation);
|
||||
camera.setPositionVec3(camPos);
|
||||
camera.setRotation(globalCameraRotation * localCameraRotation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -681,15 +682,8 @@ void GlobeBrowsingInteractionMode::updateCameraStateFromMouseStates(Camera& came
|
||||
}
|
||||
|
||||
// Update the camera state
|
||||
//camera.setPositionVec3(camPos);
|
||||
//camera.setRotation(globalCameraRotation * localCameraRotation);
|
||||
|
||||
std::cout << "gRot: " << "(" << _mouseStates->synchedGlobalRotationMouseVelocity().x << "," << _mouseStates->synchedGlobalRotationMouseVelocity().y << ")"
|
||||
<< ", lRot: " << "(" << _mouseStates->synchedLocalRotationMouseVelocity().x << "," << _mouseStates->synchedLocalRotationMouseVelocity().y << ")"
|
||||
<< ", Zoom: " << "(" << _mouseStates->synchedTruckMovementMouseVelocity().x << "," << _mouseStates->synchedTruckMovementMouseVelocity().y << ")"
|
||||
<< ", gRoll: " << "(" << _mouseStates->synchedGlobalRollMouseVelocity().x << "," << _mouseStates->synchedGlobalRollMouseVelocity().y << ")"
|
||||
<< ", lRoll: " << "(" << _mouseStates->synchedLocalRollMouseVelocity().x << "," << _mouseStates->synchedLocalRollMouseVelocity().y << ")"
|
||||
<< "\n";
|
||||
camera.setPositionVec3(camPos);
|
||||
camera.setRotation(globalCameraRotation * localCameraRotation);
|
||||
}
|
||||
#endif // OPENSPACE_MODULE_GLOBEBROWSING_ENABLED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user