Browse Source

- Used TempVars for transform calculation in getOffsetTransform

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7170 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om 14 years ago
parent
commit
c63c4a3e2b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      engine/src/core/com/jme3/animation/Bone.java

+ 5 - 2
engine/src/core/com/jme3/animation/Bone.java

@@ -93,8 +93,6 @@ public final class Bone implements Savable {
     private Quaternion worldRot = new Quaternion();
     private Quaternion worldRot = new Quaternion();
     private Vector3f worldScale = new Vector3f();
     private Vector3f worldScale = new Vector3f();
 
 
-    // TODO: Get rid of this temp variable
-    private Matrix3f rotMat = new Matrix3f();
     
     
     /**
     /**
      * Creates a new bone with the given name.
      * Creates a new bone with the given name.
@@ -343,7 +341,12 @@ public final class Bone implements Savable {
         
         
         //populating the matrix
         //populating the matrix
         m.loadIdentity();
         m.loadIdentity();
+        TempVars vars = TempVars.get();
+        assert vars.lock();
+        Matrix3f rotMat = vars.tempMat3;
         m.setTransform(translate, scale, rotate.toRotationMatrix(rotMat));
         m.setTransform(translate, scale, rotate.toRotationMatrix(rotMat));
+
+        assert vars.unlock();
     }
     }
 
 
     /**
     /**