mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 09:59:44 -05:00
Camera navigation in local and global space
CameraRotationDecomposition decomposeCameraRotationSurface made public in order to acces global and local camera rotations. Co-Authored-By: Emil Wallberg <49481622+EmilWallberg@users.noreply.github.com>
This commit is contained in:
@@ -157,12 +157,23 @@ public:
|
||||
*/
|
||||
static scripting::LuaLibrary luaLibrary();
|
||||
|
||||
private:
|
||||
struct CameraRotationDecomposition {
|
||||
glm::dquat localRotation = glm::dquat(1.0, 0.0, 0.0, 0.0);
|
||||
glm::dquat globalRotation = glm::dquat(1.0, 0.0, 0.0, 0.0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Decomposes the camera's rotation in to a global and a local rotation defined by
|
||||
* CameraRotationDecomposition. The global rotation defines the rotation so that the
|
||||
* camera points towards the reference node in the direction opposite to the direction
|
||||
* out from the surface of the object. The local rotation defines the differential
|
||||
* from the global to the current total rotation so that
|
||||
* `cameraRotation = globalRotation * localRotation`.
|
||||
*/
|
||||
CameraRotationDecomposition decomposeCameraRotationSurface(
|
||||
const CameraPose& cameraPose, const SceneGraphNode& reference);
|
||||
private:
|
||||
|
||||
using Displacement = std::pair<glm::dvec3, glm::dvec3>;
|
||||
|
||||
struct Friction : public properties::PropertyOwner {
|
||||
@@ -270,17 +281,6 @@ private:
|
||||
|
||||
float _movementTimer = 0.f;
|
||||
|
||||
/**
|
||||
* Decomposes the camera's rotation in to a global and a local rotation defined by
|
||||
* CameraRotationDecomposition. The global rotation defines the rotation so that the
|
||||
* camera points towards the reference node in the direction opposite to the direction
|
||||
* out from the surface of the object. The local rotation defines the differential
|
||||
* from the global to the current total rotation so that
|
||||
* `cameraRotation = globalRotation * localRotation`.
|
||||
*/
|
||||
CameraRotationDecomposition decomposeCameraRotationSurface(
|
||||
const CameraPose& cameraPose, const SceneGraphNode& reference);
|
||||
|
||||
/**
|
||||
* Decomposes the camera's rotation in to a global and a local rotation defined by
|
||||
* CameraRotationDecomposition. The global rotation defines the rotation so that the
|
||||
|
||||
Reference in New Issue
Block a user