Package org.jdesktop.wonderland.client.cell

Examples of org.jdesktop.wonderland.client.cell.MovableAvatarComponent


                if (prevTrans == null || !Math3DUtils.epsilonEquals(prevTrans, translation, 0.001f) ||
                    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


       
        //--added for sitting problem when user logs in--//
        //check If there is an existing avatar character
        if(flg==0) {
            AvatarCell acell = (AvatarCell) cell;
            MovableAvatarComponent mac = (MovableAvatarComponent) acell.getComponent(MovableComponent.class);
            //check if avatar has trigger value of sitting
            if(mac.getServerTrigger()==15) {
                avatarCharacter.getContext().triggerPressed(mac.getServerTrigger());
    }
        }
        //--added for sitting problem when user logs in--//
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.cell.MovableAvatarComponent

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.