API reference
API reference
Select your platform
No SDKs available
No versions available

Bound3D Class

Modifiers: final
Represents a 3D bounding box with minimum and maximum coordinates.

Signature

data class Bound3D(var min: Vector3 = Vector3(0f, 0f, 0f), var max: Vector3 = Vector3(0f, 0f, 0f))

Constructors

Bound3D ( min , max )
Signature
constructor(min: Vector3 = Vector3(0f, 0f, 0f), max: Vector3 = Vector3(0f, 0f, 0f))
Parameters
min: Vector3
max: Vector3
Returns

Properties

max : Vector3
[Get][Set]
Signature
var max: Vector3
min : Vector3
[Get][Set]
Signature
var min: Vector3

Functions

center ()
Calculates the center of the bounding box.
Signature
fun center(): Vector3
Returns
  The center of the bounding box as a Vector3.
contains ( v )
Checks if a given vector is within the bounds of the bounding box.
Signature
fun contains(v: Vector3): Boolean
Parameters
  The vector to check.
Returns
Boolean
  True if the vector is within the bounds of the bounding box, false otherwise.
encapsulate ( bounds )
Encapsulates another bounding box within this one.
Signature
fun encapsulate(bounds: Bound3D)
Parameters
bounds: Bound3D
  The other bounding box to encapsulate.
extents ()
Calculates the extents of the bounding box.
Signature
fun extents(): Vector3
Returns
  The extents of the bounding box as a Vector3.
getVolume ()
Calculates the volume of this 3D bounding box.
Signature
fun Bound3D.getVolume(): Float
Returns
Float
  The volume in cubic units, computed as width × height × depth
size ()
Calculates the size of the bounding box.
Signature
fun size(): Vector3
Returns
  The size of the bounding box as a Vector3.
toString ()
Returns a string representation of this object in the format (min, max).
Signature
open override fun toString(): String
Returns
String
  A string representing the object.
Did you find this page helpful?