HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sphere3< T > Class Template Reference

#include <ImathSphere.h>

Public Member Functions

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

Public Attributes

Direct access to member fields
Vec3< Tcenter
 Center. More...
 
T radius
 Radius. More...
 

Detailed Description

template<class T>
class Sphere3< T >

A 3D sphere

Definition at line 26 of file ImathSphere.h.

Constructor & Destructor Documentation

template<class T>
IMATH_HOSTDEVICE constexpr Sphere3< T >::Sphere3 ( )
inline

Default is center at (0,0,0) and radius of 0.

Definition at line 45 of file ImathSphere.h.

template<class T>
IMATH_HOSTDEVICE constexpr Sphere3< T >::Sphere3 ( const Vec3< T > &  c,
T  r 
)
inline

Initialize to a given center and radius.

Definition at line 48 of file ImathSphere.h.

Member Function Documentation

template<class T >
IMATH_HOSTDEVICE 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.

Definition at line 98 of file ImathSphere.h.

template<class T >
IMATH_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.

Definition at line 148 of file ImathSphere.h.

template<class T >
IMATH_HOSTDEVICE IMATH_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.

Definition at line 106 of file ImathSphere.h.

Member Data Documentation

template<class T>
Vec3<T> Sphere3< T >::center

Center.

Definition at line 34 of file ImathSphere.h.

template<class T>
T Sphere3< T >::radius

Radius.

Definition at line 37 of file ImathSphere.h.


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