Examples of PickDetails


Examples of org.jdesktop.mtgame.PickDetails

        processEntityEvent(event, destPickInfo, new EventModifier<Event>() {
            public void modifyEvent(Event event, int index) {
                // if this is a mouse event, set the details
                if (event instanceof MouseEvent3D) {
                    // get the selected set of details
                    PickDetails details = null;
                    if (destPickInfo != null && destPickInfo.size() > index) {
                        details = destPickInfo.get(index);
                    }

                    ((MouseEvent3D) event).setPickDetails(details);
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

        // propagate the event to the picked entity
        processEntityEvent(event, pickInfo, new EventModifier<DropTargetEvent3D>() {
            public void modifyEvent(DropTargetEvent3D event, int index) {
                // get the PickDetails for the event, if any
                PickDetails details = null;
                if (pickInfo != null && pickInfo.size() > index) {
                    details = pickInfo.get(index);
                }

                event.setPickDetails(details);
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

        int index = 0;
        Entity entity = null;

        if (pickInfo != null) {
            for (index = 0; index < pickInfo.size(); index++) {
                PickDetails details = pickInfo.get(index);

                // see if we picked an entity
                entity = details.getEntity();
                if (entity != null) {
                    break;
                }
            }
        }
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

  // Create the Wonderland event which corresponds to this AWT event
  // (and, for drag events, attach the raw hit pick info).
  MouseEvent3D event = (MouseEvent3D) createWonderlandEvent(awtMouseEvent);

  // Get the destination entity and move pick details into the event
  PickDetails pickDetails = destPickInfo.get(0);
        Entity entity = pickDetails.getEntity();
  logger.fine("Picker: pickDetails = " + pickDetails);
        logger.fine("Picker: entity = " + entity);
        event.setPickDetails(pickDetails);
        if (eventID == MouseEvent.MOUSE_DRAGGED && hitPickInfo != null) {
            MouseDraggedEvent3D de3d = (MouseDraggedEvent3D) event;
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

            return false;
        }

        // next compare entities of PickDetail objects
        for (int i = 0; i < p1.size(); i++) {
            PickDetails pd1 = p1.get(i);
            PickDetails pd2 = p2.get(i);

            if (pd1.getEntity() == null) {
                if (pd2.getEntity() != null) {
                    return false;
                }
            } else if (!pd1.getEntity().equals(pd2.getEntity())) {
                return false;
            }
        }

        // if everything is the same, the objects are equal
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

    grabPickInfo = hitPickInfo;
    logger.finest("Grab activate, grabPickInfo = " + grabPickInfo);
    if (grabPickInfo != null) {
        logger.finest("grabPickInfo.size() = " + grabPickInfo.size());
        if (grabPickInfo.size() > 0) {
      PickDetails pd = grabPickInfo.get(0);
      logger.finest("Grab pickDetails[0] = " + pd);
      if (pd != null) {
          logPickDetailsEntity(pd);
          CollisionComponent cc = pd.getCollisionComponent();
          logger.finest("cc = " + cc);
          if (cc != null) {
        logger.finest("cc entity = " + cc.getEntity());
          }
      }
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

    public static void logPickInfo (String str, PickInfo pickInfo) {
  logger.fine(str + pickInfo);
  if (pickInfo == null) return;
  logger.fine("pickInfo size = " + pickInfo.size());
  for (int idx = 0; idx < pickInfo.size(); idx++) {
      PickDetails pickDetails = pickInfo.get(idx);
      if (pickDetails == null) continue;
      logger.fine("pickDetails " + idx + ": ");
      logPickDetails(pickDetails);
  }
    }
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

  }

  // Gather up entities which intersect the pick ray until we encounter an
  // entity which doesn't propagate to under.
  boolean propagatesToUnder = true;
  PickDetails pickDetails = pickInfo.get(0);
  int idx = 0;
  while (pickDetails != null && idx < destPickInfo.size() && propagatesToUnder) {
      Entity entity = pickDetails.getEntity();
      /*
      if (pickDetails != null) {
    CollisionComponent cc = pickDetails.getCollisionComponent();
    logger.finest("pd cc = " + cc);
    if (cc != null) {
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

            Ray ray = new Ray(target, dir);
            PickInfo info = collisionSys.pickAllWorldRay(ray, true, false,
                                                         false, cameraComp);
            for (int i = 0; i < info.size(); i++) {
                // find the next picked object
                PickDetails details = info.get(i);
               
                // if the distance is less than the minimum, try the next
                // info
                if (details.getDistance() < MIN_DISTANCE) {
                    continue;
                }
               
                // if we are performing a collision check, see if the
                // camera is closer than the collision
                if (collisionCheck) {
                    if (target.distance(translation) <= details.getDistance()) {
                        // camera is closer than the nearest collision,
                        // re-enable collision
                        collisionEnabled = true;
                    }
                   
                    // only check the first collision
                    break;
                }
               
                // if the collision is farther than where the camera would
                // have been positioned or outside of range, we can stop and
                // leave the camera as is
                if (details.getDistance() >= MAX_DISTANCE ||
                    details.getDistance() >= target.distance(translation))
                {
                    break;
                }
               
                // if we made it here, the collision is within range. Move
                // the camera to the collision point
                translation.set(details.getPosition());
                break;
            }
           
            // we have checked the collision status -- don't check again until
            // the user zooms in
View Full Code Here

Examples of org.jdesktop.mtgame.PickDetails

        // find one, then return the distance to the ground with respect to
        // the given view position.
        PickInfo pi = collision.pickAllWorldRay(heightRay, true, false);
        if (pi.size() != 0) {
            // Grab the first one
            PickDetails pd = pi.get(0);
            return pd.getDistance() - yDelta;
        }

        // Otherwise, if we did not find any ground, then return -1
        return -1;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.