Package org.jdesktop.wonderland.server.cell

Examples of org.jdesktop.wonderland.server.cell.ProximityComponentMO$ManagedProximityListenerWrapper


  cellID = cellMO.getCellID();

        // The AudioTreatment Component depends upon the Proximity Component.
        // We add this component as a dependency if it does not yet exist
        if (cellMO.getComponent(ProximityComponentMO.class) == null) {
            cellMO.addComponent(new ProximityComponentMO(cellMO));
        }

        cellMO.addParentChangeListener(this);
  //System.out.println("Added parent change listener");
    }
View Full Code Here


    private ManagedReference<AudioTreatmentProximityListener> proximityListener;

    private void addProximityListener(Treatment treatment) {
        // Fetch the proximity component, we will need this below. If it does
        // not exist (it should), then log an error
        ProximityComponentMO component = cellRef.get().getComponent(ProximityComponentMO.class);

        if (component == null) {
            logger.warning("The AudioTreatment Component does not have a " +
                    "Proximity Component for Cell ID " + cellID);
            return;
        }

        // We are making this component live, add a listener to the proximity component.
  BoundingVolume[] bounds = new BoundingVolume[1];

        bounds[0] = audioBounds;

        AudioTreatmentProximityListener proximityListener =
      new AudioTreatmentProximityListener(cellRef.get(), treatment);

  this.proximityListener = AppContext.getDataManager().createReference(proximityListener);
 
        component.addProximityListener(proximityListener, bounds);
    }
View Full Code Here

        component.addProximityListener(proximityListener, bounds);
    }

    private void removeProximityListener() {
  if (proximityListener != null) {
            ProximityComponentMO component = cellRef.get().getComponent(ProximityComponentMO.class);
      component.removeProximityListener(proximityListener.get());
  }
    }
View Full Code Here

  }

  CellMO cellMO = CellManagerMO.getCellManager().getCell(info.getCellID());

        if (cellMO.getComponent(ProximityComponentMO.class) == null) {
            cellMO.addComponent(new ProximityComponentMO(cellMO));
        }

  ProximityComponentMO component = cellMO.getComponent(ProximityComponentMO.class);

        BoundingVolume[] bounds = new BoundingVolume[1];

  AudioGroup ag = AppContext.getManager(VoiceManager.class).getVoiceManagerParameters().livePlayerAudioGroup;
View Full Code Here

      return;
  }

  CellMO cellMO = CellManagerMO.getCellManager().getCell(info.getCellID());

  ProximityComponentMO component = cellMO.getComponent(ProximityComponentMO.class);
  component.removeProximityListener(proximityListener);
    }
View Full Code Here

        super(cellMO);

        // The Cone of Silence Components depends upon the Proximity Component.
        // We add this component as a dependency if it does not yet exist
        if (cellMO.getComponent(ProximityComponentMO.class) == null) {
            cellMO.addComponent(new ProximityComponentMO(cellMO));
        }
    }
View Full Code Here

    }

    private void addProximityListener(boolean live) {
        // Fetch the proximity component, we will need this below. If it does
        // not exist (it should), then log an error
        ProximityComponentMO component = cellRef.get().getComponent(ProximityComponentMO.class);
        if (component == null) {
            logger.warning("The Cone of Silence Component does not have a " +
                    "Proximity Component for Cell ID " + cellID);
            return;
        }

  if (proximityListenerRef != null) {
      ConeOfSilenceProximityListener proximityListener = proximityListenerRef.get();
      proximityListener.remove();
            component.removeProximityListener(proximityListener);
      proximityListenerRef = null;
            //System.out.println("Removing proximity listener...");
        }

        // If we are making this component live, then add a listener to the proximity component.
        if (live == true) {
            BoundingVolume[] boundingVolume = new BoundingVolume[1];

      //System.out.println("BOUNDS TYPE " + boundsType);

      if (boundsType.equals(COSBoundsType.CELL_BOUNDS)) {
    boundingVolume[0] = cellRef.get().getLocalBounds();
    logger.warning("COS Using cell local bounds:  " + boundingVolume[0]);
    System.out.println("COS Using cell local bounds:  " + boundingVolume[0]);
      } else if (boundsType.equals(COSBoundsType.BOX)) {
                boundingVolume[0] = new BoundingBox(new Vector3f(), bounds.getX(),
        bounds.getY(), bounds.getZ());
    logger.warning("COS Using specified BOX:  " + boundingVolume[0]);
    System.out.println("COS Using specified BOX:  " + boundingVolume[0]);
      } else {
                boundingVolume[0] = new BoundingSphere(bounds.getX(), new Vector3f());
    logger.warning("COS Using specified radius:  " + boundingVolume[0]);
    System.out.println("COS Using specified radius:  " + boundingVolume[0]);
      }

            ConeOfSilenceProximityListener proximityListener =
    new ConeOfSilenceProximityListener(cellRef.get(), name, outsideAudioVolume);

      proximityListenerRef = AppContext.getDataManager().createReference(proximityListener);
            component.addProximityListener(proximityListener, boundingVolume);
        }
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.server.cell.ProximityComponentMO$ManagedProximityListenerWrapper

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.