BoundingSphere
Debug node that renders a bounding sphere.
[BoundingSphere](/reference/nodes/bounding_sphere)
is a visual helper used to display a wireframe sphere representing the spatial bounds of an object or volume. It is primarily used for debugging, spatial queries, or visibility testing.
The sphere is defined in local space using a [Sphere](/reference/math/sphere)
object and rendered as a wireframe in the specified color.
cpp
auto geometry = vglx::BoxGeometry::Create();
auto bounds = vglx::BoundingSphere::Create(
geometry->BoundingSphere(),
0xFF0000
);
scene->Add(bounds);
INFO
Derives from Node and inherits all public properties and methods.
Construction
Constructors
BoundingSphere()
cpp
vglx::BoundingSphere::BoundingSphere(const Sphere &sphere, const Color &color)
Parameter | Description |
---|---|
sphere | Bounding sphere to visualize. |
color | Color used to render the bounding sphere. |
Constructs a BoundingSphere object.
Factories preferred
BoundingSphere::Create() auto
cpp
static auto vglx::BoundingSphere::Create(const Sphere &sphere, const Color &color)
Parameter | Description |
---|---|
sphere | Bounding sphere to visualize. |
color | Color used to render the bounding sphere. |
Creates a shared pointer to a BoundingSphere object.