Package org.jdesktop.mtgame

Examples of org.jdesktop.mtgame.Entity.addComponent()


                    if (thisEntity==null) {
                        logger.severe("Got null entity for "+this.getClass().getName());
                        return;
                    }

                    thisEntity.addComponent(CellRefComponent.class, new CellRefComponent(cell));

                    if (parentEntity!=null) {
                        parentEntity.addEntity(thisEntity);
                    } else {
                        ClientContextJME.getWorldManager().addEntity(thisEntity);
View Full Code Here


    private static WorkProcessor workProcessor;

    SceneWorker(WorldManager worldManager) {
        workProcessor = new WorkProcessor("GlobalWorkProcessor", worldManager);
        Entity entity = new Entity("GlobalEntity");
        entity.addComponent(WorkProcessor.class, workProcessor);
        ClientContextJME.getWorldManager().addEntity(entity);
    }

    /**
     * Add some work to be processed during the commit phase. This is the rendering
View Full Code Here

      spinner.stop();
      entity.removeComponent(SpinProcessor.class);
  } else {
      // Start the spinning
      try {
    entity.addComponent(SpinProcessor.class, new SpinProcessor(entity));
      } catch (InstantiationException ex) {
    // Can't spin an unspinnable entity
      }
  }
    }
View Full Code Here

        Node cellRoot = new Node();
        cellRoot.attachChild(importedModel.getModelBG());
        cellRoot.updateGeometricState(0, true);
        Entity entity = new Entity("Fake");
        RenderComponent rc = ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(cellRoot);
        entity.addComponent(RenderComponent.class, rc);
        importedModel.setEntity(entity);
        importedModel.setDeploymentBaseURL("wlcontent://users/" + loginInfo.getUsername() + "/art/");
        String filename = file.getAbsolutePath();
        filename = filename.substring(
                filename.lastIndexOf(File.separatorChar) + 1);
View Full Code Here

        }

        // Set initial camera position
        cameraProcessor.viewMoved(cell.getWorldTransform());

        entity.addComponent(ViewControls.class, avatarControls);
        attachCell = cell;
        attachCell.addTransformChangeListener(listener);
    }

    /**
 
View Full Code Here

        cameraComponent = wm.getRenderManager().createCameraComponent(cameraSG,
                cameraNode, width, height, fov, aspect, frontClip, backClip,
                true);
        cameraComponent.setCameraSceneGraph(cameraSG);
        cameraComponent.setCameraNode(cameraNode);
        camera.addComponent(CameraComponent.class, cameraComponent);

        cameraController = getDefaultCamera();
        cameraProcessor = new CameraProcessor(cameraNode, cameraController);
        camera.addComponent(ProcessorComponent.class, cameraProcessor);
View Full Code Here

        cameraComponent.setCameraNode(cameraNode);
        camera.addComponent(CameraComponent.class, cameraComponent);

        cameraController = getDefaultCamera();
        cameraProcessor = new CameraProcessor(cameraNode, cameraController);
        camera.addComponent(ProcessorComponent.class, cameraProcessor);

        rb.setCameraComponent(cameraComponent);

        wm.addEntity(camera);
    }
View Full Code Here

                        (TransformProcessorComponent) entity.getComponent(
                        TransformProcessorComponent.class);
                setSpinners(
                        importedModel.getModelBG(), importedModel.getRootBG());

                entity.addComponent(LoadCompleteProcessor.class,
                        new LoadCompleteProcessor(importedModel));

                String dir = origFile.getAbsolutePath();
                dir = dir.substring(0, dir.lastIndexOf(File.separatorChar));
                dir = dir.substring(dir.lastIndexOf(File.separatorChar) + 1);
View Full Code Here

        rootBG.setRenderState(matState);
        rootBG.setRenderState(buf);

        Entity entity = new Entity(loadedModel.getWonderlandName());
        RenderComponent scene = renderManager.createRenderComponent(rootBG);
        entity.addComponent(RenderComponent.class, scene);

        scene.setLightingEnabled(loadedModel.getImportSettings().isLightingEnabled());

        entity.addComponent(TransformProcessorComponent.class,
                new TransformProcessorComponent(wm, modelBG, rootBG));
View Full Code Here

        RenderComponent scene = renderManager.createRenderComponent(rootBG);
        entity.addComponent(RenderComponent.class, scene);

        scene.setLightingEnabled(loadedModel.getImportSettings().isLightingEnabled());

        entity.addComponent(TransformProcessorComponent.class,
                new TransformProcessorComponent(wm, modelBG, rootBG));

        wm.addEntity(entity);
        loadedModel.setEntity(entity);
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.