Library of Assembled Shared Sources
lass::prim::Sphere3D< T > Struct Template Reference

3D Sphere More...

#include <sphere_3d.h>

Inheritance diagram for lass::prim::Sphere3D< T >:

Public Member Functions

const TValue area () const
 return area of surface of sphere
 
const TValue volume () const
 return volume of sphere
 
Side classify (const TPoint &iPoint) const
 Classify a point and tell and what side of the sphere surface it is.
 
const TValue equation (const TPoint &iPoint) const
 (P - C)² - r²
 
const TValue signedDistance (const TPoint &iPoint) const
 return signed distance of point to surface of sphere.
 
const TValue squaredDistance (const TPoint &iPoint) const
 return squared distance of point to surface of sphere.
 
bool contains (const TPoint &iPoint) const
 returns if point is on inside or on surface
 
Side classify (const TPoint &iPoint, TParam iRelativeTolerance) const
 Classify a point and tell and what side of the sphere surface it is.
 
const TValue equation (const TPoint &iPoint, TParam iRelativeTolerance) const
 (P - C)² - r²
 
const TValue signedDistance (const TPoint &iPoint, TParam iRelativeTolerance) const
 return signed distance of point to surface of sphere.
 
const TValue squaredDistance (const TPoint &iPoint, TParam iRelativeTolerance) const
 return squared distance of point to surface of sphere.
 
bool contains (const TPoint &iPoint, TParam iRelativeTolerance) const
 returns if point is on inside or on surface
 
bool isValid () const
 return true if sphere has a non-negative radius
 

Related Symbols

(Note that these are not member symbols.)

template<typename T>
Aabb3D< T > aabb (const Sphere3D< T > &sphere)
 
template<typename T, typename MMP>
bool intersects (const Sphere3D< T > &sphere, const Aabb3D< T, MMP > &aabb)
 
template<typename T, typename MMP>
bool collides (const Sphere3D< T > &sphere, const Aabb3D< T, MMP > &aabb)
 

Detailed Description

template<typename T>
struct lass::prim::Sphere3D< T >

3D Sphere

Author
Bram de Greve
Date
2002-2003

Definition at line 75 of file sphere_3d.h.

Member Function Documentation

◆ classify() [1/2]

template<typename T>
Side lass::prim::Sphere3D< T >::classify ( const TPoint & iPoint) const

Classify a point and tell and what side of the sphere surface it is.

Returns
sInside, sSurface, sOutside

Definition at line 140 of file sphere_3d.inl.

References classify(), equation(), lass::prim::sInside, lass::prim::sOutside, and lass::prim::sSurface.

Referenced by classify(), and classify().

◆ signedDistance() [1/2]

template<typename T>
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::signedDistance ( const TPoint & iPoint) const

return signed distance of point to surface of sphere.

negative distance means point is inside the sphere.

Definition at line 166 of file sphere_3d.inl.

References equation(), and signedDistance().

Referenced by signedDistance(), and signedDistance().

◆ contains() [1/2]

template<typename T>
bool lass::prim::Sphere3D< T >::contains ( const TPoint & iPoint) const

returns if point is on inside or on surface

Returns
classify(iPoint) != sOutside but may be faster

Definition at line 189 of file sphere_3d.inl.

References contains(), and equation().

Referenced by contains(), and contains().

◆ classify() [2/2]

template<typename T>
Side lass::prim::Sphere3D< T >::classify ( const TPoint & iPoint,
TParam iRelativeTolerance ) const

Classify a point and tell and what side of the sphere surface it is.

Returns
sInside, sSurface, sOutside

Definition at line 201 of file sphere_3d.inl.

References classify(), equation(), lass::prim::sInside, lass::prim::sOutside, and lass::prim::sSurface.

◆ signedDistance() [2/2]

template<typename T>
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::signedDistance ( const TPoint & iPoint,
TParam iRelativeTolerance ) const

return signed distance of point to surface of sphere.

negative distance means point is inside the sphere.

Definition at line 229 of file sphere_3d.inl.

References equation(), and signedDistance().

◆ contains() [2/2]

template<typename T>
bool lass::prim::Sphere3D< T >::contains ( const TPoint & iPoint,
TParam iRelativeTolerance ) const

returns if point is on inside or on surface

Returns
classify(iPoint, iRelativeTolerance) != sOutside but may be faster

Definition at line 252 of file sphere_3d.inl.

References contains(), and equation().

Friends And Related Symbol Documentation

◆ aabb()

template<typename T>
Aabb3D< T > aabb ( const Sphere3D< T > & sphere)
related
See also
lass::prim::Aabb3D

Definition at line 59 of file aabb_3d_sphere_3d.h.

◆ intersects()

template<typename T, typename MMP>
bool intersects ( const Sphere3D< T > & sphere,
const Aabb3D< T, MMP > & aabb )
related
See also
lass::prim::Aabb3D

Definition at line 99 of file aabb_3d_sphere_3d.h.

◆ collides()

template<typename T, typename MMP>
bool collides ( const Sphere3D< T > & sphere,
const Aabb3D< T, MMP > & aabb )
related
See also
lass::prim::Aabb3D

Definition at line 123 of file aabb_3d_sphere_3d.h.


The documentation for this struct was generated from the following files: