Nebula
|
#include <frustum.h>
Defines a clipping frustum made of 6 planes.
(C) 2010 Radon Labs GmbH (C) 2013-2020 Individual contributors, see AUTHORS file
Public Types | |
enum | PlaneIndex { Near = 0 , Far , Left , Right , Top , Bottom , NumPlanes } |
plane indices More... | |
Public Member Functions | |
frustum () | |
default constructor | |
frustum (const mat4 &invViewProj) | |
construct from view and projection matrix | |
void | set (const mat4 &invViewProj) |
setup from view and proj matrix | |
void | set (const bbox &box, const mat4 &boxTransform) |
setup from transformed bounding box | |
bool | inside (const point &p) const |
test if point is inside frustum | |
uint | clipmask (const point &p) const |
get clip bitmask of point (0 if inside, (1<<PlaneIndex) if outside) | |
ClipStatus::Type | clip (const line &l, line &clippedLine) const |
clip line against view frustum | |
ClipStatus::Type | clipstatus (const bbox &box) const |
get clip status of a local bounding box | |
ClipStatus::Type | clipstatus (const bbox &box, const mat4 &boxTransform) const |
get clip status of a transformed bounding box | |
template<typename T > | |
T | as () const |
convert to any type | |
Public Attributes | |
plane | planes [NumPlanes] |
Static Public Attributes | |
static const int | TopLeftFar = 0 |
static const int | TopRightFar = 1 |
static const int | BottomLeftFar = 2 |
static const int | BottomRightFar = 3 |
static const int | TopLeftNear = 4 |
static const int | TopRightNear = 5 |
static const int | BottomLeftNear = 6 |
static const int | BottomRightNear = 7 |
|
inline |
default constructor
|
inline |
construct from view and projection matrix
T Math::frustum::as | ( | ) | const |
convert to any type
|
inline |
clip line against view frustum
get clip bitmask of point (0 if inside, (1<<PlaneIndex) if outside)
Get clipmask of point.
|
inline |
get clip status of a local bounding box
|
inline |
get clip status of a transformed bounding box
Returns the clip status of a transformed bounding box.
|
inline |
test if point is inside frustum
Test if point is inside frustum.
setup from transformed bounding box
Setup from a transformed bounding box.
|
inline |
setup from view and proj matrix
Setup frustum from invViewProj matrix (transform from projection space into world space).
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |