1 package com.irtimaled.bbor.common.models;
3 import com.irtimaled.bbor.common.BoundingBoxType;
5 public class BoundingBoxSphere extends AbstractBoundingBox {
6 private final double radius;
7 private final double minX;
8 private final double minZ;
9 private final double maxX;
10 private final double maxZ;
11 private final Point point;
13 public BoundingBoxSphere(Point point, double radius, BoundingBoxType type) {
18 Coords center = point.getCoords();
19 this.minX = center.getX() - radius;
20 this.minZ = center.getZ() - radius;
21 this.maxX = center.getX() + radius;
22 this.maxZ = center.getZ() + radius;
26 public Boolean intersectsBounds(int minX, int minZ, int maxX, int maxZ) {
27 return this.maxX >= minX &&
33 public double getRadius() {
37 public Point getPoint() {