Examples of CellTransform


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

        /**
         * @inheritDoc()
         */
        public void rotationStarted() {
            CellTransform transform = cell.getLocalTransform();
            rotationOnPress = transform.getRotation(null);
        }
View Full Code Here

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

        /**
         * @inheritDoc()
         */
        public void resizingPerformed(float scale) {
            // Move the cell via the moveable comopnent
            CellTransform transform = cell.getLocalTransform();
            float newResizing = scalingOnPress * scale;
            transform.setScaling(newResizing);
            movableComp.localMoveRequest(transform);
        }
View Full Code Here

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

        /**
         * @inheritDoc()
         */
        public void resizingStarted() {
            CellTransform transform = cell.getLocalTransform();
            scalingOnPress = transform.getScaling();
        }
View Full Code Here

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

        public void translationPerformed(Vector3f translation) {

            // We must convert the translation in world coordinates to local
            // coordinates of the Cell. First find the Cell Transform of the
            // parent Cell (if there is one) and the world root transform.
            CellTransform cellWorldTransform = new CellTransform();
            if (cell.getParent() != null) {
                cellWorldTransform = cell.getParent().getWorldTransform();
                cellWorldTransform.setTranslation(new Vector3f());
            }
            CellTransform worldTransform = new CellTransform();

            // Formulate a new transform that just has the new world translation
            // of the Cell.
            CellTransform transform = new CellTransform(null, translation);

            // Convert into a Cell's local coordinations.
            CellTransform newTransform = CellPlacementUtils.transform(
                    transform, worldTransform, cellWorldTransform);

            // Find out how much to add to the transform. This is done in
            // world coordinates.
            Vector3f newTranslation = translationOnPress.add(newTransform.getTranslation(null));

            // Set the translation back on the Cell using the movable component
            CellTransform cellTransform = cell.getLocalTransform();
            cellTransform.setTranslation(newTranslation);
            movableComp.localMoveRequest(cellTransform);
        }
View Full Code Here

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

        /**
         * @inheritDoc()
         */
        public void translationStarted() {
            CellTransform transform = cell.getLocalTransform();
            translationOnPress = transform.getTranslation(null);
        }
View Full Code Here

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

            }

            // Find the world transform of the new parent. If there is no new
            // parent (e.g. if the Cell is to be placed at the world root), then
            // use a null transform.
            CellTransform newParentWorld = new CellTransform(null, null);
            if (newParent != null) {
                newParentWorld = newParent.getWorldTransform();
            }

            CellTransform newChildLocal = ScenegraphUtils.computeChildTransform(
                    newParentWorld, draggedCell.getWorldTransform());

            // Send a message to the server indicating the change in the
            // parent. We need to send this over the cell edit connection,
            // rather than the cell connection.
View Full Code Here

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

    /**
     * Return a new CellTransform with the values from this MovableMessage
     * @return
     */
    public CellTransform getCellTransform() {
        return new CellTransform(rotation, translation, scale);
    }
View Full Code Here

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

                    prevRot == null || !prevRot.epsilonEquals(rotation, 0.001f) ||
                    !Math3DUtils.epsilonEquals(prevHeight, height, 0.001f) ||
                    prevCollision != collision)
                {                   
                    MovableAvatarComponent mac = ((MovableAvatarComponent) c.getComponent(MovableComponent.class));
                    mac.localMoveRequest(new CellTransform(rotation.getRotation(), translation), height, collision);

                    prevTrans = translation.clone();
                    prevRot = new PMatrix(rotation);
                    prevHeight = height;
                    prevCollision = collision;
                }
            };  
        };

        // This info will be sent to the other clients to animate the avatar
        gameContextListener = new GameContextListener() {

            public void trigger(boolean pressed, int trigger, Vector3f translation, Quaternion rotation) {
                synchronized (this) {
                    currentTrigger = trigger;
                    currentPressed = pressed;
                }
               
                String animationName = null;
               
                // OWL issue #237 - regardless of the current state, send the
                // animation that is currently set in CycleActionState. This
                // is consistent with the behavior of
                // WlAvatarContext.setMiscAnimation() used in the trigger()
                // method below
                CycleActionState cas = (CycleActionState)
                        avatarCharacter.getContext().getState(CycleActionState.class);
                if (cas != null) {
                    animationName = cas.getAnimationName();
                }
                               
                float height = avatarCharacter.getController().getHeight();
                boolean collision = avatarCharacter.getController().isColliding();
               
                if (c.getComponent(MovableComponent.class)==null) {
                    logger.warning("!!!! NULL MovableComponent");
                } else {
                    MovableAvatarComponent mac = ((MovableAvatarComponent) c.getComponent(MovableComponent.class));
                    mac.localMoveRequest(new CellTransform(rotation, translation),
                                         trigger, pressed, animationName,
                                         height, collision, null);
               
                }
            }
View Full Code Here

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

    private WlAvatarCharacter loadAvatarInternal(AvatarConfigInfo avatarConfigInfo)
            throws MalformedURLException, IOException {
       
        WlAvatarCharacter ret = null;
        PMatrix origin = new PMatrix();
        CellTransform transform = cell.getLocalTransform();
        origin.setTranslation(transform.getTranslation(null));
        origin.setRotation(transform.getRotation(null));

        // Create the character
        String avatarDetail = System.getProperty("avatar.detail", "high");
       
        // check if we support high-quality avatars
View Full Code Here

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

                                                      new Vector3f(1, 1, 1));
                    avatarCharacter.getModelInst().setTransform(xform);
                }
            });
        } else {
            CellTransform transform = new CellTransform();
            transform.setRotation(look);
            transform.setTranslation(position);
       
            cell.getComponent(MovableComponent.class).localMoveRequest(transform);
        }
    }
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.