* Proper TempVars lock/unlock usage in SkeletonControl ... Although it shouldn't really break anything since that class is the only one using the skinning arrays.

* Deprecated Transform.Identity since it does not follow conventions. Added IDENTITY to replace it.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7168 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 2611139702
commit 636339a432
  1. 4
      engine/src/core/com/jme3/animation/SkeletonControl.java
  2. 12
      engine/src/core/com/jme3/math/Transform.java
  3. 2
      engine/src/core/com/jme3/scene/Spatial.java

@ -119,6 +119,8 @@ public class SkeletonControl extends AbstractControl implements Savable, Cloneab
int idxWeights = 0; int idxWeights = 0;
TempVars vars = TempVars.get(); TempVars vars = TempVars.get();
assert vars.lock();
float[] posBuf = vars.skinPositions; float[] posBuf = vars.skinPositions;
float[] normBuf = vars.skinNormals; float[] normBuf = vars.skinNormals;
@ -173,6 +175,8 @@ public class SkeletonControl extends AbstractControl implements Savable, Cloneab
fnb.position(fnb.position() - bufLength); fnb.position(fnb.position() - bufLength);
fnb.put(normBuf, 0, bufLength); fnb.put(normBuf, 0, bufLength);
} }
assert vars.unlock();
vb.updateData(fvb); vb.updateData(fvb);
nb.updateData(fnb); nb.updateData(fnb);

@ -48,7 +48,15 @@ import java.io.IOException;
*/ */
public final class Transform implements Savable, Cloneable { public final class Transform implements Savable, Cloneable {
/**
*
* @deprecated To follow with the standard for constants,
* which should be all upper case. Use {@link Transform#IDENTITY} instead.
*/
@Deprecated
public static final Transform Identity = new Transform(); public static final Transform Identity = new Transform();
public static final Transform IDENTITY = new Transform();
private Quaternion rot = new Quaternion(); private Quaternion rot = new Quaternion();
private Vector3f translation = new Vector3f(); private Vector3f translation = new Vector3f();
@ -281,8 +289,8 @@ public final class Transform implements Savable, Cloneable {
InputCapsule capsule = e.getCapsule(this); InputCapsule capsule = e.getCapsule(this);
rot = (Quaternion)capsule.readSavable("rot", new Quaternion()); rot = (Quaternion)capsule.readSavable("rot", new Quaternion());
translation = (Vector3f)capsule.readSavable("translation", Vector3f.ZERO.clone()); translation = (Vector3f)capsule.readSavable("translation", Vector3f.ZERO);
scale = (Vector3f)capsule.readSavable("scale", Vector3f.UNIT_XYZ.clone()); scale = (Vector3f)capsule.readSavable("scale", Vector3f.UNIT_XYZ);
} }
@Override @Override

@ -1229,7 +1229,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable {
shadowMode = ic.readEnum("shadow_mode", ShadowMode.class, shadowMode = ic.readEnum("shadow_mode", ShadowMode.class,
ShadowMode.Inherit); ShadowMode.Inherit);
localTransform = (Transform) ic.readSavable("transform", Transform.Identity); localTransform = (Transform) ic.readSavable("transform", Transform.IDENTITY);
localLights = (LightList) ic.readSavable("lights", null); localLights = (LightList) ic.readSavable("lights", null);
localLights.setOwner(this); localLights.setOwner(this);

Loading…
Cancel
Save