Frustum GeClass.
More...
#include <Frustum.h>
|
OPENVDB_DEPRECATED | Frustum () |
| Generates an uninitialized (i.e in-valid) Frustum. More...
|
|
OPENVDB_DEPRECATED | Frustum (const Frustum &other) |
| Simple copy constructor. More...
|
|
OPENVDB_DEPRECATED | Frustum (const Transform &t) |
|
OPENVDB_DEPRECATED | Frustum (const PlaneType &front, const PlaneType &back, const PlaneType &left, const PlaneType &right, const PlaneType &up, const PlaneType &down) |
|
OPENVDB_DEPRECATED | Frustum (const Point &position, const Vector &direction, const Vector &up, const Vector &left, Real zNear, Real zFar) |
| Contructor from a Camera Frustum. More...
|
|
OPENVDB_DEPRECATED | Frustum (const NonlinearFrustumMap &frustum) |
| Constructor for a Frustum from a NonlinearFrustumMap. More...
|
|
void | rescaleLerp (const Point &unit_min, const Point &unit_max) |
|
void | rescaleSlerp (const Point &unit_min, const Point &unit_max) |
|
bool | operator== (const Frustum &other) const |
|
bool | operator!= (const Frustum &other) const |
|
bool | isInside (const Point &pt) const |
|
bool | isOutside (const Point &pt) const |
|
bool | isValid () const |
|
PlaneType | getFace (int n) const |
|
PlaneType | getPlane (int n) const |
|
void | setFace (int n, const PlaneType &P) |
|
void | setPlane (int n, const PlaneType &P) |
|
PlaneType & | face (int n) |
|
PlaneType & | plane (int n) |
|
int | intersects (const Ray< Real > &ray, Real &t0, Real &t1) const |
| Intersection test against ray. More...
|
|
bool | intersects (const Ray< Real > &ray) const |
|
bool | isInside (const Ray< Real > &ray) const |
|
template<typename Real>
class openvdb::v0_104_0::math::Frustum< Real >
Frustum GeClass.
Generates an uninitialized (i.e in-valid) Frustum.
Constructs a Frustum from the indexToWorld transfrom in a Grid. GridType (or TransformType) is assumed to have a indexToWorld(Vector) method! A complicating aspect is that linear- and frustrum-transforms employ different handedness!
Constructor takes the six planes of the Frustum. Note the ordering: front,back,left,right,up,down
Contructor from a Camera Frustum.
- Parameters
-
position | is the tip of the frustum (i.e. the camera's position). |
direction | is a unit vector pointing from the center toward the near plane. |
up,left | two non-unit vectors describing the direction and extent of the frustum's intersection on the near plane. Together, direction, up and left should form an orthogonal basis for the frustum. |
zNear,zFar | the distance from position along direction to the near and far planes of the frustum. |
- Returns
- reference to one of the 6 half-planes defined by n
- Returns
- copy of one of the 6 half-planes defined by n
static std::string getFaceName |
( |
int |
i | ) |
|
|
inlinestatic |
Intersection test against ray.
- Note
- Assumes (six) planes of the frustum forms a convex polyhedron!
- Parameters
-
ray,t0,t1 | t0 = near, t1 = far |
- Returns
- 0 if ray does not intersect the frustum at all, i.e. is completely outside!
-
-1 if ray is completely inside and never intersects the planes of the frustum, i.e. origin is inside and back-face is beyond ray.tmax
-
1 if ray intersects once. There are two such cases: 1) origin is outside and ray hits front face once (i.e. t0>ray.tmin && t1==ray.tmax) 2) origin is inside and ray hits back face once (i.e. t0==ray.tmin && t1<ray.tmax)
-
2 if ray intersects twice, i.e. origin outside and hitting back face (i.e t0>ray.tmin and t1<ray.tmax)
bool intersects |
( |
const Ray< Real > & |
ray | ) |
const |
|
inline |
- Returns
- true if ray intersects one (or more) of the six planes of the Frustum OR is completely inside
bool isInside |
( |
const Point & |
pt | ) |
const |
|
inline |
- Returns
- true if point is inside Frustum, i.e. inside all six Planes.
bool isInside |
( |
const Ray< Real > & |
ray | ) |
const |
|
inline |
- Returns
- true if ray is completely inside the Frustum
bool isOutside |
( |
const Point & |
pt | ) |
const |
|
inline |
- Returns
- true if point is outside Frustum, i.e. outside one of the six Planes.
- Returns
- true if the Frustum is valid, i.e. all six plane are valid.
void rescaleLerp |
( |
const Point & |
unit_min, |
|
|
const Point & |
unit_max |
|
) |
| |
|
inline |
rescales the Frustum to fit the unit coordinates. Note this method employs linear interpolation and clamps the unit coordinates to [0;1]!
void rescaleSlerp |
( |
const Point & |
unit_min, |
|
|
const Point & |
unit_max |
|
) |
| |
|
inline |
rescales the Frustum to fit the unit coordinates. Note this method employs spherical interpolation and clamps the unit coordinates to [0;1]!
- Returns
- defines one of the 6 half-planes defined by n
The documentation for this class was generated from the following file: