Skip to content

tes3boundingBox⚓︎

A pair of vectors marking a bounding box.

Bounding boxes will always be centered at the world origin.

i.e., their midpoint will always be (0,0,0). You may want to offset the min and max of the bounding box by a specified position before using them.

Properties⚓︎

max⚓︎

The maximum bound of the box.

Returns:


min⚓︎

The minimum bound of the box.

Returns:


Methods⚓︎

__tostring⚓︎

Converts the bounding box to a string with 2 decimal places. The minimum bounds are printed first, then the maximal bounds.

local result = myObject:__tostring()

Returns:

  • result (string)

clampPoint⚓︎

Clamps a given point into the bounding box, given an origin.

local result = myObject:clampPoint(point, origin)

Parameters:

  • point (tes3vector3): The point to clamp. It is modified as part of this method call.
  • origin (tes3vector3): The origin to offset the minimum/maximum vectors by.

Returns:

  • result (boolean)

copy⚓︎

Creates a copy of the bounding box.

local result = myObject:copy()

Returns:


hasUninitializedData⚓︎

Checks to see if any of the vertices in the bounding box remain at a minimum/maximum after a call to :initialize().

local result = myObject:hasUninitializedData()

Returns:

  • result (boolean)

initialize⚓︎

Resets the bounding box so that the minimum and maximum values are set to their maximum opposites. Useful when recalculating the bounding box.

myObject:initialize()

vertices⚓︎

Returns a table containing the 8 vertices comprising this bounding box.

local result = myObject:vertices()

Returns: