Package org.jdesktop.mtgame

Examples of org.jdesktop.mtgame.Entity


            //System.out.println("[PortalComponent] remove prox listener");
            //prox.removeProximityListener(this);
        } else if (status==CellStatus.VISIBLE) {
            if (increasing) {
                collisionListener = new CollisionListener();
                Entity ent = ((CellRendererJME)cell.getCellRenderer(RendererType.RENDERER_JME)).getEntity();
                ClientContextJME.getInputManager().addEventListener(collisionListener, ent);
            } else {
                ClientContextJME.getInputManager().removeEventListener(collisionListener, ((CellRendererJME)cell.getCellRenderer(RendererType.RENDERER_JME)).getEntity());
            }
        }
View Full Code Here


        if (isInSas) return;

        if (updateEnable && imageGraphics != null && texture != null) {
            if (updateProcessor == null) {
                updateProcessor = createUpdateProcessor();
                updateEntity = new Entity("DrawingSurface updateEntity");
                updateEntity.addComponent(ProcessorComponent.class, updateProcessor);
                ClientContextJME.getWorldManager().addEntity(updateEntity);
                updateProcessor.start();
                logger.info("Updating enabled for " + this);
            }
View Full Code Here

        if (controlArb == null) {
            throw new RuntimeException("controlArb argument must be non-null.");
        }
        this.controlArb = controlArb;
        this.pixelScale = pixelScale;
        focusEntity = new Entity("App focus entity for app " + getName());

        synchronized(apps) {
            apps.add(this);
        }
View Full Code Here

                    dragStartScreen = new Point(awtButtonEvent.getX(), awtButtonEvent.getY());
                    dragStartWorld = buttonEvent.getIntersectionPointWorld();
                   
                    // Figure out the world coordinates of the center of the
                    // affordance.
                    Entity entity = event.getEntity();
                    RenderComponent rc = (RenderComponent)entity.getComponent(RenderComponent.class);
                    centerWorld = rc.getSceneRoot().getWorldTranslation();
                   
                    // Compute the vector from the starting point of the drag
                    // to the center of the affordance in world coordinates.
                    dragStartVectorWorld = dragStartWorld.subtract(centerWorld);
View Full Code Here

        rootNode.setLocalTranslation(translation);
       
        // Create a red arrow in the +x direction. We arrow we get back is
        // pointed in the +y direction, so we rotate around the -z axis to
        // orient the arrow properly.
        xEntity = new Entity("Entity X");
        xNode = createArrow("Arrow X", extent + LENGTH_OFFSET, THICKNESS, ColorRGBA.red);
        Quaternion xRotation = new Quaternion().fromAngleAxis((float)Math.PI / 2, new Vector3f(0, 0, -1));
        xNode.setLocalRotation(xRotation);
        xNode.setLocalScale(new Vector3f(1.0f, LENGTH_SCALE, 1.0f));
        xNode.setRenderState(zbuf);
        addSubEntity(xEntity, xNode);
        xListener = addDragListener(xEntity, xNode, TranslateAxis.X_AXIS);

        // Create a green arrow in the +y direction. We arrow we get back is
        // pointed in the +y direction.
        yEntity = new Entity("Entity Y");
        yNode = createArrow("Arrow Y", extent + LENGTH_OFFSET, THICKNESS, ColorRGBA.green);
        yNode.setLocalScale(new Vector3f(1.0f, LENGTH_SCALE, 1.0f));
        yNode.setRenderState(zbuf);
        addSubEntity(yEntity, yNode);
        yListener = addDragListener(yEntity, yNode, TranslateAxis.Y_AXIS);

        // Create a red arrow in the +z direction. We arrow we get back is
        // pointed in the +y direction, so we rotate around the +x axis to
        // orient the arrow properly.
        zEntity = new Entity("Entity Z");
        zNode = createArrow("Arrow Z", extent + LENGTH_OFFSET, THICKNESS, ColorRGBA.blue);
        Quaternion zRotation = new Quaternion().fromAngleAxis((float)Math.PI / 2, new Vector3f(1, 0, 0));
        zNode.setLocalRotation(zRotation);
        zNode.setRenderState(zbuf);
        zNode.setLocalScale(new Vector3f(1.0f, LENGTH_SCALE, 1.0f));
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected Entity createEntity() {
        assert (rootEntity == null);
        rootEntity = new Entity("AvatarRoot");
        return rootEntity;
    }
View Full Code Here

        // the translation for this entity root node
        Vector3f translation = sceneRoot.getWorldTranslation();
        rootNode.setLocalTranslation(translation);
        rootNode.setLocalScale(new Vector3f(LENGTH_SCALE, LENGTH_SCALE, LENGTH_SCALE));

        resizeEntity = new Entity("Sphere Entity");
        Node sphereNode = createSphereNode("Sphere Node");
        addSubEntity(resizeEntity, sphereNode);
        resizeListener = addResizeListener(resizeEntity, sphereNode);

        // Listen for changes to the cell's translation and apply the same
View Full Code Here

                    dragStartScreen = new Point(awtButtonEvent.getX(), awtButtonEvent.getY());
                    dragStartWorld = be.getIntersectionPointWorld();

                    // Figure out the world coordinates of the center of the
                    // affordance.
                    Entity entity = event.getEntity();
                    RenderComponent rc = (RenderComponent)entity.getComponent(RenderComponent.class);
                    Vector3f centerWorld = rc.getSceneRoot().getWorldTranslation();

                    // Compute the vector from the starting point of the drag
                    // to the center of the affordance in world coordinates.
                    dragStartVectorWorld = dragStartWorld.subtract(centerWorld);
View Full Code Here

                RenderState.RS_MATERIAL);
//        matState.setDiffuse(color);
        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));

        wm.addEntity(entity);
        loadedModel.setEntity(entity);
View Full Code Here

    // Uses: type, parent
    @Override
    protected Entity getParentEntity () {
        App2DCellRendererJME renderer = (App2DCellRendererJME) cell.getCellRenderer(Cell.RendererType.RENDERER_JME);
        if (renderer == null) return null;
        Entity cellEntity = renderer.getEntity();

        switch (type) {

        case UNKNOWN:
        case PRIMARY:
View Full Code Here

TOP

Related Classes of org.jdesktop.mtgame.Entity

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.