ensured master does not care about scene orientation (to make navigation on master easier )

This commit is contained in:
Joakim Kilby
2015-02-19 17:34:13 +01:00
parent 9bad48ae2e
commit e35736bd4d
2 changed files with 10 additions and 2 deletions

View File

@@ -162,10 +162,18 @@ void mainPostSyncPreDrawFunc()
void mainRenderFunc()
{
//not the most efficient, but for clarity @JK
glm::mat4 userMatrix = glm::translate(glm::mat4(1.f), _sgctEngine->getUserPtr()->getPos());
glm::mat4 sceneMatrix = _sgctEngine->getModelMatrix();
glm::mat4 viewMatrix = _sgctEngine->getActiveViewMatrix() * userMatrix;
//dont shift nav-direction on master, makes it very tricky to navigate @JK
if (!_sgctEngine->isMaster()){
viewMatrix = viewMatrix * sceneMatrix;
}
glm::mat4 projectionMatrix = _sgctEngine->getActiveProjectionMatrix();
OsEng.render(projectionMatrix, viewMatrix);
OsEng.render(projectionMatrix, viewMatrix);
}
void mainPostDrawFunc()

View File

@@ -386,7 +386,7 @@ namespace openspace {
_mainCamera->setProjectionMatrix(
projectionMatrix);
//Is this really necessary to store?
//Is this really necessary to store? @JK
_mainCamera->setViewProjectionMatrix(projectionMatrix * viewMatrix);
// render the scene starting from the root node