Package org.jdesktop.mtgame

Examples of org.jdesktop.mtgame.RenderComponent


     * Attach this component's entity to its parent entity.
     */
    protected void attachToParentEntity() {
        if (parentEntity != null) {
            parentEntity.addEntity(entity);
            RenderComponent rcParentEntity =
                    (RenderComponent) parentEntity.getComponent(RenderComponent.class);
            RenderComponent rcEntity = (RenderComponent) entity.getComponent(RenderComponent.class);
            if (rcParentEntity != null && rcParentEntity.getSceneRoot() != null && rcEntity != null) {
                rcEntity.setAttachPoint(rcParentEntity.getSceneRoot());
            }
        }
    }
View Full Code Here


     * Detach this component's entity from its parent entity.
     */
    protected void detachFromParentEntity() {
        if (parentEntity != null) {
            parentEntity.removeEntity(entity);
            RenderComponent rcEntity = (RenderComponent) entity.getComponent(RenderComponent.class);
            if (rcEntity != null) {
                rcEntity.setAttachPoint(null);
            }
        }
        parentEntity = null;
    }
View Full Code Here

    public static void printOrthoNodes () {
        // Print ortho nodes attached to the world manager
        WorldManager wm = ClientContextJME.getWorldManager();
        for (int i=0; i < wm.numEntities(); i++) {
            Entity e = wm.getEntity(i);
            RenderComponent rc = (RenderComponent) e.getComponent(RenderComponent.class);
            if (rc == null || !rc.getOrtho()) continue;
            System.err.println("Ortho node = " + rc.getSceneRoot());
            GraphicsUtils.printNode(rc.getSceneRoot());
        }
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected Node createSceneGraph(Entity entity) {

        RenderComponent rc = ClientContextJME.getWorldManager().getRenderManager().
                createRenderComponent(acrjRootNode);
        entity.addComponent(RenderComponent.class, rc);
        rc.setEntity(entity);

        return acrjRootNode;
    }
View Full Code Here

        printIndentLevel(indentLevel);
        System.err.println("Entity = " + entity);

        printIndentLevel(indentLevel);
        System.err.print("sceneRoot = ");
        RenderComponent rc = (RenderComponent) entity.getComponent(RenderComponent.class);
        if (rc == null) {
            System.err.println("null");
        } else {
            Node sceneRoot = rc.getSceneRoot();
            System.err.println(sceneRoot);
            if (sceneRoot != null) {
                GraphicsUtils.printNode(sceneRoot);
            }
View Full Code Here

            logger.finest("attach view: " + view);
            logger.finest("to: " + this);
        }

        Entity e = view.getEntity();
        RenderComponent rcFrame = (RenderComponent) e.getComponent(RenderComponent.class);
        rcFrame.setAttachPoint(this.getGeometryNode());
    }
View Full Code Here

        Entity viewEntity = view.getEntity();
        if (viewEntity == null) {
            return;
        }
        entity.removeEntity(viewEntity);
        RenderComponent rcFrame = (RenderComponent) viewEntity.getComponent(RenderComponent.class);
        if (rcFrame != null) {
            rcFrame.setAttachPoint(null);
        }
    }
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.