Import std.math.geometry
Frustum
struct
Public Struct Frustum Implements Equatable, Printable
What a camera sees: the six planes of its projection, each facing in.
Examples
Local camera = Mat4.Perspective(Deg(90), 1, 0.1, 100) *
Mat4.LookAt(Vec3(0, 0, 5), Vec3(0, 0, 0), Vec3(0, 1, 0))
Local view = Frustum.FromMatrix(camera)
Expect(view.Contains(Vec3(0, 0, 0)))
Expect(!view.Contains(Vec3(0, 0, 10)))
Expect(view.Intersects(Sphere(Vec3(0, 0, 0), 1)))std/math/geometry.fb, line 419
-
Its left plane, facing in.
-
Its right plane, facing in.
-
Its bottom plane, facing in.
-
Its top plane, facing in.
-
Its near plane, facing in.
-
Its far plane, facing in.
-
The frustum of a projection times a view matrix, as Mat4.Perspective and LookAt make them, with depth from 0 to 1, in the space the view matrix takes from: the world's, for a camera.
-
Whether the
pointis inside, or on a plane. -
Whether the
sphereis inside, or partly: False only when it's all behind a plane. -
Whether the
boxis inside, or partly: False only when it's all behind a plane, so a box just past a corner of the frustum can be True, as culling allows. -
Its six planes, left, right, bottom, top, near, and far, as "Frustum(Plane(...), ...)".
Report an issue with this page or with FutureBlitz on GitHub.