for (int i = bases.size(); --i >= 0;) { final ResourceLocator loc = bases.get(i); final ResourceSource rVal = loc.locateResource(resourceName); if (rVal != null) { return rVal;
/** * 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); }
/** * 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); }
for (int i = bases.size(); --i >= 0;) { final ResourceLocator loc = bases.get(i); final ResourceSource rVal = loc.locateResource(resourceName); if (rVal != null) { return rVal;
/** * 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); }
/** * Load a .mtl resource * * @param fileName * the name of the mtl resource to load. * @param modelSource * a source to pull the mtl relatively. Used only if a material locator was not set on this importer. * @param store * our material store to place the contents of the file in. */ private void loadMaterialLibrary(final String fileName, final ResourceSource modelSource, final Map<String, ObjMaterial> store) { final ResourceSource source; if (_materialLocator == null) { source = modelSource.getRelativeSource(fileName); } else { source = _materialLocator.locateResource(fileName); } if (source == null) { throw new Error("Unable to locate mtllib '" + fileName + "'"); } loadMaterialLibrary(source, store); }
: TextureStoreFormat.GuessNoCompressedFormat, isFlipTextureVertically()); } else { final ResourceSource source = _textureLocator.locateResource(textureName); currentMaterial.map_Kd = TextureManager.load(source, getMinificationFilter(), isUseCompression() ? TextureStoreFormat.GuessCompressedFormat
private Texture loadTexture2D(final String path, final Texture.MinificationFilter minFilter) { if (_dataCache.containsTexture(path)) { return _dataCache.getTexture(path); } final Texture texture; if (_importer.getTextureLocator() == null) { texture = TextureManager.load(path, minFilter, _compressTextures ? TextureStoreFormat.GuessCompressedFormat : TextureStoreFormat.GuessNoCompressedFormat, true); } else { final ResourceSource source = _importer.getTextureLocator().locateResource(path); texture = TextureManager.load(source, minFilter, _compressTextures ? TextureStoreFormat.GuessCompressedFormat : TextureStoreFormat.GuessNoCompressedFormat, true); } _dataCache.addTexture(path, texture); return texture; }
private Texture loadTexture(final String name) { Texture tex = null; if (_textureLocator == null) { tex = TextureManager.load(name, getMinificationFilter(), isUseCompression() ? TextureStoreFormat.GuessCompressedFormat : TextureStoreFormat.GuessNoCompressedFormat, isFlipTextureVertically()); } else { final ResourceSource source = _textureLocator.locateResource(name); if (source != null) { tex = TextureManager.load(source, getMinificationFilter(), isUseCompression() ? TextureStoreFormat.GuessCompressedFormat : TextureStoreFormat.GuessNoCompressedFormat, isFlipTextureVertically()); } } return tex; }