Providing frustum planes
derived by different inputs (P*MV
, ..) used to classify objects.
More...
#include <frustum.hpp>
|
constexpr | Frustum () noexcept=default |
| Creates an undefined instance w/o calculating the frustum. More...
|
|
constexpr | Frustum (const Frustum &o) noexcept=default |
|
constexpr | Frustum (Frustum &&o) noexcept=default |
|
location_t | classifyPoint (const Vec3f &p) const noexcept |
| Classifies the given Vec3f point whether it is outside, inside or on a plane of this frustum. More...
|
|
location_t | classifySphere (const Vec3f &p, const float radius) const noexcept |
| Classifies the given sphere whether it is is outside, intersecting or inside of this frustum. More...
|
|
constexpr Plane * | getPlanes () noexcept |
| Plane s are ordered in the returned array as follows: More...
|
|
constexpr void | getPlanes (float out[]) const noexcept |
| Sets the given [float[off]..float[off+4*6]) out to ( n, d ) . More...
|
|
constexpr jau::math::Vec4f * | getPlanes (jau::math::Vec4f out[]) const noexcept |
| Sets each of the given Vec4f [6] out to Plane#toVec4f(Vec4f) in the order LEFT , RIGHT , BOTTOM , TOP , NEAR , FAR . More...
|
|
bool | isOutside (const AABBox3f &&box) const noexcept |
| Returns whether the given AABBox is completely outside of this frustum. More...
|
|
bool | isOutside (const Vec3f &p) const noexcept |
| Returns whether the given Vec3f point is completely outside of this frustum. More...
|
|
bool | isSphereOutside (const Vec3f &p, const float radius) const noexcept |
| Returns whether the given sphere is completely outside of this frustum. More...
|
|
constexpr Frustum & | operator= (const Frustum &) noexcept=default |
|
constexpr Frustum & | operator= (Frustum &&) noexcept=default |
|
Frustum & | setFromMat (const jau::math::Mat4f &m) noexcept |
| Calculate the frustum planes in world coordinates using the given column major order matrix, usually a projection (P) or premultiplied P*MV matrix. More...
|
|
std::string | toString () |
|
Mat4f & | updateByFovDesc (jau::math::Mat4f &m, const FovDesc &fovDesc) noexcept |
| Calculate the frustum planes in world coordinates using the passed FovDesc . More...
|
|
constexpr void | updateByPlanes (const Plane src[]) noexcept |
| Copy the given src planes into this this instance's planes. More...
|
|
|
static constexpr const int | BOTTOM = 2 |
| Index for bottom plane: {@value}. More...
|
|
static constexpr const int | FAR = 5 |
| Index for far plane: {@value}. More...
|
|
static constexpr const int | LEFT = 0 |
| Index for left plane: {@value}. More...
|
|
static constexpr const int | NEAR = 4 |
| Index for near plane: {@value}. More...
|
|
static constexpr const int | RIGHT = 1 |
| Index for right plane: {@value}. More...
|
|
static constexpr const int | TOP = 3 |
| Index for top plane: {@value}. More...
|
|
◆ location_t
Enumerator |
---|
OUTSIDE | |
INSIDE | |
INTERSECT | |
Definition at line 472 of file frustum.hpp.
◆ Frustum() [1/3]
constexpr jau::math::geom::Frustum::Frustum |
( |
| ) |
|
|
constexprdefaultnoexcept |
Creates an undefined instance w/o calculating the frustum.
Use one of the update(..)
methods to set the planes
.
- See also
- updateByPlanes(Plane[])
-
#updateFrustumPlanes(float[], int)
◆ Frustum() [2/3]
constexpr jau::math::geom::Frustum::Frustum |
( |
const Frustum & |
o | ) |
|
|
constexprdefaultnoexcept |
◆ Frustum() [3/3]
constexpr jau::math::geom::Frustum::Frustum |
( |
Frustum && |
o | ) |
|
|
constexprdefaultnoexcept |
◆ operator=() [1/2]
constexpr Frustum & jau::math::geom::Frustum::operator= |
( |
const Frustum & |
| ) |
|
|
constexprdefaultnoexcept |
◆ operator=() [2/2]
constexpr Frustum & jau::math::geom::Frustum::operator= |
( |
Frustum && |
| ) |
|
|
constexprdefaultnoexcept |
◆ getPlanes() [1/3]
◆ getPlanes() [2/3]
constexpr void jau::math::geom::Frustum::getPlanes |
( |
float |
out[] | ) |
const |
|
inlineconstexprnoexcept |
Sets the given [float[off]..float[off+4*6])
out
to ( n, d )
.
Sets each of the given [float[off]..float[off+4*6])
out
to Plane#toFloats(float[], int)
, i.e. [n.x, n.y, n.z, d, ...].
Plane order is as follows: LEFT
, RIGHT
, BOTTOM
, TOP
, NEAR
, FAR
.
- Parameters
-
out | the float[off+4*6] output array |
- Returns
out
for chaining
Definition at line 290 of file frustum.hpp.
◆ updateByPlanes()
constexpr void jau::math::geom::Frustum::updateByPlanes |
( |
const Plane |
src[] | ) |
|
|
inlineconstexprnoexcept |
Copy the given src
planes into this this instance's planes.
- Parameters
-
Definition at line 303 of file frustum.hpp.
◆ getPlanes() [3/3]
constexpr Plane * jau::math::geom::Frustum::getPlanes |
( |
| ) |
|
|
inlineconstexprnoexcept |
Plane
s are ordered in the returned array as follows:
Plane
's normals are pointing to the inside of the frustum in order to work w/ isOutside(..)
methods.
- Returns
- array of normalized
Plane
s, order see above.
Definition at line 329 of file frustum.hpp.
◆ updateByFovDesc()
Calculate the frustum planes in world coordinates using the passed FovDesc
.
Operation Details:
Frustum plane's normals will point to the inside of the viewing frustum, as required by this class.
- Parameters
-
m | 4x4 matrix in column-major order (also result) |
fovDesc | Frustum FovDesc |
- Returns
- given matrix for chaining
- See also
- Matrix4f::setToPerspective(FovHVHalves, float, float)
-
Matrix4f::updateFrustumPlanes(Frustum)
-
Matrix4f::getFrustum(Frustum, FovDesc)
Definition at line 355 of file frustum.hpp.
◆ setFromMat()
Calculate the frustum planes in world coordinates using the given column major order matrix, usually a projection (P) or premultiplied P*MV matrix.
Frustum plane's normals will point to the inside of the viewing frustum, as required by this class.
Definition at line 369 of file frustum.hpp.
◆ isOutside() [1/2]
bool jau::math::geom::Frustum::isOutside |
( |
const AABBox3f && |
box | ) |
const |
|
inlinenoexcept |
Returns whether the given AABBox
is completely outside of this frustum.
Note: If method returns false, the box may only be partially inside, i.e. intersects with this frustum
Definition at line 463 of file frustum.hpp.
◆ classifyPoint()
location_t jau::math::geom::Frustum::classifyPoint |
( |
const Vec3f & |
p | ) |
const |
|
inlinenoexcept |
Classifies the given Vec3f
point whether it is outside, inside or on a plane of this frustum.
- Parameters
-
- Returns
Location
of point related to frustum planes
Definition at line 480 of file frustum.hpp.
◆ isOutside() [2/2]
bool jau::math::geom::Frustum::isOutside |
( |
const Vec3f & |
p | ) |
const |
|
inlinenoexcept |
Returns whether the given Vec3f
point is completely outside of this frustum.
- Parameters
-
- Returns
- true if outside of the frustum, otherwise inside or on a plane
Definition at line 500 of file frustum.hpp.
◆ classifySphere()
location_t jau::math::geom::Frustum::classifySphere |
( |
const Vec3f & |
p, |
|
|
const float |
radius |
|
) |
| const |
|
inlinenoexcept |
Classifies the given sphere whether it is is outside, intersecting or inside of this frustum.
- Parameters
-
p | center of the sphere |
radius | radius of the sphere |
- Returns
Location
of point related to frustum planes
Definition at line 516 of file frustum.hpp.
◆ isSphereOutside()
bool jau::math::geom::Frustum::isSphereOutside |
( |
const Vec3f & |
p, |
|
|
const float |
radius |
|
) |
| const |
|
inlinenoexcept |
Returns whether the given sphere is completely outside of this frustum.
- Parameters
-
p | center of the sphere |
radius | radius of the sphere |
- Returns
- true if outside of the frustum, otherwise inside or intersecting
Definition at line 539 of file frustum.hpp.
◆ toString()
std::string jau::math::geom::Frustum::toString |
( |
| ) |
|
|
inline |
◆ LEFT
constexpr const int jau::math::geom::Frustum::LEFT = 0 |
|
staticconstexpr |
Index for left plane: {@value}.
Definition at line 97 of file frustum.hpp.
◆ RIGHT
constexpr const int jau::math::geom::Frustum::RIGHT = 1 |
|
staticconstexpr |
Index for right plane: {@value}.
Definition at line 99 of file frustum.hpp.
◆ BOTTOM
constexpr const int jau::math::geom::Frustum::BOTTOM = 2 |
|
staticconstexpr |
Index for bottom plane: {@value}.
Definition at line 101 of file frustum.hpp.
◆ TOP
constexpr const int jau::math::geom::Frustum::TOP = 3 |
|
staticconstexpr |
Index for top plane: {@value}.
Definition at line 103 of file frustum.hpp.
◆ NEAR
constexpr const int jau::math::geom::Frustum::NEAR = 4 |
|
staticconstexpr |
Index for near plane: {@value}.
Definition at line 105 of file frustum.hpp.
◆ FAR
constexpr const int jau::math::geom::Frustum::FAR = 5 |
|
staticconstexpr |
Index for far plane: {@value}.
Definition at line 107 of file frustum.hpp.
The documentation for this class was generated from the following file: