@SuppressWarnings("unchecked")
  public void read(JMEImporter e) throws IOException {
    super.read(e);
    InputCapsule capsule = e.getCapsule(this);

    numObjects = capsule.readInt("numObjects", 0);

    Savable[] savs = capsule.readSavableArray("toChange", new Spatial[0]);
    if (savs == null) {
      toChange = null;
    } else {
      toChange = new Spatial[savs.length];
      for (int x = 0; x < savs.length; x++) {
        toChange[x] = (Spatial) savs[x];
      }
    }

    savs = capsule.readSavableArray("pivots", new TransformQuaternion[0]);
    if (savs == null) {
      pivots = null;
    } else {
      pivots = new TransformQuaternion[savs.length];
      for (int x = 0; x < savs.length; x++) {
        pivots[x] = (TransformQuaternion) savs[x];
      }
    }

    parentIndexes = capsule.readIntArray("parentIndexes", new int[0]);
    keyframes = capsule.readSavableArrayList("keyframes", new ArrayList());
    haveChanged = capsule.readBooleanArray("haveChanged", new boolean[0]);

    beginPointTime = (PointInTime) capsule.readSavable("beginPointTime", null);
    endPointTime = (PointInTime) capsule.readSavable("endPointTime", null);
  }
Exemplo n.º 2
0
 @Override
 public void read(JMEImporter im) throws IOException {
   super.read(im);
   Savable[] temp = null;
   InputCapsule ic = im.getCapsule(this);
   // Read in texture map locations.
   this.color = ic.readString("ColorMap", null);
   this.normal = ic.readString("NormalMap", null);
   this.specular = ic.readString("SpecularMap", null);
   // Read in primitives.
   temp = ic.readSavableArray("Vertices", null);
   this.vertices = new IVertex[temp.length];
   for (int i = 0; i < temp.length; i++) {
     this.vertices[i] = (IVertex) temp[i];
   }
   temp = ic.readSavableArray("Triangles", null);
   this.triangles = new ITriangle[temp.length];
   for (int i = 0; i < temp.length; i++) {
     this.triangles[i] = (ITriangle) temp[i];
   }
   temp = ic.readSavableArray("Weights", null);
   this.weights = new IWeight[temp.length];
   for (int i = 0; i < temp.length; i++) {
     this.weights[i] = (IWeight) temp[i];
   }
   // Read in settings.
   this.anisotropic = ic.readInt("Anisotropic", 0);
   this.miniFilter = MinificationFilter.valueOf(ic.readString("MinFilter", null));
   this.magFilter = MagnificationFilter.valueOf(ic.readString("MagFilter", null));
   this.orientedBounding = ic.readBoolean("OrientedBounding", false);
 }
Exemplo n.º 3
0
 @Override
 public void read(JMEImporter im) throws IOException {
   InputCapsule ic = im.getCapsule(this);
   this.index = ic.readInt("Index", -1);
   Savable[] temp = ic.readSavableArray("Vertices", null);
   this.vertices = new IVertex[temp.length];
   for (int i = 0; i < this.vertices.length; i++) this.vertices[i] = (IVertex) temp[i];
 }
    public void read(JMEImporter e) throws IOException {
      InputCapsule capsule = e.getCapsule(this);
      usedRot = capsule.readBitSet("usedRot", null);
      usedTrans = capsule.readBitSet("usedTrans", null);
      usedScale = capsule.readBitSet("usedScale", null);
      time = capsule.readFloat("time", 0);

      Savable[] savs = capsule.readSavableArray("look", null);
      if (savs == null) {
        look = null;
      } else {
        look = new TransformQuaternion[savs.length];
        for (int x = 0; x < savs.length; x++) {
          look[x] = (TransformQuaternion) savs[x];
        }
      }
    }
 @Override
 public void read(JMEImporter e) throws IOException {
   super.read(e);
   InputCapsule capsule = e.getCapsule(this);
   translationDelta = (Vector3f) capsule.readSavable("translationDelta", null);
   rotationDelta = capsule.readFloat("rotationDelta", 0);
   textureRotationAxis = (Vector3f) capsule.readSavable("textureRotationAxis", null);
   xRepeat = capsule.readFloat("xRepeat", 1);
   yRepeat = capsule.readFloat("yRepeat", 1);
   zRepeat = capsule.readFloat("zRepeat", 1);
   currentTranslation = (Vector3f) capsule.readSavable("currentTranslation", null);
   currentRotation = (Quaternion) capsule.readSavable("currentRotation", null);
   currentRotationAngle = capsule.readFloat("currentRotationAngle", 0);
   Savable[] savs = capsule.readSavableArray("textures", null);
   if (savs != null) {
     textures = new Texture[savs.length];
     for (int i = 0; i < savs.length; i++) {
       textures[i] = (Texture) savs[i];
     }
   }
 }