Package org.jdesktop.wonderland.modules.orb.common.messages

Examples of org.jdesktop.wonderland.modules.orb.common.messages.OrbChangePositionMessage


   positionAttachedOrbs(cell);
    }

    public void positionChanged(Vector3f position) {
  channelComp.send(new OrbChangePositionMessage(orbCell.getCellID(), position));
    }
View Full Code Here


      sender.send(message);
      return;
  }

  if (message instanceof OrbChangePositionMessage) {
      OrbChangePositionMessage msg = (OrbChangePositionMessage) message;

      if (player == null) {
    return;
      }

      Vector3f position = msg.getPosition();

      player.moved(position.getX(), position.getY(), position.getZ(),
    player.getOrientation());
      return;
  }

  if (message instanceof OrbSetVolumeMessage) {
      if (player == null) {
    logger.warning("no player for " + callID);
    return;
      }

      OrbSetVolumeMessage msg = (OrbSetVolumeMessage) message;

      String softphoneCallID = msg.getSoftphoneCallID();

      Player softphonePlayer = vm.getPlayer(softphoneCallID);

      if (softphonePlayer == null) {
    logger.warning("Can't find Player for softphone " + softphoneCallID);
    return;
      }

      DefaultSpatializer spatializer = (DefaultSpatializer)
    vm.getVoiceManagerParameters().livePlayerSpatializer.clone();

      double volume = msg.getVolume();

      spatializer.setAttenuator(volume);

      if (volume == 1) {
          softphonePlayer.removePrivateSpatializer(player);
      } else {
          softphonePlayer.setPrivateSpatializer(player, spatializer);
      }

      logger.fine("player " + player + " sp " + spatializer + " v " + volume);
      return;
   }
 
  if (message instanceof OrbAttachMessage) {
      OrbAttachMessage msg = (OrbAttachMessage) message;
     
      boolean isAttached = msg.isAttached();

      if (isAttached && msg.getHostCellID() == null) {
    /*
     * If hostCellID is null, the client is asking
     * us to tell it if there is a host for this orb.
     */
       sender.send(clientID, new OrbAttachMessage(
        msg.getCellID(), null, false));
    return;
      }

      logger.fine("Orb attached to " + msg.getHostCellID()
        + " is " + msg.isAttached());

      if (msg.isAttached()) {
    hostCellID = msg.getHostCellID();
    orbStatusListenerRef.get().setHostCellID(hostCellID);
      } else {
    orbStatusListenerRef.get().removeCallStatusListener(msg.getHostCellID());   
    hostCellID = null;
      }

      sender.send(message);
      return;
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.orb.common.messages.OrbChangePositionMessage

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.