Examples of CellTransform


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

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

            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

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

     * @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

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

        // 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

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

     * 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

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

        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

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

        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

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

    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

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

        // 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

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

        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
Copyright © 2018 www.massapi.com. 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.