Skip to main content
Version: 0.10.0

UeBoxHelper

A helper class that creates and updates a wireframe bounding box around a 3D object. Useful for visual debugging or highlighting the bounding volume of an object.


Constructor​

new UeBoxHelper(object = undefined, color = #FFFF00, data = {})

Inherits from UeLineSegments

Data parameters​

NameTypeDefaultDescription
objectObjectundefinedThe 3D object to create the bounding box for
colorColor#FFFF00Color of the bounding box lines
dataObject{}Additional data to pass to the base class

Properties​

PropertyTypeDescription
objectObjectThe target 3D object
colorColorColor used for the bounding box
materialUeLineBasicMaterialMaterial used for the bounding box

Methods​

updateBox()
  • Updates the bounding box geometry based on the current state of the target object.

  • Computes the bounding box from the object's geometry.

  • Rebuilds the line vertices representing the box edges.

  • Applies the object's transform (position, rotation, scale) to the bounding box helper.

setFromObject(object)

Updates the helper to track a new object.

ParameterTypeDescription
objectObjectThe new object to track

Usage Notes​

  • The bounding box updates automatically on creation.

  • Call setFromObject() to change the target object and update the box.

  • The helper copies the transform of the tracked object to maintain correct positioning, rotation and scaling.