Skip to content

Commit

Permalink
fix structure transform scale calculation (#151)
Browse files Browse the repository at this point in the history
fixes #150
  • Loading branch information
nmwsharp authored Dec 26, 2021
1 parent 8e692da commit fda65ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ std::tuple<glm::vec3, glm::vec3> Structure::boundingBox() {
float Structure::lengthScale() {
// compute the scaling caused by the object transform
const glm::mat4x4& T = objectTransform.get();
float transScale = (T[0][0] + T[1][1] + T[2][2]) / (3. * T[3][3]);
float transScale = abs(glm::determinant(glm::mat3x3(T))) / T[3][3];
return transScale * objectSpaceLengthScale;
}

Expand Down

0 comments on commit fda65ff

Please sign in to comment.