geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
SphericalSector< T, N > Class Template Reference

A N-dimensional circle, sphere, or hypersphere. More...

#include <geomc/shape/SphericalSector.h>

Inheritance diagram for SphericalSector< T, N >:
Convex< T, N, SphericalSector< T, N > > RayIntersectable< T, N, SphericalSector< T, N > > Projectable< T, N, SphericalSector< T, N > > Bounded< T, N, SphericalSector< T, N > > SdfEvaluable< T, N, SphericalSector< T, N > > Dimensional< T, N >

Public Types

typedef ptype::point_t point_t
 
using elem_t
 The coordinate type of this object.
 

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, Nbounds () const
 
bool contains (point_t p) const
 Shape-point intersection test.
 
point_t convex_support (point_t d) const
 
sdf (point_t p) const
 
point_t project (point_t p) const
 xxx todo
 
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.
 
Vec< T, Nclip (Vec< T, N > p) const
 Nearest point on the interior of the shape.
 

Public Attributes

half_angle_radians
 Opening half-angle of the sector, between 0 and π.
 
radius
 Radius of the sphere.
 

Static Public Attributes

static constexpr index_t N
 The dimension of this object.
 

Detailed Description

template<typename T, index_t N>
class geom::SphericalSector< T, N >

A N-dimensional circle, sphere, or hypersphere.

Constructor & Destructor Documentation

◆ SphericalSector() [1/3]

template<typename T , index_t N>
SphericalSector ( )
inlineconstexpr

Construct a spherical sector at the origin with radius 1 and an opening half-angle of 45 degrees.

◆ SphericalSector() [2/3]

template<typename T , index_t N>
SphericalSector ( const Sphere< T, N > & s,
Vec< T, N > v,
T cos_a )
inlineconstexpr

Construct a spherical sector with center at the origin, having radius r.

Parameters
rRadius of spehre.

◆ SphericalSector() [3/3]

template<typename T , index_t N>
SphericalSector ( const point_t & c,
T r,
Vec< T, N > v,
T cos_a )
inlineconstexpr

Construct a sphere with center at the point c, having radius r.

Parameters
cCenter of sphere.
rRadius of spehre.

Member Function Documentation

◆ clip()

Vec< T, N > clip ( Vec< T, N > p) const
inlineinherited

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.

◆ intersect()

template<typename T , index_t N>
Rect< T, 1 > intersect ( const Ray< T, N > & ray) const
inline

xxx todo Shape-ray intersection test.

◆ intersects()

bool intersects ( const Convex< T, N, Shape > & other) const
inlineinherited

Convex shape overlap test.

Returns
True if and only if this convex shape overlaps other; false otherwise.

◆ normal()

template<typename T , index_t N>
point_t normal ( point_t p) const
inline

xxx todo Outward-facing direction.

◆ project()

template<typename T , index_t N>
point_t project ( point_t p) const
inline

xxx todo

Return the point p orthogonally projected onto the surface of the shape.

◆ sdf()

template<typename T , index_t N>
T sdf ( point_t p) const
inline

xxx todo Signed distance function.


The documentation for this class was generated from the following file: