Package org.jdesktop.wonderland.common.cell.messages

Examples of org.jdesktop.wonderland.common.cell.messages.MovableAvatarMessage


        return MovableAvatarMessage.class;
    }

    @Override
    public void moveRequest(WonderlandClientID clientID, MovableMessage msg) {
        MovableAvatarMessage aMsg = (MovableAvatarMessage) msg;
        CellTransform transform = msg.getCellTransform();

        CellMO cell = cellRef.getForUpdate();
        ChannelComponentMO channelComponent;
        cell.setLocalTransform(transform);

        //store trigger value
        if(aMsg.getTrigger()!=-1) {
            currentTrigeer = aMsg.getTrigger();
            currentAnimationName = aMsg.getAnimationName();
            AppContext.getDataManager().markForUpdate(this);
        }
       
        channelComponent = channelComponentRef.getForUpdate();

        if (cell.isLive()) {
            channelComponent.sendAll(clientID,
                    MovableAvatarMessage.newMovedMessage(cell.getCellID(),
                    transform, aMsg.getTrigger(), aMsg.isPressed(),
                    aMsg.getAnimationName(), aMsg.getHeight(),
                    aMsg.isCollision()));
        }
    }
View Full Code Here


    @Override
    protected void serverMoveRequest(MovableMessage msg) {
        super.serverMoveRequest(msg);

        MovableAvatarMessage mam = (MovableAvatarMessage) msg;
       
        //store value of trigger & animation
        if(trigger!=-1) {
            serverTrigger = mam.getTrigger();
            serverAnimationName = mam.getAnimationName();
        }
       
        // update collision
        ((AvatarCell) cell).triggerCollision(mam.getHeight(), mam.isCollision());
       
//        System.err.println("Move message "+msg.getCellTransform().getTranslation(null)+"  "+mam.getTrigger()+" "+mam.getAnimationName());
        if (mam.getTrigger()!=NO_TRIGGER) {
            ((AvatarCell)cell).triggerAction(mam.getTrigger(), mam.isPressed(), mam.getAnimationName());
        }
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.cell.messages.MovableAvatarMessage

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.