Package org.jdesktop.wonderland.client.jme.artimport

Examples of org.jdesktop.wonderland.client.jme.artimport.ModelLoader


            if (modelComponent!=null) {
                return modelComponent.loadModel(entity);
            }

            if (deployedModel!=null) {
                ModelLoader loader = deployedModel.getModelLoader();
                if (loader==null) {
                    logger.warning("No loader for model "+deployedModel.getModelURL());
                    return new Node("No Loader");
                }
                Node ret = loader.loadDeployedModel(deployedModel, entity);
                return ret;
            }

            ModelLoader loader = LoaderManager.getLoaderManager().getLoader(deployedModelURL);
            if (loader==null) {
                logger.warning("No loader for model "+deployedModel.getModelURL());
                return new Node("No Loader");
            }
            deployedModel = new DeployedModel(deployedModelURL, loader);
            deployedModel.setModelTranslation(modelTranslation);
            deployedModel.setModelRotation(modelRotation);
            deployedModel.setModelScale(modelScale);

            return loader.loadDeployedModel(deployedModel, entity);
        } finally {
            // record statistics
            loadTime.setValue(System.currentTimeMillis() - startTime);
            getCell().getCellCache().getStatistics().add(getCell(), loadTime);
        }
View Full Code Here


    public Node loadModel(Entity rootEntity) {
        Node ret = new Node();

        DeployedModel dm = getDeployedModel();

        ModelLoader loader = dm.getModelLoader();
        Node model = loader.loadDeployedModel(dm, rootEntity);
        if (model != null) {
            model.setName(dm.getModelURL());
            ret.attachChild(model);
        }
        return ret;
View Full Code Here

            lastModelDir = new File(url.getFile()).getParentFile();
        }

        Node modelBG = null;

        ModelLoader modelLoader =
                LoaderManager.getLoaderManager().getLoader(url);

        LOGGER.fine("Using model loader " + modelLoader);

        if (modelLoader == null) {
            String urlString = url.toExternalForm();
            String fileExtension = FileUtils.getFileExtension(urlString);
            String message = BUNDLE.getString("No_Loader_For");
            message = MessageFormat.format(message, fileExtension);
            JOptionPane.showMessageDialog(null, message);
            return null;
        }

        ImportedModel loadedModel = modelLoader.importModel(settings);
        modelBG = loadedModel.getModelBG();

        rootBG.attachChild(modelBG);

        WorldManager wm = ClientContextJME.getWorldManager();
View Full Code Here

        if (dm.getModelBounds()==null) {
            // Legacy support, the DeployedModels object for new builds contains
            // the model bounds.
            // Go ahead and load the model. We need to load the model in order to
            // find out its bounds to set the hint.
            ModelLoader loader = dm.getModelLoader();
            Node node = loader.loadDeployedModel(dm, null);
            BoundingVolume bounds = node.getWorldBound();
            hint = getBoundingVolumeHint(bounds);
            posComp.setBounds(bounds);
        } else {
            hint = getBoundingVolumeHint(dm.getModelBounds());
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.jme.artimport.ModelLoader

Copyright © 2018 www.massapicom. 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.