Package org.jdesktop.mtgame

Examples of org.jdesktop.mtgame.RenderComponent


       
        DirectionalLight directionalLight = (DirectionalLight)lightNode.getLight();

        rootNode = new Node("Light Viewer Node");
        RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();
        RenderComponent rc = rm.createRenderComponent(rootNode);
        this.addComponent(RenderComponent.class, rc);
       
        // Set the Z-buffer state on the root node
        ZBufferState zbuf = (ZBufferState)rm.createRendererState(StateType.ZBuffer);
        zbuf.setEnabled(true);
View Full Code Here


     * Returns the scene root for the Cell's scene graph
     */
    protected Node getSceneGraphRoot() {
        CellRendererJME renderer = (CellRendererJME)
                cell.getCellRenderer(RendererType.RENDERER_JME);
        RenderComponent cellRC = (RenderComponent)
                renderer.getEntity().getComponent(RenderComponent.class);
        return cellRC.getSceneRoot();
    }
View Full Code Here

                    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

            return;
        }

        // Add all of the default components to the renderer, but remove the
        // collision component, since we use our own collision graph
        RenderComponent rc = (RenderComponent) avatarCharacter.getComponent(RenderComponent.class);
        addDefaultComponents(avatarCharacter, rc.getSceneRoot());
        avatarCharacter.removeComponent(CollisionComponent.class);

        // Set the initial location of the avatar if there is one
        if (currentLocation != null && avatarCharacter.getModelInst() != null) {
            logger.fine(cell.getCellID() + " Using current location: " + currentLocation);
View Full Code Here

                    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);
                    dragStartRadius = dragStartVectorWorld.length();
View Full Code Here

        // Create the root node of the cell and the render component to attach
        // to the Entity with the node
        rootNode = new Node();
        RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();
        RenderComponent rc = rm.createRenderComponent(rootNode);
        this.addComponent(RenderComponent.class, rc);
    }
View Full Code Here

     * class Entity as the parent
     */
    protected void addSubEntity(Entity subEntity, Node subNode) {
        // Create the render component that associates the node with the Entity
        RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();
        RenderComponent thisRC = rm.createRenderComponent(subNode);
        subEntity.addComponent(RenderComponent.class, thisRC);

        // Add this Entity to the parent Entity
        RenderComponent parentRC = this.getComponent(RenderComponent.class);
        thisRC.setAttachPoint(parentRC.getSceneRoot());
        this.addEntity(subEntity);
    }
View Full Code Here

//        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);
View Full Code Here

        Node attachNode =
                js.getExternalKidsRoot(ExternalKidsType.UNTRANSFORMED);

        RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();

        RenderComponent rc = rm.createRenderComponent(this);
        rc.setAttachPoint(attachNode);
        e.addComponent(RenderComponent.class, rc);

        JMECollisionSystem collisionSystem = (JMECollisionSystem) ClientContextJME.getWorldManager().
                getCollisionManager().loadCollisionSystem(JMECollisionSystem.class);
        CollisionComponent cc = collisionSystem.createCollisionComponent(rc.getSceneRoot());
        cc.setCollidable(false);
        cc.setPickable(true);
        e.addComponent(CollisionComponent.class, cc);
    }
View Full Code Here

      dispose();
  }

        rootNode = new Node("Bounds Viewer Node");
        RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();
        RenderComponent rc = rm.createRenderComponent(rootNode);
        this.addComponent(RenderComponent.class, rc);

        // Set the Z-buffer state on the root node
        ZBufferState zbuf = (ZBufferState)rm.createRendererState(StateType.ZBuffer);
        zbuf.setEnabled(true);
View Full Code Here

TOP

Related Classes of org.jdesktop.mtgame.RenderComponent

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.