ModelBoundingBox

Represents an axis-aligned bounding box (AABB) for a model part.

This record defines the spatial extent of a model element or group, used for hitboxes and collision detection.

Since

1.15.2

Parameters

minX

the minimum X coordinate

minY

the minimum Y coordinate

minZ

the minimum Z coordinate

maxX

the maximum X coordinate

maxY

the maximum Y coordinate

maxZ

the maximum Z coordinate

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
A minimal bounding box size (0.1 x 0.1 x 0.1).

Functions

Link copied to clipboard
@NotNull
open fun center(): @NotNull ModelBoundingBox
Returns a new bounding box with the same dimensions but centered at the origin (0,0,0).
Link copied to clipboard
@NotNull
open fun centerPoint(): @NotNull Vector3f
Returns the center point of the bounding box as a vector.
Link copied to clipboard
open fun centerY(): Double
Returns the Y coordinate of the center of the bounding box.
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
@NotNull
open fun invert(): @NotNull ModelBoundingBox
Inverts the X and Z coordinates of the bounding box.
Link copied to clipboard
open fun length(): Double
Calculates the full diagonal length of the bounding box.
Link copied to clipboard
open fun lengthZX(): Double
Calculates the diagonal length in the XZ plane.
Link copied to clipboard
@NotNull
open fun max(): @NotNull Vector3d
Returns the maximum corner as a vector.
Link copied to clipboard
@NotNull
open fun min(): @NotNull Vector3d
Returns the minimum corner as a vector.
Link copied to clipboard
@NotNull
open fun of(@NotNull min: @NotNull Vector3d, @NotNull max: @NotNull Vector3d): @NotNull ModelBoundingBox
Creates a bounding box from two corner vectors.
@NotNull
open fun of(x: Double, y: Double, z: Double): @NotNull ModelBoundingBox
Creates a bounding box centered at the origin with the given dimensions.
@NotNull
open fun of(minX: Double, minY: Double, minZ: Double, maxX: Double, maxY: Double, maxZ: Double): @NotNull ModelBoundingBox
Creates a bounding box from explicit min/max coordinates.
Link copied to clipboard
@NotNull
open fun rotate(@NotNull quaterniond: @NotNull Quaterniond): @NotNull ModelBoundingBox
Rotates the bounding box around its center.
Link copied to clipboard
@NotNull
open fun times(scale: Double): @NotNull ModelBoundingBox
Scales the bounding box by a uniform factor.
Link copied to clipboard
abstract fun toString(): String
Link copied to clipboard
open fun x(): Double
Returns the width of the bounding box (X-axis extent).
Link copied to clipboard
open fun y(): Double
Returns the height of the bounding box (Y-axis extent).
Link copied to clipboard
open fun z(): Double
Returns the depth of the bounding box (Z-axis extent).