Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1985,11 +1985,11 @@ int VoxelAugmentVisitor::visit(MetavoxelInfo& info) { · 1984 unmodified lines | ||
| 1985 | 1985 | } |
| 1986 | 1986 | } |
| 1987 | 1987 | |
| 1988 | − // compute the pseudo-inverse, ataplus | |
| 1988 | + // compute the pseudo-inverse, ataplus, and use to find the minimizing solution | |
| 1989 | 1989 | glm::mat3 ataplus = glm::transpose(u) * d * u; |
| 1990 | − | |
| 1991 | 1990 | glm::vec3 solution = (ataplus * atrans * b) + center; |
| 1992 | 1991 | |
| 1992 | + // make sure it doesn't fall beyond the cell boundaries | |
| 1993 | 1993 | center = glm::clamp(solution, 0.0f, 1.0f); |
| 1994 | 1994 | |
| 1995 | 1995 | if (totalWeight > 0.0f) { |