Package org.jdesktop.mtgame

Examples of org.jdesktop.mtgame.RenderUpdater


     * the current graph and loading of the new graph are done asynchronously, this
     * method returns immediately.
     */
    public void reload() {
        if (sceneRoot!=null) {
            ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {
                public void update(Object arg0) {
                    ((Node)arg0).removeFromParent();

                    // TODO DONT do the load (createSceneGraph) on the render thread
                    sceneRoot = createSceneGraph(entity);
View Full Code Here


    {
        final Transparency oldTrans = Transparency.get(oldTM);
        final Transparency newTrans = Transparency.get(newTM);

        // make the change on the render thread
        ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {
            public void update(Object arg0) {
                TreeScan.findNode((Spatial) arg0, new ProcessNodeInterface() {
                    public boolean processNode(Spatial node) {
                        // stop if we cross an entity barier
                        if (node instanceof AttachPointNode) {
View Full Code Here

    @Override
    protected void cleanupSceneGraph(Entity entity) {
        RenderComponent rc = entity.getComponent(RenderComponent.class);
        if (rc!=null) {
            ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {

                public void update(Object arg0) {
                    TreeScan.findNode((Spatial) arg0, new ProcessNodeInterface() {
                        public boolean processNode(Spatial node) {
                            if (node instanceof Geometry) {
View Full Code Here

        if (entity!=null) {
            final RenderComponent rc = entity.getComponent(RenderComponent.class);
            final CullState.Face face = backfaceCullingEnabled ? CullState.Face.Back : CullState.Face.None;
            if (rc!=null && rc.getSceneRoot()!=null) {
                ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {

                    public void update(Object arg0) {
                        TreeScan.findNode(rc.getSceneRoot(), new ProcessNodeInterface() {
                            public boolean processNode(Spatial node) {
                                CullState cs = (CullState) node.getRenderState(RenderState.RS_CULL);
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

        // update to the root node of the affordances
        sceneRoot.addGeometricUpdateListener(updateListener = new GeometricUpdateListener() {
            public void geometricDataChanged(final Spatial spatial) {
                // We need to perform this work inside a proper updater, to
                // make sure we are MT thread safe
                RenderUpdater u = new RenderUpdater() {
                    public void update(Object obj) {
                        // For the rotate affordance we need to move it whenever
                        // the cell is moved, but also need to rotate it when
                        // the cell rotation changes too. We also need to
                        // account for any changes to the size of the cell's
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

        // accordingly.
        sceneRoot.addGeometricUpdateListener(updateListener = new GeometricUpdateListener() {
            public void geometricDataChanged(final Spatial spatial) {
                // We need to perform this work inside a proper updater, to
                // make sure we are MT thread safe
                RenderUpdater u = new RenderUpdater() {
                    public void update(Object obj) {
                        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

    /**
     * Changes the avatar to the given avatar on the MT Game Render Thread
     */
    public void changeAvatar(final WlAvatarCharacter avatar) {
        RenderUpdater updater = new RenderUpdater() {
            public void update(Object arg0) {
                changeAvatarInternal(avatar);
            }
        };
        WorldManager wm = ClientContextJME.getWorldManager();
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.