Package com.ngt.jopenmetaverse.shared.sim.asset

Examples of com.ngt.jopenmetaverse.shared.sim.asset.AssetMesh


            Client.network.getCurrentSim().Caps.CapabilityURI("GetMesh") != null)
        {
            // Do we have this mesh asset in the cache?
            if (Client.assets.Cache.hasAsset(meshID))
            {
                callback.execute(new MeshDownloadCallbackArgs(true, new AssetMesh(meshID, Client.assets.Cache.getCachedAssetBytes(meshID))));
                return;
            }

            URI url = Client.network.getCurrentSim().Caps.CapabilityURI("GetMesh");

            MethodDelegate<Void,HttpBaseRequestCompletedArg> downloadCompletedCallback = new MethodDelegate<Void,HttpBaseRequestCompletedArg>()
                {
            public Void execute(HttpBaseRequestCompletedArg e) {
//              HttpRequestBase request = e.getRequest();
//              HttpResponse response = e.getResponse();
              byte[] responseData = e.getResponseData();
              Exception error = e.getError();
                if (error == null && responseData != null) // success
                          {
                              callback.execute(new MeshDownloadCallbackArgs(true, new AssetMesh(meshID, responseData)));
                              Client.assets.Cache.saveAssetToCache(meshID, responseData);
                          }
                          else // download failed
                          {
                              JLogger.warn(
View Full Code Here


    try{
    for(File file: files)
    {
      byte[] bytes = FileUtils.readBytes(file);
     
      AssetMesh assetMesh  = new AssetMesh();
      assetMesh.AssetData = bytes;
      assetMesh.Decode();
     
      ByteArrayInputStream baos = new ByteArrayInputStream(assetMesh.AssetData);
      OSD osd = BinaryLLSDOSDParser.DeserializeLLSDBinary(baos);
      OSDMap header = (OSDMap) osd;
      for(String partName : header.keys())
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.sim.asset.AssetMesh

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.