private void initAssetManager(){ URL assetCfgUrl = null; if (settings != null){ String assetCfg = settings.getString("AssetConfigURL"); if (assetCfg != null){ try { assetCfgUrl = new URL(assetCfg); } catch (MalformedURLException ex) { } if (assetCfgUrl == null) { assetCfgUrl = LegacyApplication.class.getClassLoader().getResource(assetCfg); if (assetCfgUrl == null) { logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg); return; } } } } if (assetCfgUrl == null) { assetCfgUrl = JmeSystem.getPlatformAssetConfigURL(); } if (assetManager == null){ assetManager = JmeSystem.newAssetManager(assetCfgUrl); logger.config("Created asset manager from "+assetCfgUrl); } }
private void initAssetManager(){ URL assetCfgUrl = null; if (settings != null){ String assetCfg = settings.getString("AssetConfigURL"); if (assetCfg != null){ try { assetCfgUrl = new URL(assetCfg); } catch (MalformedURLException ex) { } if (assetCfgUrl == null) { assetCfgUrl = LegacyApplication.class.getClassLoader().getResource(assetCfg); if (assetCfgUrl == null) { logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg); return; } } } } if (assetCfgUrl == null) { assetCfgUrl = JmeSystem.getPlatformAssetConfigURL(); } if (assetManager == null){ assetManager = JmeSystem.newAssetManager(assetCfgUrl); } }
public static void main(String[] args){ AssetManager assetManager = JmeSystem.newAssetManager(); assetManager.registerLocator("/", ClasspathLocator.class); assetManager.registerLoader(TextLoader.class, "fnt"); System.out.println(assetManager.loadAsset("Interface/Fonts/Console.fnt")); } }
@Before public void init() { assetManager = JmeSystem.newAssetManager( TestMaterialWrite.class.getResource("/com/jme3/asset/Desktop.cfg")); }
public static void main(String[] args){ AssetManager am = JmeSystem.newAssetManager(); am.registerLoader(AWTLoader.class, "jpg"); am.registerLoader(WAVLoader.class, "wav"); // register absolute locator am.registerLocator("/", ClasspathLocator.class); // find a sound AudioData audio = am.loadAudio("Sound/Effects/Gun.wav"); // find a texture Texture tex = am.loadTexture("Textures/Terrain/Pond/Pond.jpg"); if (audio == null) throw new RuntimeException("Cannot find audio!"); else System.out.println("Audio loaded from Sounds/Effects/Gun.wav"); if (tex == null) throw new RuntimeException("Cannot find texture!"); else System.out.println("Texture loaded from Textures/Terrain/Pond/Pond.jpg"); System.out.println("Success!"); } }
@Before public void init() { assetManager = JmeSystem.newAssetManager( TestMaterialWrite.class.getResource("/com/jme3/asset/Desktop.cfg")); }
@Before public void init() { assetManager = JmeSystem.newAssetManager( TestMaterialDefWrite.class.getResource("/com/jme3/asset/Desktop.cfg")); }
private static void initAssetManager(){ assetManager = JmeSystem.newAssetManager(); assetManager.registerLocator(".", FileLocator.class); assetManager.registerLocator("/", ClasspathLocator.class); assetManager.registerLoader(J3MLoader.class, "j3m"); assetManager.registerLoader(J3MLoader.class, "j3md"); assetManager.registerLoader(GLSLLoader.class, "vert", "frag","geom","tsctrl","tseval","glsllib"); }
public static void main(String[] args){ AssetManager am = JmeSystem.newAssetManager();
public static void main(String[] args) { AssetManager assetManager = JmeSystem.newAssetManager( TestMaterialCompare.class.getResource("/com/jme3/asset/Desktop.cfg"));
private void initAssetManager(){ if (settings != null){ String assetCfg = settings.getString("AssetConfigURL"); if (assetCfg != null){ URL url = null; try { url = new URL(assetCfg); } catch (MalformedURLException ex) { } if (url == null) { url = Application.class.getClassLoader().getResource(assetCfg); if (url == null) { logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg); return; } } assetManager = JmeSystem.newAssetManager(url); } } if (assetManager == null){ assetManager = JmeSystem.newAssetManager( Thread.currentThread().getContextClassLoader() .getResource("com/jme3/asset/Desktop.cfg")); } }
public static void main(String[] args) throws IOException{ if (args.length == 0){ System.out.println("Usage: java -jar FolderConverter <input folder>"); System.out.println(); System.out.println(" Converts files from input to output"); System.exit(1); } sourceRoot = new File(args[0]); File jarFile = new File(sourceRoot.getParent(), sourceRoot.getName()+".jar"); FileOutputStream out = new FileOutputStream(jarFile); jarOut = new JarOutputStream(out); assetManager = JmeSystem.newAssetManager(); assetManager.registerLocator(sourceRoot.toString(), "com.jme3.asset.plugins.FileSystemLocator"); for (File f : sourceRoot.listFiles()){ process(f); } }
private void initAssetManager(){ URL assetCfgUrl = null; if (settings != null){ String assetCfg = settings.getString("AssetConfigURL"); if (assetCfg != null){ try { assetCfgUrl = new URL(assetCfg); } catch (MalformedURLException ex) { } if (assetCfgUrl == null) { assetCfgUrl = LegacyApplication.class.getClassLoader().getResource(assetCfg); if (assetCfgUrl == null) { logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg); return; } } } } if (assetCfgUrl == null) { assetCfgUrl = JmeSystem.getPlatformAssetConfigURL(); } if (assetManager == null){ assetManager = JmeSystem.newAssetManager(assetCfgUrl); } }
public JMEGeneratedHeightMap(ArrayList<Graphics3DNode> nodes, int resolution) { Logger.getLogger("").setLevel(Level.WARNING); this.resolution = resolution; this.elementTestSize = 1.0 / ((double) resolution) + 1e-12; System.out.println("Generating heightmap tree"); final URL resource = AssetManager.class.getResource("Desktop.cfg"); assetManager = JmeSystem.newAssetManager(resource); JMERenderer.setupAssetManger(assetManager); // zUpNode.setLocalRotation(JMEGeometryUtils.getRotationFromJMEToZupCoordinates()); rootNode.attachChild(zUpNode); for (Graphics3DNode node : nodes) { addNodesRecursively(node, zUpNode); } rootNode.updateModelBound(); rootNode.updateLogicalState(0.0f); rootNode.updateGeometricState(); System.out.println("Done generating heightmap"); jmeRayCollisionAdapter = new JMERayCollisionAdapter(rootNode); }
private void runJ3(File input, File output, String statusStr) throws InterruptedException{ updateWork(statusStr, 0); if (manager == null) manager = JmeSystem.newAssetManager();
public JMEGeneratedHeightMap(ArrayList<Graphics3DNode> nodes, int resolution) { Logger.getLogger("").setLevel(Level.WARNING); this.resolution = resolution; this.elementTestSize = 1.0/((double)resolution) + 1e-12; System.out.println("Generating heightmap tree"); final URL resource = AssetManager.class.getResource("Desktop.cfg"); assetManager = JmeSystem.newAssetManager(resource); JMERenderer.setupAssetManger(assetManager); assetLocator = new JMEAssetLocator(assetManager); // zUpNode.setLocalRotation(JMEGeometryUtils.getRotationFromJMEToZupCoordinates()); rootNode.attachChild(zUpNode); for (Graphics3DNode node : nodes) { addNodesRecursively(node, zUpNode); } rootNode.updateModelBound(); rootNode.updateLogicalState(0.0f); rootNode.updateGeometricState(); System.out.println("Done generating heightmap"); jmeRayCollisionAdapter = new JMERayCollisionAdapter(rootNode); }
private static void initAssetManager(){ assetManager = JmeSystem.newAssetManager(); assetManager.registerLocator(".", FileLocator.class); assetManager.registerLocator("/", ClasspathLocator.class); assetManager.registerLoader(J3MLoader.class, "j3m"); assetManager.registerLoader(J3MLoader.class, "j3md"); assetManager.registerLoader(GLSLLoader.class, "vert", "frag","geom","tsctrl","tseval","glsllib"); }
AssetManager assetManager = JmeSystem.newAssetManager( Thread.currentThread().getContextClassLoader() .getResource("com/jme3/asset/Desktop.cfg")); // Get temporary asset manager instance since we not yet have one ourselves