Package com.jme3.asset

Examples of com.jme3.asset.AssetKey


  public static void startApp(){
    app.startCanvas();
    app.enqueue(new Callable<Void>(){
      public Void call(){
        if (app instanceof SimpleApplication){
          SimpleApplication simpleApp = (SimpleApplication) app;
          simpleApp.getFlyByCamera().setDragToRotate(true);
          String assdir =  new File(workspace).getAbsolutePath();
          app.setAssetsPath(assdir);
        }
        return null;
      }
View Full Code Here


     * Attaches Statistics View to guiNode and displays it on the screen
     * above FPS statistics line.
     *
     */
    public void loadStatsView() {
        statsView = new StatsView("Statistics View", assetManager, renderer.getStatistics());
//         move it up so it appears above fps text
        statsView.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        guiNode.attachChild(statsView);
    }
View Full Code Here

        listener = new Listener();
        ar.setListener(listener);
       
        // init StateManager ----------------------------
        stateManager = new AppStateManager(this);
       
        // simple Init ----------------------------------
        guiNode.setQueueBucket(Bucket.Gui);
        guiNode.setCullHint(CullHint.Never);
        //loadFPSText();
View Full Code Here

        if (!settingsDirectory.exists()) {
            if (settingsDirectory.mkdir()) {
                assetManager.registerLoader(DatabaseLoader.class, "db");

                String levelFilename = "Files/" + settingsFile;
                AssetKey myKey1 = new AssetKey(levelFilename);
                AssetInfo info1 = assetManager.locateAsset(myKey1);
                InputStream inputStream = (InputStream) info1.openStream();

                OutputStream outStream = null;
View Full Code Here

   
    private void removeCollectedAssets(){
        int removedAssets = 0;
        for (KeyRef ref; (ref = (KeyRef)refQueue.poll()) != null;){
            // (Cannot use ref.get() since it was just collected by GC!)
            AssetKey key = ref.clonedKey;
           
            // Asset was collected, note that at this point the asset cache
            // might not even have this asset anymore, it is OK.
            if (smartCache.remove(key) != null){
                removedAssets ++;
View Full Code Here

            return null;
        } else {
            // NOTE: Optimization so that registerAssetClone()
            // can check this and determine that the asset clone
            // belongs to the asset retrieved here.
            AssetKey keyForTheClone = smartInfo.get();
            if (keyForTheClone == null){
                // The asset was JUST collected by GC
                // (between here and smartCache.get)
                return null;
            }
View Full Code Here

            if (info.getUnusedNodes().contains(shaderNode.getName())) {
                continue;
            }
            if (shaderNode.getDefinition().getType() == type) {
                int index = findShaderIndexFromVersion(shaderNode, type);
                String loadedSource = (String) assetManager.loadAsset(new AssetKey(shaderNode.getDefinition().getShadersPath().get(index)));
                appendNodeDeclarationAndMain(loadedSource, sourceDeclaration, source, shaderNode, info);
            }
        }
    }
View Full Code Here

            }
        }
    }

    public Material(AssetManager contentMan, String defName) {
        this((MaterialDef) contentMan.loadAsset(new AssetKey(defName)));
    }
View Full Code Here

                }
            }
            assert applyDefaultValues && guessRenderStateApply;
        }

        def = (MaterialDef) im.getAssetManager().loadAsset(new AssetKey(defName));
        paramValues = new ListMap<String, MatParam>();

        // load the textures and update nextTexUnit
        for (Map.Entry<String, MatParam> entry : params.entrySet()) {
            MatParam param = entry.getValue();
View Full Code Here

    private ShaderNodeLoaderDelegate loaderDelegate;

    @Override
    public Object load(AssetInfo assetInfo) throws IOException {
        AssetKey k = assetInfo.getKey();
        if (!(k instanceof ShaderNodeDefinitionKey)) {
            throw new IOException("ShaderNodeDefinition file must be loaded via ShaderNodeDefinitionKey");
        }
        ShaderNodeDefinitionKey key = (ShaderNodeDefinitionKey) k;
        loaderDelegate = new ShaderNodeLoaderDelegate();
View Full Code Here

TOP

Related Classes of com.jme3.asset.AssetKey

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.