|
geomc 1.0
A c++ linear algebra template library
|
An N-dimensional frustum (truncated pyramid) with an arbitrary Convex shape as its base, and its (possibly excluded) point at the origin. More...
#include <geomc/shape/Frustum.h>
Public Types | |
| typedef PointType< T, Shape::N >::point_t | base_point_t |
| Point type of the base shape. | |
| using | elem_t |
| The coordinate type of this object. | |
| using | point_t |
| The type of a point in this object's space. | |
| typedef Shape::elem_t | T |
| The coordinate type of this Shape. | |
Public Member Functions | |
| Frustum () | |
| Construct a pyramid with its tip at the origin and a default-constructed cross-sectional base at h=1. | |
| Frustum (const Shape &base, const Rect< T, 1 > &h) | |
Construct a new Frustum having base as a cross section, and spanning the height range h. | |
| Frustum (const Shape &base, T h0, T h1) | |
Construct a new Frustum having base as a cross section, and spanning heights between h0 and h1. | |
| Rect< T, N > | bounds () const |
| Rect< T, 1 > | clipped_height () const |
| Return the height range of this Frustum after it has been clipped by the origin. | |
| bool | contains (Vec< T, N > p) const |
| point_t | convex_support (point_t d) const |
| Geometric convex support function. | |
| Vec< T, N > | convex_support (Vec< T, N > d) const |
| Rect< T, 1 > | intersect (const Ray< T, N > &ray) const |
| Ray-shape intersection. | |
| bool | intersects (const Convex< Shape::elem_t, N, Shape > &other) const |
| Convex shape overlap test. | |
| bool | operator== (const Frustum &other) const |
Static Public Member Functions | |
| static constexpr bool | admits_cusps () |
Public Attributes | |
| Shape | base |
Cross-section of this frustum at the h=1 plane. | |
| Rect< T, 1 > | height |
| Height range spanned by this frustum. | |
Static Public Attributes | |
| static constexpr size_t | N = Shape::N + 1 |
| The dimension of this Shape. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename T> | |
| using | Cone = Frustum<Circle<T>> |
| Convenience typedef for a 3D cone with its tip at the origin. | |
| template<typename Shape> | |
| Frustum< Shape > | frustum (const Shape &s, typename Shape::elem_t h0, typename Shape::elem_t h1) |
Convenience function to raise the shape s into a frustum between heights h0 and h1, by wrapping s in the Frustum template. | |
| template<typename T, index_t N> | |
| using | ViewFrustum = Transformed< Frustum< Rect<T,N-1> > > |
| Convenience typedef for oriented, rectangular, N-dimensional Frustums. | |
An N-dimensional frustum (truncated pyramid) with an arbitrary Convex shape as its base, and its (possibly excluded) point at the origin.
The first N-1 dimensions have cross-sections which are Shapes. The last dimension is the "height" of the frustum. The base Shape is specified lying on the h = 1 plane. (Note that below the origin, the base shape will be flipped due to the change of sign).
If the height range spans height = 0, then the height extending below the origin is excluded from the shape. Use clipped_height() to obtain the height range actually spanned by the shape. (A frustum spanning the origin would not be convex).
Oriented, Rect-based Frustums are very commonly needed to represent viewing frustums; for these consider using ViewFrustum, which is a templated type alias for Transformed<Frustum<Rect>>.
|
inherited |
Frustum-point intersection test.
| p | A point. |
true if p is on or inside this frustum; false otherwise. Geometric convex support function.
Returns the point on the surface of this convex shape that is furthest along direction d (i.e., has the highest dot product with d).
All shapes which implement this function automatically support geometrical intersection tests with any other Convex object.
| d | Direction along which to find a support plane. |
Convex shape overlap test.
other; false otherwise.