Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all
Unified · Split
| @@ -2866,6 +2866,12 @@ void Application::setupWorldLight(Camera& whichCamera) { · 2865 unmodified lines | |||
| 2866 | glMateriali(GL_FRONT, GL_SHININESS, 96); | 2866 | glMateriali(GL_FRONT, GL_SHININESS, 96); |
| 2867 | } | 2867 | } |
| 2868 | 2868 | ||
| 2869 | void Application::loadTranslatedViewMatrix(const glm::vec3& translation) { | ||
| 2870 | glLoadMatrixf((const GLfloat*)&_untranslatedViewMatrix); | ||
| 2871 | glTranslatef(translation.x + _viewMatrixTranslation.x, translation.y + _viewMatrixTranslation.y, | ||
| 2872 | translation.z + _viewMatrixTranslation.z); | ||
| 2873 | } | ||
| 2874 | |||
| 2869 | void Application::computeOffAxisFrustum(float& left, float& right, float& bottom, float& top, float& near, | 2875 | void Application::computeOffAxisFrustum(float& left, float& right, float& bottom, float& top, float& near, |
| 2870 | float& far, glm::vec4& nearClipPlane, glm::vec4& farClipPlane) const { | 2876 | float& far, glm::vec4& nearClipPlane, glm::vec4& farClipPlane) const { |
| 2871 | 2877 | ||
| @@ -2899,7 +2905,11 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 27 unmodified lines | |||
| 2899 | glm::vec3 axis = glm::axis(rotation); | 2905 | glm::vec3 axis = glm::axis(rotation); |
| 2900 | glRotatef(-glm::angle(rotation), axis.x, axis.y, axis.z); | 2906 | glRotatef(-glm::angle(rotation), axis.x, axis.y, axis.z); |
| 2901 | 2907 | ||
| 2902 | glTranslatef(-whichCamera.getPosition().x, -whichCamera.getPosition().y, -whichCamera.getPosition().z); | 2908 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2909 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); | ||
| 2910 | _viewMatrixTranslation = -whichCamera.getPosition(); | ||
| 2911 | |||
| 2912 | glTranslatef(_viewMatrixTranslation.x, _viewMatrixTranslation.y, _viewMatrixTranslation.z); | ||
| 2903 | 2913 | ||
| 2904 | // Setup 3D lights (after the camera transform, so that they are positioned in world space) | 2914 | // Setup 3D lights (after the camera transform, so that they are positioned in world space) |
| 2905 | setupWorldLight(whichCamera); | 2915 | setupWorldLight(whichCamera); |