Skip to content

Commit

Permalink
sSharedTmpMatrix=>mTmpMatrix, make sure the thread safety.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashqal committed Sep 7, 2017
1 parent af3cbf5 commit f2be92f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MDMutablePosition extends MDPosition {

private float[] mModelMatrix = null;
private float[] mRotationMatrix = null;
private static final float[] sSharedTmpMatrix = new float[16];
private final float[] mTmpMatrix = new float[16];

private float mX;
private float mY;
Expand Down Expand Up @@ -185,8 +185,8 @@ private void ensure(){

// rotation
if (mRotationMatrix != null){
Matrix.multiplyMM(sSharedTmpMatrix, 0, mRotationMatrix, 0, mModelMatrix, 0);
System.arraycopy(sSharedTmpMatrix, 0, mModelMatrix, 0, 16);
Matrix.multiplyMM(mTmpMatrix, 0, mRotationMatrix, 0, mModelMatrix, 0);
System.arraycopy(mTmpMatrix, 0, mModelMatrix, 0, 16);
}

changed = false;
Expand Down

0 comments on commit f2be92f

Please sign in to comment.