Import std.math.geometry
AABB
struct
Public Struct AABB Implements Equatable, Printable
An axis-aligned box in 3D, from its corner with the smallest x, y, and z to the one with the largest.
Examples
Local box = AABB(Vec3(-1, -1, -1), Vec3(1, 1, 1))
Local ray = Ray(Vec3(0, 0, 5), Vec3(0, 0, -1))
Expect(box.Raycast(ray) == 4.0)
Expect(ray.At(4) == Vec3(0, 0, 1))
Expect(box.Contains(Vec3(0.5, 0, 0)) && !box.Contains(Vec3(2, 0, 0)))std/math/geometry.fb, line 133
-
Its corner with the smallest x, y, and z.
-
Its corner with the largest x, y, and z.
-
The box of the
size, with its center at the point. -
The smallest box that holds every point. No points panics.
-
The point in its middle.
-
How wide, high, and deep it is.
-
Half the size: how far each face is from the center.
-
Whether the
pointis in the box or on its surface. -
Whether the
otherbox is all in this one. -
Whether the two have a point in common, a face's included.
-
Whether the
sphereand the box have a point in common. -
The
pointin the box nearest the one given: thatpointitself when it's inside. -
How far along the
rayit first meets the box, by its slabs, one axis at a time. -
The smallest box that holds both.
-
The smallest box that holds this one and the
point. -
The box with each face moved out by
amount, or in by a negative one. Shrunk past nothing, an axis is 0 long, at the center. -
The smallest box that holds this one transformed by the matrix, as an object's box is moved into the world.
-
Its parts, as "AABB((0, 0, 0), (1, 1, 1))".
Report an issue with this page or with FutureBlitz on GitHub.