Package org.jdesktop.mtgame

Examples of org.jdesktop.mtgame.RenderUpdater


        // of the affordances: this handles the case where the bounds of the
        // scene graph has changed and we need to update the affordances
        // accordingly.
        sceneRoot.addGeometricUpdateListener(updateListener = new GeometricUpdateListener() {
            public void geometricDataChanged(final Spatial spatial) {
                RenderUpdater u = new RenderUpdater() {
                    public void update(Object arg0) {
                        Vector3f translation = spatial.getWorldTranslation();
                        rootNode.setLocalTranslation(translation);
                        setSizeInternal(currentScale);
                        ClientContextJME.getWorldManager().addToUpdateList(rootNode);
View Full Code Here


    /**
     * @inheritDoc()
     */
    public void setSize(final float size) {
        // Sets the size of the affordance in a thread-safe manner
        RenderUpdater u = new RenderUpdater() {
            public void update(Object obj) {
                setSizeInternal(size);
            }
        };
        ClientContextJME.getWorldManager().addRenderUpdater(u, this);
View Full Code Here

     */
    public synchronized void setVisible(boolean visible) {
        // If we want to make the affordance visible and it already is not
        // visible, then make it visible.
        if (visible == true && isVisible == false) {
            RenderUpdater updater = new RenderUpdater() {
                public void update(Object arg0) {
                    Affordance affordance = (Affordance)arg0;
                    Node rootNode = affordance.getRootNode();
                    ClientContextJME.getWorldManager().addEntity(affordance);
                    ClientContextJME.getWorldManager().addToUpdateList(rootNode);
                }
            };
            WorldManager wm = ClientContextJME.getWorldManager();
            wm.addRenderUpdater(updater, this);
            isVisible = true;
            return;
        }

        // If we want to make the affordance invisible and it already is
        // visible, then make it invisible
        if (visible == false && isVisible == true) {
            RenderUpdater updater = new RenderUpdater() {
                public void update(Object arg0) {
                    Affordance affordance = (Affordance)arg0;
                    ClientContextJME.getWorldManager().removeEntity(affordance);
                }
            };
View Full Code Here

        if (editingRow >= 0 && imports.contains(model)) {
            // Restore Position of model
            final ImportedModel imp = model; //imports.get(editingRow);
            final Node tg = imp.getRootBG();
            final Vector3f rot = imp.getOrientation();
            RenderUpdater renderUpdater = new RenderUpdater() {

                public void update(Object arg0) {
                    tg.setLocalRotation(
                            calcRotationMatrix(rot.x, rot.y, rot.z));
                    tg.setLocalTranslation(imp.getTranslation());
View Full Code Here

        updateCommon();
    }

    public void updateCommon() throws InstantiationException {
       
        ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {
            public void update(Object arg0) {
                if (horizBar != null) {
                    horizBar.setLocalTranslationNoUpdater(new Vector3f(horizX, horizY, Z_OFFSET));
                }
                if (vertBar != null) {
View Full Code Here

     */
    public void setColorAndOpacity (final ColorRGBA color) {
        setColor(color);

        final WorldManager wm = ClientContextJME.getWorldManager();
        wm.addRenderUpdater(new RenderUpdater() {
            public void update(Object arg0) {

                BlendState as = (BlendState)
                    wm.getRenderManager().createRendererState(RenderState.StateType.Blend);

View Full Code Here

        updateListener = new TransformChangeListener() {
            public void transformChanged(final Cell cell, ChangeSource source) {
                // We need to perform this work inside a proper updater, to
                // make sure we are MT thread safe
                final WorldManager wm = ClientContextJME.getWorldManager();
                RenderUpdater u = new RenderUpdater() {
                    public void update(Object obj) {
                        CellTransform transform = cell.getWorldTransform();
                        rootNode.setLocalTranslation(transform.getTranslation(null));
      rootNode.setLocalRotation(transform.getRotation(null));
                        rootNode.setLocalScale(transform.getScaling(null));
View Full Code Here

            LOGGER.fine("[DefaultEnvironment] transform changed for " + this);
        }

        skyboxProcessor.viewMoved(cell.getWorldTransform().getTranslation(translation));

        ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater(){
            public void update(Object arg0) {

            }
        }, cell);
    }
View Full Code Here

                logger.warning("can't find quad for view, unable to set transparency");
                return;
            }
            final TexturedQuad quad = (TexturedQuad) node.getChild(0);

            RenderUpdater updater = new RenderUpdater() {

                public void update(Object arg0) {
                    WorldManager wm = (WorldManager) arg0;

                    BlendState as = (BlendState) wm.getRenderManager().createRendererState(RenderState.StateType.Blend);
View Full Code Here

    private void updateCommon () throws InstantiationException {
        rect.resize(width, height);

        // For some reason, this needs to be a synchronous (waiting) update
        ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {
            public void update(Object arg0) {
                if (localToCellNode != null) {
                    localToCellNode.setLocalTranslation(new Vector3f(x, y, 0f));
                    ClientContextJME.getWorldManager().addToUpdateList(localToCellNode);
                }
View Full Code Here

TOP

Related Classes of org.jdesktop.mtgame.RenderUpdater

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.