Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -2229,8 +2229,7 @@ void Application::updateShadowMap() { · 2228 unmodified lines | ||
| 2229 | 2229 | glRotatef(glm::degrees(glm::angle(inverseRotation)), axis.x, axis.y, axis.z); |
| 2230 | 2230 | |
| 2231 | 2231 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2232 | − glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); | |
| 2233 | − _viewMatrixTranslation = glm::vec3(); | |
| 2232 | + updateUntranslatedViewMatrix(); | |
| 2234 | 2233 | |
| 2235 | 2234 | _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE); |
| 2236 | 2235 | _particles.render(); |
| @@ -2315,8 +2314,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 78 unmodified lines | ||
| 2315 | 2314 | glRotatef(-glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); |
| 2316 | 2315 | |
| 2317 | 2316 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2318 | − glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); | |
| 2319 | − _viewMatrixTranslation = -whichCamera.getPosition(); | |
| 2317 | + updateUntranslatedViewMatrix(-whichCamera.getPosition()); | |
| 2320 | 2318 | |
| 2321 | 2319 | glTranslatef(_viewMatrixTranslation.x, _viewMatrixTranslation.y, _viewMatrixTranslation.z); |
| 2322 | 2320 | |
| @@ -2447,6 +2445,11 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 124 unmodified lines | ||
| 2447 | 2445 | } |
| 2448 | 2446 | } |
| 2449 | 2447 | |
| 2448 | +void Application::updateUntranslatedViewMatrix(const glm::vec3& viewMatrixTranslation) { | |
| 2449 | + glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); | |
| 2450 | + _viewMatrixTranslation = viewMatrixTranslation; | |
| 2451 | +} | |
| 2452 | + | |
| 2450 | 2453 | void Application::loadTranslatedViewMatrix(const glm::vec3& translation) { |
| 2451 | 2454 | glLoadMatrixf((const GLfloat*)&_untranslatedViewMatrix); |
| 2452 | 2455 | glTranslatef(translation.x + _viewMatrixTranslation.x, translation.y + _viewMatrixTranslation.y, |