Package org.jdesktop.wonderland.common.cell

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


      detachedOrbList.add(orbCell);
  }

  avatarCell = ((CellClientSession)session).getLocalAvatar().getViewCell();
     
  CellTransform transform = orbCell.getLocalTransform();
  Vector3f translation = orbCell.getLocalTransform().getTranslation(null);
 
  followMe = new FollowMe(
      orbCell.getComponent(MovableComponent.class), translation, this);
View Full Code Here


    private void reorderDetachedOrbs() {
  if (hostCell == null) {
      return;
  }

  CellTransform transform = hostCell.getLocalTransform();

  Vector3f translation = new Vector3f();
  transform.getTranslation(translation);

  synchronized (detachedOrbList) {
      for (int i = 0 ; i < detachedOrbList.size(); i++) {
          translation.setZ(translation.getZ() + (float) .2);
          translation.setY((float) .5)// lower orb.
          followMe.setTargetPosition(translation,
            transform.getRotation(null));
      }
  }

    }
View Full Code Here

    private void positionAttachedOrbs(Cell hostCell) {
  if (hostCell == null) {
      return;
  }

  CellTransform transform = hostCell.getLocalTransform();
  ArrayList<OrbCell> attachedOrbList = attachedOrbMap.get(hostCell);

  if (attachedOrbList == null) {
      return;
  }

  synchronized (attachedOrbList) {
      for (int i = 0; i < attachedOrbList.size(); i++) {
    Vector3f translation = new Vector3f();
    transform.getTranslation(translation);

    translation.setY((float) (2.2 + (.3 * i)))// Raise orb.
    attachedOrbList.get(i).getOrbMessageHandler().getFollowMe().setTargetPosition(
        translation);
      }
View Full Code Here

        // Fetch the transform of the view (avatar) Cell and its "look at"
        // direction.
        ViewManager vm = ViewManager.getViewManager();
        ViewCell viewCell = vm.getPrimaryViewCell();
        CellTransform viewTransform = viewCell.getWorldTransform();
        ServerSessionManager manager =
                viewCell.getCellCache().getSession().getSessionManager();

        // The Cell Transform to apply to the Cell
        CellTransform transform = null;

        // Look for the "bounds hint" provided by the Cell. There are three
        // possible cases:
        //
        // (1) There is a hint and the Cell wants us to do the optimal layout
        // so go ahead and do it.
        //
        // (2) There is no hint, so use the default bounds radius and do the
        // optimal layout
        //
        // (3) There is a hint that says do not do the optimal layout, so we
        // will just put the Cell right on top of the avatar.
        BoundingVolumeHint hint = state.getBoundingVolumeHint();

        logger.info("Using bounding volume hint " + hint.getBoundsHint() +
                ", do placement=" + hint.isDoSystemPlacement());
       
        if (hint != null && hint.isDoSystemPlacement() == true) {
            // Case (1): We have a bounds hint and we want to do the layout,
            // so we find the distance away from the avatar and also the height
            // above the ground.
            BoundingVolume boundsHint = hint.getBoundsHint();
            transform = CellPlacementUtils.getCellTransform(manager, boundsHint,
                    viewTransform);
        }
        else if (hint == null) {
            // Case (2): Do the optimal placement using the default radius.
            BoundingVolume boundsHint = new BoundingSphere(DEFAULT_RADIUS, Vector3f.ZERO);
            transform = CellPlacementUtils.getCellTransform(manager, boundsHint,
                    viewTransform);
        }
        else if (hint != null && hint.isDoSystemPlacement() == false) {
            // Case (3): The Cell will take care of its own placement, use
            // the origin of the avatar as the initial placement.
           
            // Issue 998: make sure this is actually the current location of
            // the avatar, and not the origin.  This guarantees that the
            // cell will be in the viewcache of the creator at least, so
            // that the cell object can be (for example) positioned manually
            // by the client.
            transform = viewTransform;
        }
       
        // We also need to convert the initial origin of the Cell (in world
        // coordinates to the coordinates of the parent Cell (if non-null)
        if (parentCellID != null) {
            Cell parent = viewCell.getCellCache().getCell(parentCellID);
            CellTransform worldTransform = new CellTransform(null, null);
            CellTransform parentTransform = parent.getWorldTransform();

            logger.info("Transform of the parent cell: translation=" +
                    parentTransform.getTranslation(null).toString() + ", rotation=" +
                    parentTransform.getRotation(null).toString());

            transform = ScenegraphUtils.computeChildTransform(parentTransform,
                                                              transform);
        }
       
View Full Code Here

        if (localTransform == null) {
            this.localTransform = null;
            // Get parent worldTransform
            Cell current = getParent();
            while (current != null) {
                CellTransform parentWorldTransform = current.getWorldTransform();
                if (parentWorldTransform != null) {
                    setWorldTransform(parentWorldTransform, source)// this method also calls notifyTransformChangeListeners
                    current = null;
                } else {
                    current = current.getParent();
View Full Code Here

     * @param parent
     * @param child
     * @return the combined bounds of the child and all it's children
     */
    private BoundingVolume transformTreeUpdate(Cell parent, Cell child, TransformChangeListener.ChangeSource source) {
        CellTransform parentWorldTransform = parent.getWorldTransform();

        CellTransform childTransform = child.getLocalTransform();

        if (childTransform != null) {
            // OWL issue #149: calculate the transform the same way as
            // setLocalTransform() above.
            childTransform = parentWorldTransform.mul(childTransform);
View Full Code Here

    public OrbCellMO(Vector3f center, float size, String username,
      String callID, boolean simulateCalls, VirtualPlayer vp,
      String[] bystanders) {

  super(new BoundingSphere(size, center), new CellTransform(null, center));

  this.username = username;
        this.callID = callID;
        this.simulateCalls = simulateCalls;
  this.vp = vp;
View Full Code Here

            ViewManager vm = ClientContextJME.getViewManager();

            switch(status) {
                case ACTIVE :
                    if (increasing) {
                        CellTransform worldTransform = cell.getWorldTransform();
                        for(ProximityListenerRecord l : listenerRecords)
                            l.updateWorldBounds(worldTransform);

                        vm.addViewManagerListener(this);
                        primaryViewCellChanged(null, vm.getPrimaryViewCell());
View Full Code Here

        public void transformChanged(Cell cell, ChangeSource source) {
            LOGGER.finest("View transform changed for " + cell.getCellID() +
                          " to " + cell.getWorldTransform());

            synchronized(listenerRecords) {
                CellTransform worldTransform = cell.getWorldTransform();
                for(ProximityListenerRecord l : listenerRecords) {
                    l.viewCellMoved(cell.getCellID(), worldTransform);
                }
            }
        }
View Full Code Here

     * Listen for the cell to which this component is attached moving. When
     * notified update the bounds
     */
    class CellTransformListener implements TransformChangeListener {
        public void transformChanged(Cell cell, ChangeSource source) {
            CellTransform worldTransform = cell.getWorldTransform();
            synchronized(listenerRecords) {
                for(ProximityListenerRecord l : listenerRecords) {
                    l.updateWorldBounds(worldTransform);
                   
                    // Reevalute view position and send enter/exit events as necessary
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.common.cell.CellTransform

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.