159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta/* 259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Copyright (c) 2009-2010 jMonkeyEngine 359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * All rights reserved. 459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Redistribution and use in source and binary forms, with or without 659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * modification, are permitted provided that the following conditions are 759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * met: 859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * * Redistributions of source code must retain the above copyright 1059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * notice, this list of conditions and the following disclaimer. 1159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 1259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * * Redistributions in binary form must reproduce the above copyright 1359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * notice, this list of conditions and the following disclaimer in the 1459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * documentation and/or other materials provided with the distribution. 1559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 1659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * * Neither the name of 'jMonkeyEngine' nor the names of its contributors 1759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * may be used to endorse or promote products derived from this software 1859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * without specific prior written permission. 1959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 2059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 2459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 2559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 2659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 2759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 2859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 2959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 3059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 3259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 3359b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartapackage com.jme3.asset; 3459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 3559b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport com.jme3.audio.AudioData; 3659b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport com.jme3.audio.AudioKey; 3759b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport com.jme3.font.BitmapFont; 3859b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport com.jme3.material.Material; 3959b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport com.jme3.scene.Spatial; 4059b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport com.jme3.shader.Shader; 4159b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport com.jme3.shader.ShaderKey; 4259b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport com.jme3.texture.Texture; 4359b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartaimport java.util.List; 4459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 4559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta/** 4659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * <code>AssetManager</code> provides an interface for managing the data assets 4759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * of a jME3 application. 4859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 4959b2e6871c65f58fdad78cd7229c292f6a177578Scott Bartapublic interface AssetManager { 5059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 5159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 5259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Adds a ClassLoader that is used to load *Classes* that are needed for Assets like j3o models. 5359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * This does *not* allow loading assets from that classpath, use registerLocator for that. 5459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param loader A ClassLoader that Classes in asset files can be loaded from 5559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 5659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public void addClassLoader(ClassLoader loader); 5759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 5859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 5959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Remove a ClassLoader from the list of registered ClassLoaders 6059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 6159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public void removeClassLoader(ClassLoader loader); 6259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 6359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 6459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Retrieve the list of registered ClassLoaders that are used for loading Classes from 6559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * asset files. 6659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 6759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public List<ClassLoader> getClassLoaders(); 6859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 6959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 7059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Registers a loader for the given extensions. 7159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param loaderClassName 7259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param extensions 7359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 7459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public void registerLoader(String loaderClassName, String ... extensions); 7559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 7659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 7759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Registers an {@link AssetLocator} by using a class name, instead of 7859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * a class instance. See the {@link AssetManager#registerLocator(java.lang.String, java.lang.Class) } 7959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * method for more information. 8059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 8159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param rootPath The root path from which to locate assets, implementation 8259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * dependent. 8359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param locatorClassName The full class name of the {@link AssetLocator} 8459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * implementation. 8559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 8659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public void registerLocator(String rootPath, String locatorClassName); 8759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 8859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 8959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 9059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param loaderClass 9159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param extensions 9259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 9359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public void registerLoader(Class<? extends AssetLoader> loaderClass, String ... extensions); 9459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 9559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 9659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Registers the given locator class for locating assets with this 9759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * <code>AssetManager</code>. {@link AssetLocator}s are invoked in the order 9859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * they were registered, to locate the asset by the {@link AssetKey}. 9959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Once an {@link AssetLocator} returns a non-null AssetInfo, it is sent 10059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * to the {@link AssetLoader} to load the asset. 10159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Once a locator is registered, it can be removed via 10259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * {@link #unregisterLocator(java.lang.String, java.lang.Class) }. 10359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 10459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param rootPath Specifies the root path from which to locate assets 10559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * for the given {@link AssetLocator}. The purpose of this parameter 10659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * depends on the type of the {@link AssetLocator}. 10759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param locatorClass The class type of the {@link AssetLocator} to register. 10859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 10959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetLocator#setRootPath(java.lang.String) 11059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetLocator#locate(com.jme3.asset.AssetManager, com.jme3.asset.AssetKey) 11159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see #unregisterLocator(java.lang.String, java.lang.Class) 11259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 11359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public void registerLocator(String rootPath, Class<? extends AssetLocator> locatorClass); 11459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 11559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 11659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Unregisters the given locator class. This essentially undoes the operation 11759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * done by {@link #registerLocator(java.lang.String, java.lang.Class) }. 11859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 11959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param rootPath Should be the same as the root path specified in {@link 12059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * #registerLocator(java.lang.String, java.lang.Class) }. 12159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param locatorClass The locator class to unregister 12259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 12359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public void unregisterLocator(String rootPath, Class<? extends AssetLocator> locatorClass); 12459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 12559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 12659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Set an {@link AssetEventListener} to receive events from this 12759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * <code>AssetManager</code>. There can only be one {@link AssetEventListener} 12859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * associated with an <code>AssetManager</code> 12959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 13059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param listener 13159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 13259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public void setAssetEventListener(AssetEventListener listener); 13359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 13459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 13559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Manually locates an asset with the given {@link AssetKey}. This method 13659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * should be used for debugging or internal uses. <br/> 13759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * The call will attempt to locate the asset by invoking the 13859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * {@link AssetLocator} that are registered with this <code>AssetManager</code>, 13959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * in the same way that the {@link AssetManager#loadAsset(com.jme3.asset.AssetKey) } 14059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * method locates assets. 14159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 14259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param key The {@link AssetKey} to locate. 14359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The {@link AssetInfo} object returned from the {@link AssetLocator} 14459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * that located the asset, or null if the asset cannot be located. 14559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 14659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public AssetInfo locateAsset(AssetKey<?> key); 14759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 14859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 14959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Load an asset from a key, the asset will be located 15059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * by one of the {@link AssetLocator} implementations provided in the 15159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * {@link AssetManager#registerLocator(java.lang.String, java.lang.Class) } 15259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * call. If located successfully, it will be loaded via the the appropriate 15359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * {@link AssetLoader} implementation based on the file's extension, as 15459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * specified in the call 15559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * {@link AssetManager#registerLoader(java.lang.Class, java.lang.String[]) }. 15659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 15759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param <T> The object type that will be loaded from the AssetKey instance. 15859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param key The AssetKey 15959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The loaded asset, or null if it was failed to be located 16059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * or loaded. 16159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 16259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public <T> T loadAsset(AssetKey<T> key); 16359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 16459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 16559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Load a named asset by name, calling this method 16659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * is the same as calling 16759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * <code> 16859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * loadAsset(new AssetKey(name)). 16959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * </code> 17059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 17159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param name The name of the asset to load. 17259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The loaded asset, or null if failed to be loaded. 17359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 17459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 17559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 17659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public Object loadAsset(String name); 17759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 17859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 17959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Loads texture file, supported types are BMP, JPG, PNG, GIF, 18059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * TGA and DDS. 18159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 18259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param key The {@link TextureKey} to use for loading. 18359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The loaded texture, or null if failed to be loaded. 18459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 18559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 18659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 18759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public Texture loadTexture(TextureKey key); 18859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 18959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 19059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Loads texture file, supported types are BMP, JPG, PNG, GIF, 19159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * TGA and DDS. 19259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 19359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param name The name of the texture to load. 19459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The texture that was loaded 19559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 19659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 19759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 19859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public Texture loadTexture(String name); 19959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 20059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 20159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Load audio file, supported types are WAV or OGG. 20259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param key 20359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The audio data loaded 20459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 20559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 20659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 20759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public AudioData loadAudio(AudioKey key); 20859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 20959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 21059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Load audio file, supported types are WAV or OGG. 21159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * The file is loaded without stream-mode. 21259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param name 21359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The audio data loaded 21459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 21559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 21659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 21759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public AudioData loadAudio(String name); 21859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 21959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 22059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Loads a named model. Models can be jME3 object files (J3O) or 22159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * OgreXML/OBJ files. 22259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param key 22359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The model that was loaded 22459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 22559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 22659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 22759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public Spatial loadModel(ModelKey key); 22859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 22959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 23059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Loads a named model. Models can be jME3 object files (J3O) or 23159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * OgreXML/OBJ files. 23259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param name 23359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The model that was loaded 23459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 23559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 23659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 23759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public Spatial loadModel(String name); 23859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 23959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 24059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Load a material (J3M) file. 24159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param name 24259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The material that was loaded 24359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 24459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 24559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 24659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public Material loadMaterial(String name); 24759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 24859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 24959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Loads shader file(s), shouldn't be used by end-user in most cases. 25059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 25159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 25259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 25359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public Shader loadShader(ShaderKey key); 25459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta 25559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta /** 25659b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * Load a font file. Font files are in AngelCode text format, 25759b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * and are with the extension "fnt". 25859b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 25959b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @param name 26059b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @return The font loaded 26159b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * 26259b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta * @see AssetManager#loadAsset(com.jme3.asset.AssetKey) 26359b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta */ 26459b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta public BitmapFont loadFont(String name); 26559b2e6871c65f58fdad78cd7229c292f6a177578Scott Barta} 266