Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -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); |