Package org.jdesktop.wonderland.common.cell

Examples of org.jdesktop.wonderland.common.cell.CellTransform


        cameraSG.attachChild(cameraNode);

        cameraNode.addGeometricUpdateListener(new GeometricUpdateListener() {

            public void geometricDataChanged(Spatial arg0) {
                notifyCameraMoved(new CellTransform(arg0.getWorldRotation(), arg0.getWorldTranslation()));
            }
        });

        return (cameraSG);
    }
View Full Code Here


            // issue #727: if the cell has not yet been added (because the job
            // to add it is scheduled but hasn't run), this may return null.
            // In that case, just return, since the listener will be notified
            // with the actual bounds once the cell is fully inserted into the
            // world
            CellTransform worldTransform = cell.getWorldTransform(null);
            if (worldTransform != null) {
                // Issue #721: we need to set the transform to the cell's transform
                // here, since the cell may already exist and we can't count on
                // getting a transform changed notification until the cell moves
                updateWorldBounds(worldTransform);
View Full Code Here

    private ManagedReference<UserMO> userRef;
    private WonderlandClientID clientID;

    public AvatarCellMO(UserMO user, WonderlandClientID clientID) {
        super(new BoundingSphere(AvatarBoundsHelper.AVATAR_CELL_SIZE, new Vector3f()),
              new CellTransform(null, new Vector3f())  );

        this.userRef = AppContext.getDataManager().createReference(user);
        this.clientID = clientID;

        Vector3f location = new Vector3f(0,0,0);
        Vector3f lookDirection = new Vector3f(0,0,1);

        Quaternion rotation = new Quaternion();
        rotation.lookAt(lookDirection, new Vector3f(0f,1f,0f));
        CellTransform initialLocation = new CellTransform(rotation, location);
        setLocalTransform(initialLocation);
    }
View Full Code Here

     * down the graph, then coming back up set the world bounds correctly
     * Return the world bounds
     * @return
     */
    private BoundingVolume updateWorldTransform(Identity identity) {
        CellTransform oldWorld;
        boolean transformChanged = false;
        if (worldTransform==null)
            oldWorld=null;
        else
            oldWorld = worldTransform.clone(null);

        if (parent!=null) {
            CellTransform parentWorld = parent.worldTransform.clone(null);
            worldTransform = parentWorld.mul(localTransform);
        } else {
            worldTransform = localTransform.clone(null);
        }

        if (!worldTransform.equals(oldWorld)) {         // TODO should be epsilonEquals
View Full Code Here

        float y = (Float) yTranslationModel.getValue();
        float z = (Float) zTranslationModel.getValue();

        Vector3f translation = new Vector3f(x, y, z);
        if (movableComponent != null) {
            CellTransform cellTransform = selectedCell.getLocalTransform();
            cellTransform.setTranslation(translation);
            movableComponent.localMoveRequest(cellTransform);
        }
    }
View Full Code Here

        y = (float) Math.toRadians(y);
        z = (float) Math.toRadians(z);

        Quaternion newRotation = new Quaternion(new float[]{x, y, z});
        if (movableComponent != null) {
            CellTransform cellTransform = selectedCell.getLocalTransform();
            cellTransform.setRotation(newRotation);
            movableComponent.localMoveRequest(cellTransform);
        }
    }
View Full Code Here

     */
    private void updateScale() {
        float x = (Float) xScaleModel.getValue();

        if (movableComponent != null) {
            CellTransform cellTransform = selectedCell.getLocalTransform();
            cellTransform.setScaling(x);
            movableComponent.localMoveRequest(cellTransform);
        }
    }
View Full Code Here

            clearGUI();
            return;
        }

        // Fetch the current transform from the movable component
        CellTransform cellTransform = selectedCell.getLocalTransform();
        final Vector3f translation = cellTransform.getTranslation(null);
        Quaternion rotation = cellTransform.getRotation(null);
        final Vector3f scale = cellTransform.getScaling(null);
        final float[] angles = rotation.toAngles(new float[3]);

        // Says that we are changing the values of the spinners
        // programmatically. This prevents the values from being sent
        // back to the Cell via the movable component.
View Full Code Here

        }
    }//GEN-LAST:event_refreshButtonActionPerformed

    private void goToButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_goToButtonActionPerformed
        try {
            CellTransform gotoTransform = getGotoLocation(selectedCell);
            ClientContextJME.getClientMain().gotoLocation(null,
                    gotoTransform.getTranslation(null),
                    gotoTransform.getRotation(null));
        } catch (IOException ex) {
            LOGGER.log(Level.WARNING, "Error in goto " + selectedCell, ex);
        }
    }//GEN-LAST:event_goToButtonActionPerformed
View Full Code Here

        look.lookAt(lookVec.negate(), Vector3f.UNIT_Y);

        // find the origin by translating the look vector
        Vector3f origin = lookVec.mult(distance);
        origin.addLocal(cell.getWorldTransform().getTranslation(null));
        return new CellTransform(look, origin);
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.cell.CellTransform

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.