Atoms Crowd  7.0.0
Sphere3< T > Class Template Reference

#include <ImathSphere.h>

Public Member Functions

Constructors
constexpr ATOMSMATH_HOSTDEVICE Sphere3 ()
 Default is center at (0,0,0) and radius of 0.
 
constexpr ATOMSMATH_HOSTDEVICE Sphere3 (const Vec3< T > &c, T r)
 Initialize to a given center and radius.
 
Manipulation
ATOMSMATH_HOSTDEVICE void circumscribe (const Box< Vec3< T >> &box)
 
Utility Methods
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool intersect (const Line3< T > &l, Vec3< T > &intersection) const
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool intersectT (const Line3< T > &l, T &t) const
 

Public Attributes

Direct access to member fields
Vec3< T > center
 Center.
 
radius
 Radius.
 

Detailed Description

template<class T>
class Sphere3< T >

A 3D sphere

Member Function Documentation

◆ circumscribe()

template<class T >
void Sphere3< T >::circumscribe ( const Box< Vec3< T >> &  box)
inline

Set the center and radius of the sphere so that it tightly encloses Box b.

◆ intersect()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Sphere3< T >::intersect ( const Line3< T > &  l,
Vec3< T > &  intersection 
) const

If the sphere and line l intersect, then compute the smallest t with t>=0 so that l(t) is a point on the sphere.

Parameters
[in]lThe line
[out]intersectionThe point of intersection
Returns
True if the sphere and line intersect, false if they do not.

◆ intersectT()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Sphere3< T >::intersectT ( const Line3< T > &  l,
T &  t 
) const

If the sphere and line l intersect, then compute the smallest t with t>=0 so that l(t) is a point on the sphere.

Parameters
[in]lThe line
[out]tThe parameter of the line at the intersection point
Returns
True if the sphere and line intersect, false if they do not.

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