Examples of InputCapsule


Examples of com.jme3.export.InputCapsule

    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

Examples of com.jme3.export.InputCapsule

    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

Examples of com.jme3.export.InputCapsule

   */
  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

Examples of com.jme3.export.InputCapsule

//  }

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

Examples of com.jme3.export.InputCapsule

    }
  }

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

        name = input.readString("name", "");

//        String[] keys = input.readStringArray("part_keys", null);
//        String[] values = input.readStringArray("part_values", null);
//       
//        if(keys != null && values != null &&(keys.length == values.length)){
View Full Code Here

Examples of com.jme3.export.InputCapsule

    }

    @Override
    public void read(JmeImporter im) throws IOException {
        super.read(im);
        InputCapsule ic = im.getCapsule(this);
        distance = ic.readFloat("distance", IArea.TERRAIN_SIZE);
    }
View Full Code Here

Examples of com.jme3.export.InputCapsule

    oc.write(enabled, "enabled", true);
    oc.write(spatial, "spatial", null);
  }
  @Override
  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

Examples of com.jme3.export.InputCapsule

    }

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

Examples of com.jme3.export.InputCapsule

    }

    @Override
    public void read(JmeImporter im) throws IOException {
        super.read(im);
        InputCapsule ic = im.getCapsule(this);
        mesh = (Mesh) ic.readSavable("mesh", null);

        material = null;
        String matName = ic.readString("materialName", null);
        if (matName != null) {
            // Material name is set,
            // Attempt to load material via J3M
            try {
                material = im.getAssetManager().loadMaterial(matName);
            } catch (AssetNotFoundException ex) {
                // Cannot find J3M file.
                logger.log(Level.FINE, "Cannot locate {0} for geometry {1}", new Object[]{matName, key});
            }
        }
        // If material is NULL, try to load it from the geometry
        if (material == null) {
            material = (Material) ic.readSavable("material", null);
        }
        ignoreTransform = ic.readBoolean("ignoreTransform", false);

        if (ic.getSavableVersion(Geometry.class) == 0) {
            // Fix shared mesh (if set)
            Mesh sharedMesh = getUserData(UserData.JME_SHAREDMESH);
            if (sharedMesh != null) {
                getMesh().extractVertexData(sharedMesh);
            }
View Full Code Here

Examples of com.jme3.export.InputCapsule

    }

    @Override
    public void read(JmeImporter im) throws IOException{
        super.read(im);
        InputCapsule ic = im.getCapsule(this);
        fragName = ic.readString("fragment_name", null);
        vertLanguage = ic.readString("language", null);
        fragLanguage = ic.readString("frag_language", null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.