Exemplo n.º 1
0
 public void updateHintText(Vector3f target) {
   int x = (int) getCamera().getLocation().x;
   int y = (int) getCamera().getLocation().y;
   int z = (int) getCamera().getLocation().z;
   String targetText = "";
   if (target != null) targetText = "  intersect: " + target.toString();
   hintText.setText(
       "Press left mouse button to raise terrain, press right mouse button to lower terrain.  "
           + x
           + ","
           + y
           + ","
           + z
           + targetText);
 }
Exemplo n.º 2
0
  /**
   * Prints out a CollisionResults Collection for debugging/diagnosis.
   *
   * @param results A CollisionResults Collection to print out.
   */
  public void printCollisionResults(CollisionResults results) {
    if (results != null) {
      // Print the results of the collision.
      logger.info("Hits: " + results.size());
      if (results.size() > 0) {

        // Print the results.
        for (CollisionResult result : results) {
          // For each hit, we know distance, impact point, name of
          // geometry.
          float dist = result.getDistance();
          Vector3f pt = result.getContactPoint();
          String hit = result.getGeometry().getName();
          logger.info("Hit " + hit + " at distance " + dist + " at location " + pt.toString());
        }
      }
    }

    return;
  }
Exemplo n.º 3
0
 @Override
 public String toString() {
   return point.toString();
 }