Package com.l2client.asset

Examples of com.l2client.asset.Asset


        AmbientLight ambLight = new AmbientLight();
        ambLight.setColor(new ColorRGBA(0.2f, 0.2f, 0.2f, 1f));
        rootNode.addLight(ambLight);
     

        Asset a = new Asset("/tile/121_177/121_177.jnv", "/tile/121_177/121_177.jnv");
        sin.getAssetManager().loadAsset(a, true);
        if(a.getBaseAsset() instanceof TiledNavMesh )
          NavTestHelper.debugShowMesh(assetManager, debugNodes,(TiledNavMesh) a.getBaseAsset());
       
        Asset b = new Asset("/tile/121_177/121_177.j3o", "/tile/121_177/121_177.j3o");
        sin.getAssetManager().loadAsset(b, true);
        if(b.getBaseAsset() instanceof Spatial ) {
          Spatial n = (Spatial)b.getBaseAsset();
//      Material mat = new Material(Singleton.get().getAssetManager().getJmeAssetMan(), "Common/MatDefs/Misc/Unshaded.j3md");
//          mat.setColor("Color", ColorRGBA.randomColor());
        Material mat = new Material(Singleton.get().getAssetManager().getJmeAssetMan(), "Common/MatDefs/Light/Lighting.j3md");
        mat.setBoolean("UseMaterialColors",true);   
        mat.setColor("Diffuse",ColorRGBA.randomColor());
View Full Code Here


    //create name (name+scale)
//    String cName = name + scala;
    //lookup in cache or load it
    Skeleton s = skeletons.get(name);
    if (s == null) {
      Asset a = new Asset(name, name);
      Singleton.get().getAssetManager().loadAsset(a, true);
      s = (Skeleton) a.getBaseAsset();
    }
    if (s != null) {
      skeletons.put(name, s);
      return new Skeleton(s);
    } else {
View Full Code Here

    HashMap<String, Asset> materials = new HashMap<String, Asset>();
    PartSet det = top.getPart("mat");
    if(det != null){
    for( PartSet m : det.getParts()){
      String next = m.getNext();
      Asset a = new Asset(next,m.getName());
      Singleton.get().getAssetManager().loadAsset(a, false);
      materials.put(m.getName(),a);
    }
    } //FIXME else log waring!!!
//    } else
View Full Code Here

    //materials
        for(PartSet matSet :oSet.getParts()){
          String mat = matSet.getName();
    //next mesh
          String next = matSet.getNext();
          Asset a = new Asset(next,name);
          Singleton.get().getAssetManager().loadAsset(a, false);
          meshArray.put(a,mat);
      }
    }
   
View Full Code Here

   * @param top the top partset
   * @param i    the nth hair style to chose
   * @return  the asset representing the desired hairstyle
   */
  public static Asset getHair(PartSet top, int i){
    Asset ret = null;
    PartSet det = top.getPart("mesh");
    if(det != null)
      det = det.getPart("hair");
    if(det != null){     
      String hair = null;
      if(i>=0){
        hair = det.get(i);
      }else{
        hair = det.getNext();
      }
      if(hair != null && !"".equals(hair)){
        ret = new Asset(hair,"hair");
        Singleton.get().getAssetManager().loadAsset(ret, false);
      }
    }
    return ret;
     
View Full Code Here

  public static WeaponSet getWeaponset(PartSet top){
    PartSet det = top.getPart("weapon");
    if(det != null){
    String weaponSets = det.getNext();
//    String weaponSet = det.getPart(weaponSets).getNext();
    Asset ws = new Asset(weaponSets,det.getName());
    Singleton.get().getAssetManager().loadAsset(ws, true);
    //add weaponset meshes
    return (WeaponSet)ws.getBaseAsset();
    } else
      return null;
  }
View Full Code Here

    PartSet det = top.getPart("mesh");
    PartSet p = det.getPart(weapons.getPrimhand());
    if(p == null)
      return null;
    String s = p.getNext();
    Asset prim = new Asset(s,p.getName());
    Singleton.get().getAssetManager().loadAsset(prim, false);
    p = det.getPart(weapons.getOffhand());
    //FIXME optionality not done here so far
    if(p != null){
      s = p.getNext();
      Asset secnd = new Asset(s,p.getName());
      Singleton.get().getAssetManager().loadAsset(secnd, false);
      return new Asset[]{prim,secnd};
    } else
      return new Asset []{prim};
   
View Full Code Here

        log.severe("Failed to load any weapons for "+top.getName()+" and weaponset "+weapons);
        return ret;
      }
      String mat = p.getNext();
      for(PartSet set : p.getParts()) {
      Asset prim = new Asset(set.getNext(), p.getName());
      Singleton.get().getAssetManager().loadAsset(prim, false);
      ret.put(prim, mat);
      }
      p = det.getPart(weapons.getOffhand());
      // FIXME optionality not done here so far
      if (p != null) {
        mat = p.getNext();
        for(PartSet set : p.getParts()) {
        Asset prim = new Asset(set.getNext(), p.getName());
        Singleton.get().getAssetManager().loadAsset(prim, false);
        ret.put(prim, mat);
        }
      }
    }
View Full Code Here

      Assembler assembler) {
    for(Asset a : meshArray.keySet()){
      Object n = a.getBaseAsset();
      if(n != null){
        if(n instanceof Geometry){
          Asset mat = materials.get(meshArray.get(a));
          if(mat != null){
            Material m = (Material)mat.getBaseAsset();
            if(m != null){
              //prepare rim light shader for selection highlighting
              m.setColor("RimLighting", ColorRGBA.BlackNoAlpha);//new ColorRGBA(1f, 0f, 0f, 12f));//this was for a test had to set the value to 12 for a really good noticable look
              //this must be a clone for hardware skinning
              ((Geometry)n).setMaterial(m.clone());
            } else
              log.severe("Material "+mat.getLocation()+" not found is missing for "+a.getLocation());
          }else
            log.severe("Material is missing for "+a.getLocation());
         
          assembler.addMesh(a.getName(), (Geometry)n , false);
        }
View Full Code Here

      createInitialChar();
    }
    //hair change ??
    if(lastCharSummary.hair != charSelection.hair && top != null){
     
      Asset a = Assembler2.getHair(top, -1);
      if(a != null){
        assembler.getMeshes().remove(hair);
        Node me = (Node) (a.getBaseAsset());
        hair = me.getName();
        assembler.getMeshes().put(hair, (Geometry)me.getChild(0));
        replaceModel();       
      }
    }
View Full Code Here

TOP

Related Classes of com.l2client.asset.Asset

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.