geomc 1.0
A c++ linear algebra template library
|
A N-dimensional circle, sphere, or hypersphere. More...
#include <geomc/shape/SphericalSector.h>
Public Types | |
typedef ptype::point_t | point_t |
typedef T | elem_t |
The coordinate type of this shape. | |
Public Member Functions | |
constexpr | SphericalSector () |
constexpr | SphericalSector (const Sphere< T, N > &s, Vec< T, N > v, T cos_a) |
constexpr | SphericalSector (const point_t &c, T r, Vec< T, N > v, T cos_a) |
Rect< T, N > | bounds () const |
bool | contains (point_t p) const |
Shape-point intersection test. | |
point_t | convex_support (point_t d) const |
T | sdf (point_t p) const |
point_t | project (point_t p) const |
xxx todo More... | |
point_t | normal (point_t p) const |
Rect< T, 1 > | intersect (const Ray< T, N > &ray) const |
bool | intersects (const Convex< T, N, Shape > &other) const |
Convex shape overlap test. More... | |
Vec< T, N > | clip (Vec< T, N > p) const |
Nearest point on the interior of the shape. More... | |
Public Attributes | |
Sphere< T, N > | sphere |
Vec< T, N > | dir |
Direction vector pointing toward the center of the sector cap. | |
T | cos_a |
Cosine of the opening half-angle. | |
Static Public Attributes | |
static constexpr size_t | N = _N |
The dimension of this shape. | |
A N-dimensional circle, sphere, or hypersphere.
|
inlineconstexpr |
Construct a spherical sector at the origin with radius 1 and an opening half-angle of 45 degrees.
|
inlineconstexpr |
Construct a spherical sector with center at the origin, having radius r
.
r | Radius of spehre. |
|
inlineconstexpr |
Construct a sphere with center at the point c
, having radius r
.
c | Center of sphere. |
r | Radius of spehre. |
Nearest point on the interior of the shape.
If p
is on the interior of the shape, return p
unaltered; otherwise orthogonally project p
to the shape's surface.
xxx todo Shape-ray intersection test.
Convex shape overlap test.
other
; false otherwise. xxx todo
Return the point p
orthogonally projected onto the surface of the shape.
|
inline |
xxx todo Signed distance function.