Package javafx.geometry

Examples of javafx.geometry.BoundingBox.intersects()


        BoundingBox bounds = new BoundingBox(
                parentMinX + (newWidth * World.TILE_WIDTH) / 2 + (newWidth * World.TILE_WIDTH) / 2 * (x - y),
                parentMinY + (newWidth * World.TILE_HEIGHT) / 2 * (x + y),
                newWidth * World.TILE_WIDTH,
                newWidth * World.TILE_HEIGHT);
        if (bounds.intersects(checkBounds)) {
          renderLevel(bounds.getMinX(), bounds.getMinY(),
                  parentOffsetX + x * newWidth, parentOffsetY + y * newWidth,
                  newWidth);
        }
      }
 
View Full Code Here


        BoundingBox bounds = new BoundingBox(
                parentMinX + (width * World.TILE_WIDTH) / 2 + World.TILE_WIDTH / 2 * (x - y),
                parentMinY + World.TILE_HEIGHT / 2 * (x + y),
                World.TILE_WIDTH, World.TILE_HEIGHT);
        Point2D point = new Point2D(bounds.getMinX(), bounds.getMinY());
        if (bounds.intersects(checkBounds)) {
          if (!visibleNodes.containsKey(point)) {
            Tile tile = world.getTile(parentOffsetX + x, parentOffsetY + y);
            Node node = resourceLoader.createResource(tile);
            if (node != null) {
              node.setLayoutX(point.getX());
View Full Code Here

    List<Point2D> visiblePointsToRemove = new LinkedList<>();
    for (Point2D point : visibleNodes.keySet()) {
      BoundingBox bounds = new BoundingBox(
              point.getX(), point.getY(),
              World.TILE_WIDTH, visibleNodes.get(point).getLayoutBounds().getHeight());
      if (!bounds.intersects(checkBounds)) {
        visibleNodesToRemove.add(visibleNodes.get(point));
        visiblePointsToRemove.add(point);
      }
    }
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.