The BoxSoup represents a soup of 3D boxes in terrain-space.
sealed class
|
BoxSoup
|
The
box
soup
is
populated
with
the
Add
methods.
Call
Clear
to
remove
all
boxes.
Clipping
against
arbitrary
planes
in
terrain-space
is
done
with
the
Clip
method.
Use Vertices, Edges and Faces to visualize the box soup, for example the bounding boxes of all terrain mesh sectors in the view-frustum.
Use Points to obtain a point soup of all clipped boxes. This can be used to create fitted convex hulls, for example.
Optional world bounds.
public
property
|
Bounds
{
get
set
}
|
||
type
|
Box3D
|
||
value
|
The world bounds or Max to disable box clippping. |
Remarks:
Add given boxes are clipped to these bounds.
Returns the edges of the clipped box soup.
public
property
|
Edges
{
get
}
|
||
type
|
IArrayVector<Vec2I>
|
||
value
|
|
The box soup edges, as a list of line segments. |
Remarks:
The returned indices refer to the box soup vertices (see Vertices).
Returns the faces of the clipped box soup.
public
property
|
Faces
{
get
}
|
||
type
|
IArrayVector<Vec3I>
|
||
value
|
|
The box soup faces, as a list of triangles. |
Remarks:
The returned indices refer to the box soup vertices (see Vertices).
Returns the points of the clipped box soup.
public
property
|
Points
{
get
}
|
||
type
|
IArrayVector<Vec3D>
|
||
value
|
|
The list of points. |
Returns the vertices of the box soup.
public
property
|
Vertices
{
get
}
|
||
type
|
IArrayVector<Vec3D>
|
||
value
|
|
The list of vertices, in terrain-space. |
Creates a new instance of BoxSoup.
public
constructor
|
BoxSoup
()
|
Adds an axis-aligned box to this soup.
public
method
|
Add
(Box3D box)
|
||
params
|
box
|
The box to add. |
Adds a box to this soup.
public
method
|
Add
(Cuboid box)
|
||
params
|
box
|
The box to add. |
Adds a box to this soup.
public
method
|
Add
(Vec3D v000,
Vec3D v001,
Vec3D v010,
Vec3D v011,
Vec3D v100,
Vec3D v101,
Vec3D v110,
Vec3D v111)
|
||
params
|
v000
|
Box corner vertex. | |
v001
|
Box corner vertex. | ||
v010
|
Box corner vertex. | ||
v011
|
Box corner vertex. | ||
v100
|
Box corner vertex. | ||
v101
|
Box corner vertex. | ||
v110
|
Box corner vertex. | ||
v111
|
Box corner vertex. |
Removes all boxes from this soup.
public
method
|
Clear
()
|
Clips all boxes in this soup at the given plane.
public
method
|
Clip
(Plane plane)
|
||
params
|
plane
|
The plane, in terrain-space. |
Remarks:
This BoxSoup will be intersected with the positive half-space of the given plane.
Sets this box soup the given one.
public
method
|
Set
(BoxSoup other)
|
||
params
|
other
|
[not-null]
|
The box soup to set to. |