/** Constructs the new bounding box using the given minimum and maximum vector. * * @param minimum The minimum vector * @param maximum The maximum vector */ public BoundingBox (Vector3 minimum, Vector3 maximum) { this.set(minimum, maximum); }
/** Constructs a new bounding box from the given bounding box. * * @param bounds The bounding box to copy */ public BoundingBox (BoundingBox bounds) { this.set(bounds); }
/** Constructs the new bounding box using the given minimum and maximum vector. * * @param minimum The minimum vector * @param maximum The maximum vector */ public BoundingBox (Vector3 minimum, Vector3 maximum) { this.set(minimum, maximum); }
/** Sets the given bounding box. * * @param bounds The bounds. * @return This bounding box for chaining. */ public BoundingBox set (BoundingBox bounds) { return this.set(bounds.min, bounds.max); }
/** Sets the given bounding box. * * @param bounds The bounds. * @return This bounding box for chaining. */ public BoundingBox set (BoundingBox bounds) { return this.set(bounds.min, bounds.max); }
/** Constructs a new bounding box from the given bounding box. * * @param bounds The bounding box to copy */ public BoundingBox (BoundingBox bounds) { this.set(bounds); }
/** Sets the minimum and maximum vector to zeros. * @return This bounding box for chaining. */ public BoundingBox clr () { return this.set(min.set(0, 0, 0), max.set(0, 0, 0)); }
/** Sets the minimum and maximum vector to zeros. * @return This bounding box for chaining. */ public BoundingBox clr () { return this.set(min.set(0, 0, 0), max.set(0, 0, 0)); }
/** Extends the bounding box to incorporate the given {@link Vector3}. * @param point The vector * @return This bounding box for chaining. */ public BoundingBox ext (Vector3 point) { return this.set(min.set(min(min.x, point.x), min(min.y, point.y), min(min.z, point.z)), max.set(Math.max(max.x, point.x), Math.max(max.y, point.y), Math.max(max.z, point.z))); }
/** Extends the bounding box to incorporate the given {@link Vector3}. * @param point The vector * @return This bounding box for chaining. */ public BoundingBox ext (Vector3 point) { return this.set(min.set(min(min.x, point.x), min(min.y, point.y), min(min.z, point.z)), max.set(Math.max(max.x, point.x), Math.max(max.y, point.y), Math.max(max.z, point.z))); }
/** Extends the bounding box by the given vector. * * @param x The x-coordinate * @param y The y-coordinate * @param z The z-coordinate * @return This bounding box for chaining. */ public BoundingBox ext (float x, float y, float z) { return this.set(min.set(min(min.x, x), min(min.y, y), min(min.z, z)), max.set(max(max.x, x), max(max.y, y), max(max.z, z))); }
/** Extends this bounding box by the given bounding box. * * @param a_bounds The bounding box * @return This bounding box for chaining. */ public BoundingBox ext (BoundingBox a_bounds) { return this.set(min.set(min(min.x, a_bounds.min.x), min(min.y, a_bounds.min.y), min(min.z, a_bounds.min.z)), max.set(max(max.x, a_bounds.max.x), max(max.y, a_bounds.max.y), max(max.z, a_bounds.max.z))); }
/** Extends this bounding box by the given sphere. * * @param center Sphere center * @param radius Sphere radius * @return This bounding box for chaining. */ public BoundingBox ext (Vector3 center, float radius) { return this.set(min.set(min(min.x, center.x - radius), min(min.y, center.y - radius), min(min.z, center.z - radius)), max.set(max(max.x, center.x + radius), max(max.y, center.y + radius), max(max.z, center.z + radius))); }
/** Extends the bounding box by the given vector. * * @param x The x-coordinate * @param y The y-coordinate * @param z The z-coordinate * @return This bounding box for chaining. */ public BoundingBox ext (float x, float y, float z) { return this.set(min.set(min(min.x, x), min(min.y, y), min(min.z, z)), max.set(max(max.x, x), max(max.y, y), max(max.z, z))); }
/** Extends this bounding box by the given sphere. * * @param center Sphere center * @param radius Sphere radius * @return This bounding box for chaining. */ public BoundingBox ext (Vector3 center, float radius) { return this.set(min.set(min(min.x, center.x - radius), min(min.y, center.y - radius), min(min.z, center.z - radius)), max.set(max(max.x, center.x + radius), max(max.y, center.y + radius), max(max.z, center.z + radius))); }
/** Extends this bounding box by the given bounding box. * * @param a_bounds The bounding box * @return This bounding box for chaining. */ public BoundingBox ext (BoundingBox a_bounds) { return this.set(min.set(min(min.x, a_bounds.min.x), min(min.y, a_bounds.min.y), min(min.z, a_bounds.min.z)), max.set(max(max.x, a_bounds.max.x), max(max.y, a_bounds.max.y), max(max.z, a_bounds.max.z))); }
/** Sets the given bounding box. * * @param bounds The bounds. * @return This bounding box for chaining. */ public BoundingBox set (BoundingBox bounds) { return this.set(bounds.min, bounds.max); }
/** Sets the minimum and maximum vector to zeros. * @return This bounding box for chaining. */ public BoundingBox clr () { return this.set(min.set(0, 0, 0), max.set(0, 0, 0)); }
/** Extends the bounding box to incorporate the given {@link Vector3}. * @param point The vector * @return This bounding box for chaining. */ public BoundingBox ext (Vector3 point) { return this.set(min.set(min(min.x, point.x), min(min.y, point.y), min(min.z, point.z)), max.set(Math.max(max.x, point.x), Math.max(max.y, point.y), Math.max(max.z, point.z))); }
/** Extends the bounding box by the given vector. * * @param x The x-coordinate * @param y The y-coordinate * @param z The z-coordinate * @return This bounding box for chaining. */ public BoundingBox ext (float x, float y, float z) { return this.set(min.set(min(min.x, x), min(min.y, y), min(min.z, z)), max.set(max(max.x, x), max(max.y, y), max(max.z, z))); }