mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Added proper synchronization for mouse controller and camera.
Camera class now contains three instances of synched variables. a local copy changed on master. a shared copy only used for sharing in serialize/deserialize. and finally a synched copy never written to except in post sync
This commit is contained in:
@@ -118,9 +118,9 @@ public:
|
||||
|
||||
void orbitDelta(const glm::quat& rotation);
|
||||
|
||||
void orbit(const float &dx, const float &dy, const float &dz);
|
||||
void orbit(const float &dx, const float &dy, const float &dz, const float &dist);
|
||||
|
||||
void distance(const float &d);
|
||||
//void distance(const float &d);
|
||||
|
||||
void rotateDelta(const glm::quat& rotation);
|
||||
|
||||
|
||||
@@ -136,30 +136,41 @@ public:
|
||||
const glm::vec3& lookUpVector() const;
|
||||
|
||||
void postSynchronizationPreDraw();
|
||||
void preSynchronization();
|
||||
void serialize(SyncBuffer* syncBuffer);
|
||||
void deserialize(SyncBuffer* syncBuffer);
|
||||
|
||||
private:
|
||||
float _maxFov;
|
||||
float _sinMaxFov;
|
||||
psc _position;
|
||||
glm::mat4 _viewProjectionMatrix;
|
||||
glm::mat4 _modelMatrix;
|
||||
glm::mat4 _viewMatrix;
|
||||
glm::mat4 _projectionMatrix;
|
||||
glm::vec3 _viewDirection;
|
||||
glm::vec3 _cameraDirection;
|
||||
glm::vec2 _scaling;
|
||||
// glm::quat _viewRotation;
|
||||
glm::mat4 _viewRotationMatrix; // compiled from the quaternion
|
||||
|
||||
// glm::quat _viewRotation;
|
||||
|
||||
glm::vec3 _lookUp;
|
||||
|
||||
//cluster variables
|
||||
std::mutex _syncMutex;
|
||||
|
||||
//local variables
|
||||
glm::mat4 _localViewRotationMatrix;
|
||||
glm::vec2 _localScaling;
|
||||
psc _localPosition;
|
||||
|
||||
//shared copies of local variables
|
||||
glm::vec2 _sharedScaling;
|
||||
psc _sharedPosition;
|
||||
glm::mat4 _sharedViewRotationMatrix;
|
||||
std::mutex _syncMutex;
|
||||
|
||||
//cluster synced variables
|
||||
glm::vec2 _syncedScaling;
|
||||
psc _syncedPosition;
|
||||
glm::mat4 _syncedViewRotationMatrix;
|
||||
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user