History

Simplifications suggested by Andrew.

Andrzej Kapolka committed 12 years ago

Commit e01113d1 parent 36e78921 file · +1 −4Browse files

Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/MetavoxelSystem.cpp+1−4
@@ -1899,12 +1899,9 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 1898 unmodified lines
1899 int largestI = (largestIndex == 0) ? 1 : 2; 1899 int largestI = (largestIndex == 0) ? 1 : 2;
1900 float sjj = d[largestJ][largestJ];1900 float sjj = d[largestJ][largestJ];
1901 float sii = d[largestI][largestI];1901 float sii = d[largestI][largestI];
1902 float angle = (sii == sjj ? PI_OVER_TWO : glm::atan(2.0f * d[largestJ][largestI], sjj - sii)) / 2.0f;1902 float angle = glm::atan(2.0f * d[largestJ][largestI], sjj - sii) / 2.0f;
1903 glm::quat rotation = glm::angleAxis(angle, largestIndex == 0 ? glm::vec3(0.0f, 0.0f, -1.0f) :1903 glm::quat rotation = glm::angleAxis(angle, largestIndex == 0 ? glm::vec3(0.0f, 0.0f, -1.0f) :
1904 (largestIndex == 1 ? glm::vec3(0.0f, 1.0f, 0.0f) : glm::vec3(-1.0f, 0.0f, 0.0f)));1904 (largestIndex == 1 ? glm::vec3(0.0f, 1.0f, 0.0f) : glm::vec3(-1.0f, 0.0f, 0.0f)));
1905 if (rotation.w == 0.0f) {
1906 break;
1907 }
1908 combinedRotation = glm::normalize(rotation * combinedRotation);1905 combinedRotation = glm::normalize(rotation * combinedRotation);
1909 glm::mat3 matrix = glm::mat3_cast(combinedRotation);1906 glm::mat3 matrix = glm::mat3_cast(combinedRotation);
1910 d = matrix * ata * glm::transpose(matrix);1907 d = matrix * ata * glm::transpose(matrix);