Skip to content

BoundingBox

Debug node that renders an axis-aligned bounding box.

BoundingBox is a visual helper used to display a wireframe box representing the spatial bounds of an object or region. It is commonly used for debugging, collision visualization, or spatial partitioning diagnostics.

The box is defined in local space using a Box3 volume and rendered as lines in the specified color.

cpp
auto geometry = vglx::SphereGeometry::Create();
auto bounds = vglx::BoundingBox::Create(
  geometry->BoundingBox(),
  0xFFFFFF
);
scene->Add(bounds);

INFO

Derives from Node and inherits all public properties and methods.

Construction

Constructors


BoundingBox()

Constructs a BoundingBox object.

cpp
BoundingBox::BoundingBox(const Box3& box, const Color& color);
ParameterDescription
boxAxis-aligned bounding box to visualize.
colorColor used to render the bounding box lines.

Factories preferred


BoundingBox::Create() auto

Creates a shared pointer to a BoundingBox object.

cpp
static auto BoundingBox::Create(const Box3& box, const Color& color);
ParameterDescription
boxAxis-aligned bounding box to visualize.
colorColor used to render the bounding box lines.

Released under the MIT License.