Package org.jdesktop.wonderland.modules.avatarbase.client.jme.cellrenderer

Examples of org.jdesktop.wonderland.modules.avatarbase.client.jme.cellrenderer.WlAvatarCharacter


    public static void animateCallAnswer(AudioManagerClient client) {
  if (isPlaying) {
      return;
  }

        WlAvatarCharacter avatar = client.getWlAvatarCharacter();

        if (avatar == null) {
      LOGGER.info("Unable to get avatar for animation");
      return;
        }

        for (String action : avatar.getAnimationNames()) {
            if (action.indexOf("_AnswerCell") > 0) {
                animationName = action;
    break;
            }
        }

  if (animationName == null) {
      LOGGER.info("Unable to get call answer animation name");
      return;
  }

  avatar.playAnimation(animationName);
  isPlaying = true;
   }
View Full Code Here


      return;
  }

  isPlaying = false;

        WlAvatarCharacter avatar = client.getWlAvatarCharacter();
 
        if (avatar == null) {
      LOGGER.info("Unable to get avatar for animation");
            return;
        }
View Full Code Here

   }

   private static void trigger(AudioManagerClient client,
      final TriggerNames trigger) {

        final WlAvatarCharacter avatar = client.getWlAvatarCharacter();

        final Runnable r = new Runnable() {
            public void run() {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException ex) {
                    LOGGER.warning("Sleep failed.");
                }
                avatar.triggerActionStop(trigger);
            }
        };

        // Spawn a thread to start the animation, which then spawns a thread
        // to stop the animation after a small sleep.
        new Thread() {
            @Override
            public void run() {
                avatar.triggerActionStart(trigger);
                new Thread(r).start();
            }
        }.start();
   }
View Full Code Here

        // character from that.
        CharacterParams cp = params.getCharacterParams();
        cp.setBaseURL(baseURL);

        WorldManager wm = ClientContextJME.getWorldManager();
        WlAvatarCharacter wlc = new WlAvatarCharacter.WlAvatarCharacterBuilder(cp, wm).addEntity(false).build();

        // We need to manually apply all of the colors if they are present
        ConfigElement ce = params.getElement(ConfigType.HAIR_COLOR);
        if (ce != null) {
            float r = ((ColorConfigElement)ce).getR();
View Full Code Here

            logger.info("Generating params from url " + url);
           
            // Create character, fetch the IMI CharacterParams and generate a
            // WonderlandCharacterParams from that.
            WlAvatarCharacter wlchar = createAvatarCharacter(url);
            CharacterParams cp = wlchar.getCharacterParams();
            WonderlandCharacterParams wcp = null;
            try {
                if (cp.isMale() == true) {
                    wcp = WonderlandCharacterParams.loadMale();
                }
View Full Code Here

        }

        // Generate the avatar character from the avatar configuration. We will
        // use this to write out its parameters
        WonderlandCharacterParams params = avatar.getAvatarParams(false);
        WlAvatarCharacter character = ImiAvatar.getAvatarCharacter(params);

        // Create a file to hold the avatar configuration locally if it does
        // not yet exist.
        String fileName = avatar.getFilename();
        ContentResource file = (ContentResource) imiCollection.createChild(fileName, Type.RESOURCE);
        if (file == null) {
            file = (ContentResource) imiCollection.createChild(fileName, Type.RESOURCE);
        }

        logger.info("Writing avatar to resource " + file.getPath());

        // Write out the avatar configuration to a byte avatar.
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        character.saveConfiguration(out);
        out.close();

        // Then write out the XML to the local repository. Update the avatar
        // to point to this local avatar resource
        file.put(out.toByteArray());
View Full Code Here

                ViewCell cell = ClientContextJME.getViewManager().getPrimaryViewCell();
                String name = nameTextField.getText().trim();

                // Ask the avatar to generate its character. If null, then
                // clean up the loading message and cursor and return.
                WlAvatarCharacter character = ImiAvatar.getAvatarCharacter(currentParams);
                if (character == null) {
                    LoadingInfo.finishedLoading(cell.getCellID(), name);
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            setBusy(false);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.avatarbase.client.jme.cellrenderer.WlAvatarCharacter

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.