Remove functions setViewRotationMatrix and compileViewRotationMatrix from camera class.

This commit is contained in:
Kalle Bladin
2016-05-19 12:22:55 -04:00
parent 0215c63bab
commit 9dda48d44b
4 changed files with 2 additions and 34 deletions

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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(),

View File

@@ -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));