public static RenderMaterial loadChecked(final String sourceUrl) throws IOException { final ResourceSource source = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MATERIAL, sourceUrl); if (source == null) { throw new IOException("Unable to locate '" + sourceUrl + "'"); } return load(source); }
public RenderMaterial findMaterial(final String materialUrl) { final ResourceSource key = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MATERIAL, materialUrl); if (key == null) { return null; } RenderMaterial mat = _materialCache.get(key); if (mat == null) { mat = YamlMaterialReader.load(key); if (mat != null) { _materialCache.put(key, mat); } } return mat; }
/** * Loads a texture by attempting to locate the given name using ResourceLocatorTool. * * @param name * the name of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final String name, final Texture.MinificationFilter minFilter, final boolean flipVertically) { return load(ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, name), minFilter, TextureStoreFormat.GuessNoCompressedFormat, flipVertically); }
/** * Loads a texture by attempting to locate the given name using ResourceLocatorTool. * * @param name * the name of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final String name, final Texture.MinificationFilter minFilter, final boolean flipVertically) { return load(ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, name), minFilter, TextureStoreFormat.GuessNoCompressedFormat, flipVertically); }
/** * Loads a texture by attempting to locate the given name using ResourceLocatorTool. * * @param name * the name of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param format * the specific format to use when storing this texture on the card. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final String name, final Texture.MinificationFilter minFilter, final TextureStoreFormat format, final boolean flipVertically) { return load(ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, name), minFilter, format, flipVertically); }
/** * Loads a texture by attempting to locate the given name using ResourceLocatorTool. * * @param name * the name of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param format * the specific format to use when storing this texture on the card. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final String name, final Texture.MinificationFilter minFilter, final TextureStoreFormat format, final boolean flipVertically) { return load(ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, name), minFilter, format, flipVertically); }
/** * Reads a MD2 file from the given resource * * @param resource * the name of the resource to find. * @return an ObjGeometryStore data object containing the scene and other useful elements. */ public Md2DataStore load(final String resource) { final ResourceSource source; if (_modelLocator == null) { source = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MODEL, resource); } else { source = _modelLocator.locateResource(resource); } if (source == null) { throw new Error("Unable to locate '" + resource + "'"); } return load(source); }
final ResourceSource src = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_SHADER, sourceUrl); if (src == null) { return null;
/** * Reads a Wavefront OBJ file from the given resource * * @param resource * the name of the resource to find. * @return an ObjGeometryStore data object containing the scene and other useful elements. */ public ObjGeometryStore load(final String resource) { final ResourceSource source; if (_modelLocator == null) { source = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MODEL, resource); } else { source = _modelLocator.locateResource(resource); } if (source == null) { throw new Error("Unable to locate '" + resource + "'"); } return load(source); }
/** * Reads a Collada file from the given resource and returns it as a ColladaStorage object. * * @param resource * the name of the resource to find. ResourceLocatorTool will be used with TYPE_MODEL to find the * resource. * @return a ColladaStorage data object containing the Collada scene and other useful elements. * @throws IOException * if the resource can not be located or loaded for some reason. */ public ColladaStorage load(final String resource) throws IOException { final ResourceSource source; if (_modelLocator == null) { source = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MODEL, resource); } else { source = _modelLocator.locateResource(resource); } if (source == null) { throw new IOException("Unable to locate '" + resource + "'"); } return load(source); }
public void read(final InputCapsule capsule) throws IOException { final String protocol = capsule.readString("protocol", null); final String host = capsule.readString("host", null); final String file = capsule.readString("file", null); if (file != null) { // see if we would like to divert this to a new location. final ResourceSource src = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, URLDecoder.decode(file, "UTF-8")); if (src instanceof URLResourceSource) { setURL(((URLResourceSource) src)._url); _type = ((URLResourceSource) src)._type; return; } } if (protocol != null && host != null && file != null) { setURL(new URL(protocol, host, file)); } _type = capsule.readString("type", null); }
public void read(final InputCapsule capsule) throws IOException { final String protocol = capsule.readString("protocol", null); final String host = capsule.readString("host", null); final String file = capsule.readString("file", null); if (file != null) { // see if we would like to divert this to a new location. final ResourceSource src = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, URLDecoder.decode(file, "UTF-8")); if (src instanceof URLResourceSource) { setURL(((URLResourceSource) src)._url); _type = ((URLResourceSource) src)._type; return; } } if (protocol != null && host != null && file != null) { setURL(new URL(protocol, host, file)); } _type = capsule.readString("type", null); }