History

Fix for voxelizing models.

Andrzej Kapolka committed 12 years ago

Commit 38022d21 parent 1bf19113 files · +13 −4Browse files

Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Application.cpp+7−4
@@ -2229,8 +2229,7 @@ void Application::updateShadowMap() { · 2228 unmodified lines
22292229 glRotatef(glm::degrees(glm::angle(inverseRotation)), axis.x, axis.y, axis.z);
22302230
22312231 // 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();
22342233
22352234 _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE);
22362235 _particles.render();
@@ -2315,8 +2314,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 78 unmodified lines
23152314 glRotatef(-glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
23162315
23172316 // 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());
23202318
23212319 glTranslatef(_viewMatrixTranslation.x, _viewMatrixTranslation.y, _viewMatrixTranslation.z);
23222320
@@ -2447,6 +2445,11 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 124 unmodified lines
24472445 }
24482446 }
24492447
2448+void Application::updateUntranslatedViewMatrix(const glm::vec3& viewMatrixTranslation) {
2449+ glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix);
2450+ _viewMatrixTranslation = viewMatrixTranslation;
2451+}
2452+
24502453 void Application::loadTranslatedViewMatrix(const glm::vec3& translation) {
24512454 glLoadMatrixf((const GLfloat*)&_untranslatedViewMatrix);
24522455 glTranslatef(translation.x + _viewMatrixTranslation.x, translation.y + _viewMatrixTranslation.y,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t