Skip to content

Commit

Permalink
Fix local translation with snap and scaled matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricGuillemet committed Sep 19, 2016
1 parent 967d79b commit d91a17b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ImGuizmo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,9 +1137,13 @@ namespace ImGuizmo
vec_t cumulativeDelta = gContext.mModel.v.position + delta - gContext.mMatrixOrigin;
if (applyRotationLocaly)
{
cumulativeDelta.TransformVector(gContext.mModelSourceInverse);
matrix_t modelSourceNormalized = gContext.mModelSource;
modelSourceNormalized.OrthoNormalize();
matrix_t modelSourceNormalizedInverse;
modelSourceNormalizedInverse.Inverse(modelSourceNormalized);
cumulativeDelta.TransformVector(modelSourceNormalizedInverse);
ComputeSnap(cumulativeDelta, snap);
cumulativeDelta.TransformVector(gContext.mModelSource);
cumulativeDelta.TransformVector(modelSourceNormalized);
}
else
{
Expand Down

0 comments on commit d91a17b

Please sign in to comment.