mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-08 04:31:08 -06:00
Remove functions setViewRotationMatrix and compileViewRotationMatrix from camera class.
This commit is contained in:
@@ -90,11 +90,6 @@ public:
|
||||
float sinMaxFov() const;
|
||||
const glm::mat4& viewRotationMatrix() const;
|
||||
|
||||
|
||||
// TEMPORARY
|
||||
void setViewRotationMatrix(glm::mat4 m);
|
||||
void compileViewRotationMatrix();
|
||||
|
||||
//@TODO this should simply be called viewMatrix!
|
||||
//Rename after removing deprecated methods
|
||||
const glm::mat4& combinedViewMatrix() const;
|
||||
|
||||
@@ -160,9 +160,9 @@ void InteractionHandler::update(double deltaTime) {
|
||||
|
||||
_keyframeMutex.unlock();
|
||||
|
||||
if(hasKeys){
|
||||
if (hasKeys) {
|
||||
_camera->setPosition(pos);
|
||||
_camera->setViewRotationMatrix(glm::mat4_cast(q));
|
||||
_camera->setRotation(q);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -347,10 +347,6 @@ void RenderEngine::postSynchronizationPreDraw() {
|
||||
ghoul::fontrendering::FontRenderer::defaultRenderer().setWindowSize(glm::vec2(res));
|
||||
}
|
||||
|
||||
// converts the quaternion used to rotation matrices
|
||||
if (_mainCamera)
|
||||
_mainCamera->compileViewRotationMatrix();
|
||||
|
||||
// update and evaluate the scene starting from the root node
|
||||
_sceneGraph->update({
|
||||
Time::ref().currentTime(),
|
||||
|
||||
@@ -125,29 +125,6 @@ const glm::mat4& Camera::viewRotationMatrix() const {
|
||||
return _viewRotationMatrix.synced;
|
||||
}
|
||||
|
||||
void Camera::setViewRotationMatrix(glm::mat4 m) {
|
||||
/*
|
||||
std::lock_guard<std::mutex> _lock(_mutex);
|
||||
_localViewRotationMatrix = m;
|
||||
*/
|
||||
}
|
||||
|
||||
void Camera::compileViewRotationMatrix()
|
||||
{
|
||||
/*
|
||||
std::lock_guard<std::mutex> _lock(_mutex);
|
||||
// convert from quaternion to rotation matrix using glm
|
||||
//_viewRotationMatrix = glm::mat4_cast(_viewRotation);
|
||||
|
||||
// the camera matrix needs to be rotated inverse to the world
|
||||
// _viewDirection = glm::rotate(glm::inverse(_viewRotation), _cameraDirection);
|
||||
//_viewDirection = (glm::inverse(_localViewRotationMatrix) * glm::vec4(_cameraDirection, 0.f)).xyz;
|
||||
_viewDirection = (glm::inverse(_localViewRotationMatrix) * glm::vec4(_cameraDirection, 0.f)).xyz();
|
||||
_viewDirection = glm::normalize(_viewDirection);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
const glm::mat4& Camera::combinedViewMatrix() const {
|
||||
glm::vec3 cameraPosition = position().vec3();
|
||||
glm::mat4 viewTransform = glm::inverse(glm::translate(glm::mat4(1.0), cameraPosition));
|
||||
|
||||
Reference in New Issue
Block a user