Examples of BinaryImporter


Examples of com.ardor3d.util.export.binary.BinaryImporter

     * @return the new loaded Image.
     * @throws IOException
     *             if an error occurs during read.
     */
    public Image load(final InputStream is, final boolean flip) throws IOException {
        return (Image) new BinaryImporter().load(is);
    }
View Full Code Here

Examples of com.ardor3d.util.export.binary.BinaryImporter

                // First try to load from a3d file
                String resource = closest.source + ".a3d";
                URL url = ResourceLocatorTool.getClassPathResource(BMFontProvider.class, resource);
                try {
                    if (url != null) {
                        final BinaryImporter binaryImporter = new BinaryImporter();
                        closest.bmFont = (BMFont) binaryImporter.load(url);
                    } else {
                        // Not found, load from .fnt
                        resource = closest.source + ".fnt";
                        url = ResourceLocatorTool.getClassPathResource(BMFontProvider.class, resource);
                        closest.bmFont = new BMFont(new URLResourceSource(url), false);
View Full Code Here

Examples of com.ardor3d.util.export.binary.BinaryImporter

        originalNode.setTranslation(new Vector3(-80, 0, -400));
        _root.attachChild(originalNode);

        try {
            binaryImportedNode = (Node) new BinaryImporter().load(bos.toByteArray());
            binaryImportedNode.setTranslation(new Vector3(80, 80, -400));
            _root.attachChild(binaryImportedNode);
        } catch (final IOException e) {
            logger.log(Level.SEVERE, "BinaryImporter failed to load file", e);
        }
View Full Code Here

Examples of com.ardor3d.util.export.binary.BinaryImporter

        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
        final BinaryExporter exporter = new BinaryExporter();
        exporter.save(meshData, bos);
        bos.flush();
        final ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
        final BinaryImporter importer = new BinaryImporter();
        final Savable sav = importer.load(bis);
        return (MeshData) sav;
    }
View Full Code Here

Examples of com.jme.util.export.binary.BinaryImporter

        Object model = null;
        try {
            URL url = getResource(path);
            modelFormat.converter().setProperty("mtllib", url);
            modelFormat.converter().convert(url.openStream(), BO);
            model = new BinaryImporter().load(new ByteArrayInputStream(BO.toByteArray()));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return (Spatial) model;
View Full Code Here

Examples of com.jme.util.export.binary.BinaryImporter

    public static Spatial loadSpatial(String path, ModelFormat modelFormat) {
        ByteArrayOutputStream BO = new ByteArrayOutputStream();
        Object model = null;
        try {
            modelFormat.converter().convert(getResource(path), BO);
            model = new BinaryImporter().load(new ByteArrayInputStream(BO.toByteArray()));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return (Spatial) model;
View Full Code Here

Examples of com.jme3.export.binary.BinaryImporter

    @Override
    public void read(JmeImporter e) throws IOException {
        super.read(e);
        InputCapsule capsule = e.getCapsule(this);
        BinaryImporter importer = BinaryImporter.getInstance();
        AssetManager loaderManager = e.getAssetManager();

        assetLoaderKeys = (ArrayList<ModelKey>) capsule.readSavableArrayList("assetLoaderKeyList", new ArrayList<ModelKey>());
        for (Iterator<ModelKey> it = assetLoaderKeys.iterator(); it.hasNext();) {
            ModelKey modelKey = it.next();
            AssetInfo info = loaderManager.locateAsset(modelKey);
            Spatial child = null;
            if (info != null) {
                child = (Spatial) importer.load(info);
            }
            if (child != null) {
                child.parent = this;
                children.add(child);
                assetChildren.put(modelKey, child);
View Full Code Here

Examples of com.jme3.export.binary.BinaryImporter

            File file = new File(baseFolder.getAbsolutePath() + File.separator + gamePath.replace('/', File.separatorChar) + File.separator + dataName);
            if(!file.exists()){
                return null;
            }
            is = new GZIPInputStream(new BufferedInputStream(new FileInputStream(file)));
            BinaryImporter imp = BinaryImporter.getInstance();
            if (manager != null) {
                imp.setAssetManager(manager);
            }
            sav = imp.load(is);
            Logger.getLogger(SaveGame.class.getName()).log(Level.FINE, "Loading data from: {0}", file.getAbsolutePath());
        } catch (IOException ex) {
            Logger.getLogger(SaveGame.class.getName()).log(Level.SEVERE, "Error loading data: {0}", ex);
            ex.printStackTrace();
        } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.