Skip to content

Commit 7ca74c6

Browse files
PaulHaxfloryst
authored andcommitted
perf(InteractorStyleManipulator): remove identity check
1 parent 6b2617c commit 7ca74c6

File tree

1 file changed

+3
-8
lines changed
  • Sources/Interaction/Style/InteractorStyleManipulator

1 file changed

+3
-8
lines changed

Sources/Interaction/Style/InteractorStyleManipulator/index.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function transformVectorByTransformation(
159159
afterMatrix,
160160
vector
161161
) {
162-
const { matrixA, matrixB, identityMatrix, newCenter } = tempObjects;
162+
const { matrixA, matrixB, newCenter } = tempObjects;
163163

164164
// The view matrix from vtk.js is row-major, but gl-matrix expects column-major.
165165
// We need to transpose them before use.
@@ -171,12 +171,8 @@ function transformVectorByTransformation(
171171
// Compute delta transformation matrix
172172
mat4.multiply(matrixA, matrixB, matrixA);
173173

174-
// Apply transformation if matrix changed
175-
if (!mat4.equals(matrixA, identityMatrix)) {
176-
vec3.transformMat4(newCenter, vector, matrixA);
177-
return newCenter;
178-
}
179-
return vector;
174+
vec3.transformMat4(newCenter, vector, matrixA);
175+
return newCenter;
180176
}
181177

182178
/**
@@ -233,7 +229,6 @@ function vtkInteractorStyleManipulator(publicAPI, model) {
233229
const tempComputeObjects = {
234230
matrixA: mat4.create(),
235231
matrixB: mat4.create(),
236-
identityMatrix: mat4.identity(mat4.create()),
237232
newCenter: vec3.create(),
238233
};
239234

0 commit comments

Comments
 (0)