Package org.jdesktop.wonderland.common.cell

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


* @author Jonathan Kaplan <jonathankap@gmail.com>
*/
@DependsOnCellComponentMO(SharedStateComponentMO.class)
public class DefaultEnvironmentCellMO extends EnvironmentCellMO {
    public DefaultEnvironmentCellMO() {
        setLocalTransform(new CellTransform());
        setLocalBounds(new BoundingSphere());
        setName("environment");
    }
View Full Code Here


            return;
        }

        // Store the values currently on the Cell. This will be used when we
        // go to restore the values later
        CellTransform transform = cell.getLocalTransform();
        originalTranslation = transform.getTranslation(null);
        originalRotation = transform.getRotation(null);
        originalScaling = transform.getScaling(null);

        // OWL issue #159: we are now up to date, no local changes have been made
        isLocalChangesMade = false;

        movableComponent = cell.getComponent(MovableComponent.class);
View Full Code Here

     * @inheritDoc()
     */
    public void apply() {
        // OWL issue #159: we no longer want to revert back to old values
        // on restore, so make sure that we have the latest values on record
        CellTransform transform = editor.getCell().getLocalTransform();
        originalTranslation = transform.getTranslation(null);
        originalRotation = transform.getRotation(null);
        originalScaling = transform.getScaling(null);

        // OWL issue #159: also mark that there are currently no changes
        isLocalChangesMade = false;
    }
View Full Code Here

        // explictly made changes via the GUI. This second check is necessary
        // because if a user edits the position via the affordances, and clicks
        // off the Cell in the Cell Editor, it will revert the position, when
        // not desired. (See Issue #688).
        if (isLocalChangesMade == true) {
            CellTransform transform = cell.getLocalTransform();
            transform.setTranslation(originalTranslation);
            transform.setScaling(originalScaling.x);
            transform.setRotation(originalRotation);
            movableComponent.localMoveRequest(transform);

            // OWL issue #159: local changes have now been restored, so we set this
            // variable back to false
            isLocalChangesMade = false;
View Full Code Here

     * Updates the GUI based upon the given CellTransform
     */
    public void updateGUI() {
        // Fetch the current transform from the movable component
        Cell cell = editor.getCell();
        CellTransform cellTransform = cell.getLocalTransform();
        Vector3f translation = cellTransform.getTranslation(null);
        Quaternion rotation = cellTransform.getRotation(null);
        Vector3f scale = cellTransform.getScaling(null);
        float[] angles = rotation.toAngles(new float[3]);

        // Update the translation spinners
        translationXTF.setValue(translation.x);
        translationYTF.setValue(translation.y);
View Full Code Here

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

        Vector3f translation = new Vector3f(x, y, z);
        if (movableComponent != null) {
            Cell cell = editor.getCell();
            CellTransform cellTransform = cell.getLocalTransform();
            cellTransform.setTranslation(translation);
            movableComponent.localMoveRequest(cellTransform);
            editor.setPanelDirty(PositionJPanel.class, true);
        }
    }
View Full Code Here

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

        Quaternion newRotation = new Quaternion(new float[] { x, y, z });
        if (movableComponent != null) {
            Cell cell = editor.getCell();
            CellTransform cellTransform = cell.getLocalTransform();
            cellTransform.setRotation(newRotation);
            movableComponent.localMoveRequest(cellTransform);
            editor.setPanelDirty(PositionJPanel.class, true);
        }
    }
View Full Code Here

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

        if (movableComponent != null) {
            Cell cell = editor.getCell();
            CellTransform cellTransform = cell.getLocalTransform();
            cellTransform.setScaling(x);
            movableComponent.localMoveRequest(cellTransform);
            editor.setPanelDirty(PositionJPanel.class, true);
        }
    }
View Full Code Here

        // null here
        if (spatial == null) {
            return null;
        }

        CellTransform ret;
        spatial.acquireRootReadLock();
        if (spatial.getWorldTransform()==null)
            ret = null;
        else
            ret = spatial.getWorldTransform().clone(result);
View Full Code Here

        this.clientID = clientID;

        ViewCellMO view = getViewCell();

        // see if there is an initial position specified
        CellTransform xform = getInitialPosition();
        if (xform != null) {
            view.setLocalTransform(xform);
        }

        if (!view.isLive()) {
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.