Package com.jme3.export

Examples of com.jme3.export.InputCapsule


        capsule.write(this.animComponent, "animComponent", null);
    }

    @Override
    public void read(JmeImporter e) throws IOException {
        InputCapsule capsule = e.getCapsule(this);
        animComponent = (AnimComponent) capsule.readSavable("animComponent", null);
    }
View Full Code Here


        capsule.write(this.player, "player", null);
    }

    @Override
    public void read(JmeImporter e) throws IOException {
        InputCapsule capsule = e.getCapsule(this);
        player = (CharacterControl) capsule.readSavable("player", null);
    }
View Full Code Here

     * Read the camera
     * @param im
     * @throws IOException
     */
    public void read(JmeImporter im) throws IOException {
        InputCapsule ic = im.getCapsule(this);
        maxDistance = ic.readFloat("maxDistance", 40);
        minDistance = ic.readFloat("minDistance", 1);
    }
View Full Code Here

        oc.write(enabled, "enabled", true);
        oc.write(spatial, "spatial", null);
    }

    public void read(JmeImporter im) throws IOException {
        InputCapsule ic = im.getCapsule(this);
        enabled = ic.readBoolean("enabled", true);
        spatial = (Spatial) ic.readSavable("spatial", null);
    }
View Full Code Here

    }
  }

  public void read(JmeImporter e) throws IOException {
    super.read(e);
    InputCapsule capsule = e.getCapsule(this);
    top = (Line2D) capsule.readSavable("top", null);
    right = (Line2D) capsule.readSavable("right", null);
    bottom = (Line2D) capsule.readSavable("bottom", null);
    left = (Line2D) capsule.readSavable("left", null);
    worldTranslation = (Vector3f) capsule.readSavable("worldpos", null);
    if(worldTranslation != null)
      log.fine("TiledNavMesh loaded at:"+worldTranslation);
    //FIXME loading and storing of border information
    int[] bKeys = capsule.readIntArray("borders_keys",null);
    int[] vKeys = capsule.readIntArray("borders_values",null);

    for(int i=0; i<bKeys.length;i++)
      borders.put(mCellArray[i], vKeys[i]);
   
    for(int i=0;i<8;i++){
      int[] b = capsule.readIntArray("allborders"+i,null);
      for(int c : b)
        allBorders.get(i).add(mCellArray[c]);
    }
  }
View Full Code Here

    capsule.write(m_PointB, "m_PointB", null);
    capsule.write(m_Normal, "m_Normal", null);   
  }

  public void read(JmeImporter e) throws IOException {
    InputCapsule capsule = e.getCapsule(this);
    m_PointA = (Vector2f) capsule.readSavable("m_PointA", new Vector2f());
    m_PointB = (Vector2f) capsule.readSavable("m_PointB", new Vector2f());
    m_Normal = (Vector2f) capsule.readSavable("m_Normal", new Vector2f());
  }
View Full Code Here

    capsule.write(m_WallMidpoint, "midpoints", null);
    capsule.write(m_WallDistance, "distances", null)
  }

  public void read(JmeImporter e) throws IOException {
    InputCapsule capsule = e.getCapsule(this);
    id = capsule.readInt("id", -1);
    m_CellPlane = (Plane) capsule.readSavable("cellplane", new Plane());
    Savable[] sav = capsule.readSavableArray("vertex", new Vector3f[3]);
        for (int i = 0; i < sav.length; i++){
            m_Vertex[i] = (Vector3f) sav[i];
        }
    m_CenterPoint = (Vector3f) capsule.readSavable("center", new Vector3f());
    sav = capsule.readSavableArray("sides", new Line2D[3]);
        for (int i = 0; i < sav.length; i++){
            m_Side[i] = (Line2D) sav[i];
        }
    //done one level above in mesh
//    m_Link = (Cell[]) capsule.readSavableArray("links", new Cell[3]);
    sav = capsule.readSavableArray("midpoints", new Vector3f[3]);
        for (int i = 0; i < sav.length; i++){
            m_WallMidpoint[i] = (Vector3f) sav[i];
        }
    m_WallDistance = capsule.readFloatArray("distances", new float[3])
  }
View Full Code Here

    tmp.clear();
  }

  @SuppressWarnings("unchecked")
  public void read(JmeImporter e) throws IOException {
    InputCapsule capsule = e.getCapsule(this);
    mCellArray = (com.l2client.navigation.Cell[]) capsule.readSavableArray("mCellArray", null);//new Cell[0]);
    if(mCellArray == null){
      //try to load the old version
      ArrayList<Cell> cellArray = (ArrayList<Cell>) capsule.readSavableArrayList("cellarray", new ArrayList<Cell>());
      mCellArray = cellArray.toArray(new Cell[cellArray.size()]);
      for(int i=0; i<mCellArray.length;i++)
        mCellArray[i].id = i;
     
//      System.out.print("Mesh with "+mCellArray.length+" and "+mCellArray[mCellArray.length-1].id+" ids");
    }
    int[] links = capsule.readIntArray("links", null);
    if(links != null && links.length == mCellArray.length*3){
      Cell c = null;
      int l = -1;
      for(int i =0,j=0; i<mCellArray.length; i++){
        c = mCellArray[i];
View Full Code Here

   */
  private String defaultSet;

  @Override
  public void read(JmeImporter im) throws IOException {
       InputCapsule input = im.getCapsule(this);

       primhand = input.readString("primhand", "");
       offhand = input.readString("offhand", "");
       offhandOptional= input.readInt("offhandOptional", 0);
       animSet = input.readString("animSet", "");
       defaultSet = input.readString("defaultSet", "");
  }
View Full Code Here

//  }

  @Override
  public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule capsule = im.getCapsule(this);
    location = capsule.readString("location", "");
  }
View Full Code Here

TOP

Related Classes of com.jme3.export.InputCapsule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.