mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 03:00:58 -06:00
Remove psc internally from camera class.
This commit is contained in:
@@ -73,14 +73,14 @@ namespace openspace {
|
||||
void rotate(Quat rotation);
|
||||
|
||||
// Accessors
|
||||
const psc& position() const;
|
||||
const psc& unsynchedPosition() const;
|
||||
const psc& focusPosition() const;
|
||||
const glm::vec3 viewDirectionWorldSpace() const;
|
||||
const glm::vec3 lookUpVectorCameraSpace() const;
|
||||
psc position() const;
|
||||
psc unsynchedPosition() const;
|
||||
psc focusPosition() const;
|
||||
glm::vec3 viewDirectionWorldSpace() const;
|
||||
glm::vec3 lookUpVectorCameraSpace() const;
|
||||
const glm::vec2& scaling() const;
|
||||
const glm::mat4 viewRotationMatrix() const;
|
||||
const glm::quat rotationQuaternion() const;
|
||||
glm::mat4 viewRotationMatrix() const;
|
||||
glm::quat rotationQuaternion() const;
|
||||
float maxFov() const;
|
||||
float sinMaxFov() const;
|
||||
|
||||
@@ -159,9 +159,9 @@ namespace openspace {
|
||||
// State of the camera
|
||||
SyncData<Quat> _rotation;
|
||||
SyncData<glm::vec2> _scaling;
|
||||
SyncData<psc> _position;
|
||||
SyncData<Vec3> _position;
|
||||
|
||||
psc _focusPosition;
|
||||
Vec3 _focusPosition;
|
||||
|
||||
float _maxFov;
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ namespace openspace {
|
||||
, _focusPosition()
|
||||
{
|
||||
_scaling.local = glm::vec2(1.f, 0.f);
|
||||
_position.local = psc();
|
||||
Vec3 eulerAngles(0.0f, 0.0f, 0.0f);
|
||||
_position.local = Vec3(0, 0, 0);
|
||||
Vec3 eulerAngles(0, 0, 0);
|
||||
_rotation.local = Quat(eulerAngles);
|
||||
}
|
||||
|
||||
@@ -62,12 +62,12 @@ namespace openspace {
|
||||
|
||||
void Camera::setPosition(psc pos) {
|
||||
std::lock_guard<std::mutex> _lock(_mutex);
|
||||
_position.local = std::move(pos);
|
||||
_position.local = pos.dvec3();
|
||||
}
|
||||
|
||||
void Camera::setFocusPosition(psc pos) {
|
||||
std::lock_guard<std::mutex> _lock(_mutex);
|
||||
_focusPosition = pos;
|
||||
_focusPosition = pos.dvec3();
|
||||
}
|
||||
|
||||
void Camera::setRotation(Quat rotation) {
|
||||
@@ -101,19 +101,19 @@ namespace openspace {
|
||||
// CAMERA ACCESSORS (GETTERS) //
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const psc& Camera::position() const {
|
||||
return _position.synced;
|
||||
psc Camera::position() const {
|
||||
return psc(_position.synced);
|
||||
}
|
||||
|
||||
const psc& Camera::unsynchedPosition() const {
|
||||
return _position.local;
|
||||
psc Camera::unsynchedPosition() const {
|
||||
return psc(_position.local);
|
||||
}
|
||||
|
||||
const psc& Camera::focusPosition() const {
|
||||
return _focusPosition;
|
||||
psc Camera::focusPosition() const {
|
||||
return psc(_focusPosition);
|
||||
}
|
||||
|
||||
const glm::vec3 Camera::viewDirectionWorldSpace() const {
|
||||
glm::vec3 Camera::viewDirectionWorldSpace() const {
|
||||
if (_cachedViewDirection.isDirty) {
|
||||
_cachedViewDirection.datum =
|
||||
glm::inverse(_rotation.local) * Vec3(_VIEW_DIRECTION_CAMERA_SPACE);
|
||||
@@ -122,7 +122,7 @@ namespace openspace {
|
||||
return _cachedViewDirection.datum;
|
||||
}
|
||||
|
||||
const glm::vec3 Camera::lookUpVectorCameraSpace() const {
|
||||
glm::vec3 Camera::lookUpVectorCameraSpace() const {
|
||||
return _LOOKUP_VECTOR_CAMERA_SPACE;
|
||||
}
|
||||
|
||||
@@ -141,14 +141,14 @@ namespace openspace {
|
||||
return _cachedSinMaxFov.datum;
|
||||
}
|
||||
|
||||
const glm::mat4 Camera::viewRotationMatrix() const {
|
||||
glm::mat4 Camera::viewRotationMatrix() const {
|
||||
if (_cachedViewRotationMatrix.isDirty) {
|
||||
_cachedViewRotationMatrix.datum = glm::mat4_cast(_rotation.local);
|
||||
}
|
||||
return _cachedViewRotationMatrix.datum;
|
||||
}
|
||||
|
||||
const glm::quat Camera::rotationQuaternion() const {
|
||||
glm::quat Camera::rotationQuaternion() const {
|
||||
return _rotation.synced;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user