* 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
This commit is contained in:
parent
2611139702
commit
636339a432
@ -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;
|
||||||
|
|
||||||
@ -174,6 +176,8 @@ public class SkeletonControl extends AbstractControl implements Savable, Cloneab
|
|||||||
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,8 +48,16 @@ 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();
|
||||||
private Vector3f scale = new Vector3f(1,1,1);
|
private Vector3f scale = new Vector3f(1,1,1);
|
||||||
@ -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…
x
Reference in New Issue
Block a user