- small optimization in ragdoll deserialization

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10373 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent f29b7fadab
commit a53071ca4d
  1. 7
      engine/src/bullet-common/com/jme3/bullet/control/KinematicRagdollControl.java

@ -791,6 +791,7 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
* @param rm * @param rm
* @param vp * @param vp
*/ */
@Override
public void render(RenderManager rm, ViewPort vp) { public void render(RenderManager rm, ViewPort vp) {
} }
@ -809,6 +810,7 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
* @param ex * @param ex
* @throws IOException * @throws IOException
*/ */
@Override
public void write(JmeExporter ex) throws IOException { public void write(JmeExporter ex) throws IOException {
super.write(ex); super.write(ex);
OutputCapsule oc = ex.getCapsule(this); OutputCapsule oc = ex.getCapsule(this);
@ -836,13 +838,12 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
* @param im * @param im
* @throws IOException * @throws IOException
*/ */
@Override
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
super.read(im); super.read(im);
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);
String[] loadedBoneList = ic.readStringArray("boneList", new String[0]); String[] loadedBoneList = ic.readStringArray("boneList", new String[0]);
for (String string : loadedBoneList) { boneList.addAll(Arrays.asList(loadedBoneList));
boneList.add(string);
}
PhysicsBoneLink[] loadedBoneLinks = (PhysicsBoneLink[])ic.readSavableArray("boneList", new PhysicsBoneLink[0]); PhysicsBoneLink[] loadedBoneLinks = (PhysicsBoneLink[])ic.readSavableArray("boneList", new PhysicsBoneLink[0]);
for (PhysicsBoneLink physicsBoneLink : loadedBoneLinks) { for (PhysicsBoneLink physicsBoneLink : loadedBoneLinks) {
boneLinks.put(physicsBoneLink.bone.getName(), physicsBoneLink); boneLinks.put(physicsBoneLink.bone.getName(), physicsBoneLink);

Loading…
Cancel
Save