library of assembled shared sources |
http://lass.cocamware.com |
#include <sphere_3d.h>
Data Structures | |
struct | Rebind |
Public Types | |
enum | { dimension = TPoint::dimension } |
typedef Sphere3D< T > | TSelf |
typedef Point3D< T > | TPoint |
typedef TPoint::TVector | TVector |
typedef TPoint::TValue | TValue |
typedef TPoint::TParam | TParam |
typedef TPoint::TReference | TReference |
typedef TPoint::TConstReference | TConstReference |
typedef TPoint::TNumTraits | TNumTraits |
Public Member Functions | |
Sphere3D () | |
Sphere3D (const Point3D< T > &iCenter, TParam iRadius) | |
const TPoint & | center () const |
TPoint & | center () |
TConstReference | radius () const |
TReference | radius () |
const TValue | area () const |
return area of surface of sphere | |
const TValue | volume () const |
return volume of sphere | |
const 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. | |
const bool | contains (const TPoint &iPoint) const |
returns if point is on inside or on surface | |
const 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. | |
const bool | contains (const TPoint &iPoint, TParam iRelativeTolerance) const |
returns if point is on inside or on surface | |
const bool | isValid () const |
return true if sphere has a non-negative radius | |
Private Attributes | |
TPoint | center_ |
center of sphere | |
TValue | radius_ |
radius of sphere | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T > | |
Aabb3D< T > | aabb (const Sphere3D< T > &sphere) |
template<typename T , typename MMP > | |
const bool | intersects (const Sphere3D< T > &sphere, const Aabb3D< T, MMP > &aabb) |
template<typename T , typename MMP > | |
const bool | collides (const Sphere3D< T > &sphere, const Aabb3D< T, MMP > &aabb) |
template<typename T > | |
const T | squaredDistance (const Sphere3D< T > &sphere, const Point3D< T > &point) |
template<typename T > | |
const T | distance (const Sphere3D< T > &sphere, const Point3D< T > &point) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &ioOStream, const Sphere3D< T > &iSphere) |
template<typename T > | |
io::XmlOStream & | operator<< (io::XmlOStream &ioOStream, const Sphere3D< T > &iSphere) |
Definition at line 75 of file sphere_3d.h.
typedef Sphere3D<T> lass::prim::Sphere3D< T >::TSelf |
Definition at line 79 of file sphere_3d.h.
typedef Point3D<T> lass::prim::Sphere3D< T >::TPoint |
Definition at line 81 of file sphere_3d.h.
typedef TPoint::TVector lass::prim::Sphere3D< T >::TVector |
Definition at line 82 of file sphere_3d.h.
typedef TPoint::TValue lass::prim::Sphere3D< T >::TValue |
Definition at line 84 of file sphere_3d.h.
typedef TPoint::TParam lass::prim::Sphere3D< T >::TParam |
Definition at line 85 of file sphere_3d.h.
typedef TPoint::TReference lass::prim::Sphere3D< T >::TReference |
Definition at line 86 of file sphere_3d.h.
typedef TPoint::TConstReference lass::prim::Sphere3D< T >::TConstReference |
Definition at line 87 of file sphere_3d.h.
typedef TPoint::TNumTraits lass::prim::Sphere3D< T >::TNumTraits |
Definition at line 88 of file sphere_3d.h.
anonymous enum |
lass::prim::Sphere3D< T >::Sphere3D | ( | ) | [inline] |
Definition at line 60 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::center_, lass::prim::Point3D< T >::isZero(), and LASS_ASSERT.
lass::prim::Sphere3D< T >::Sphere3D | ( | const Point3D< T > & | iCenter, | |
TParam | iRadius | |||
) |
const Sphere3D< T >::TPoint & lass::prim::Sphere3D< T >::center | ( | ) | const [inline] |
Definition at line 80 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::center_.
Referenced by lass::prim::Sphere3D< T >::aabb(), lass::prim::Aabb3D< T, MinMaxPolicy >::collides(), lass::prim::impl::RaySphere< Normalized >::intersect(), lass::prim::impl::RaySphere< NormalizingPolicy >::intersect(), and lass::prim::Aabb3D< T, MinMaxPolicy >::intersects().
Sphere3D< T >::TPoint & lass::prim::Sphere3D< T >::center | ( | ) | [inline] |
Sphere3D< T >::TConstReference lass::prim::Sphere3D< T >::radius | ( | ) | const [inline] |
Definition at line 98 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::radius_.
Referenced by lass::prim::Sphere3D< T >::aabb(), lass::prim::Aabb3D< T, MinMaxPolicy >::collides(), lass::prim::impl::RaySphere< Normalized >::intersect(), lass::prim::impl::RaySphere< NormalizingPolicy >::intersect(), and lass::prim::Aabb3D< T, MinMaxPolicy >::intersects().
Sphere3D< T >::TReference lass::prim::Sphere3D< T >::radius | ( | ) | [inline] |
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::area | ( | ) | const [inline] |
return area of surface of sphere
Definition at line 118 of file sphere_3d.inl.
References lass::num::NumTraits< C >::pi, lass::prim::Sphere3D< T >::radius_, and sqr().
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::volume | ( | ) | const [inline] |
return volume of sphere
Definition at line 129 of file sphere_3d.inl.
References lass::num::NumTraits< C >::pi, lass::prim::Sphere3D< T >::radius_, and lass::num::sqr().
const Side lass::prim::Sphere3D< T >::classify | ( | const TPoint & | iPoint | ) | const [inline] |
Classify a point and tell and what side of the sphere surface it is.
Definition at line 140 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::equation(), lass::prim::sInside, lass::prim::sOutside, lass::prim::sSurface, and lass::num::NumTraits< C >::zero.
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::equation | ( | const TPoint & | iPoint | ) | const [inline] |
(P - C)² - r²
Definition at line 153 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::center_, lass::prim::Sphere3D< T >::radius_, sqr(), and lass::prim::Vector3D< T >::squaredNorm().
Referenced by lass::prim::Sphere3D< T >::classify(), lass::prim::Sphere3D< T >::contains(), lass::prim::Sphere3D< T >::signedDistance(), and lass::prim::Sphere3D< T >::squaredDistance().
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::signedDistance | ( | const TPoint & | iPoint | ) | const [inline] |
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 lass::prim::Sphere3D< T >::equation(), sqrt(), and lass::num::NumTraits< C >::zero.
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::squaredDistance | ( | const TPoint & | iPoint | ) | const [inline] |
return squared distance of point to surface of sphere.
Definition at line 178 of file sphere_3d.inl.
References lass::num::abs(), and lass::prim::Sphere3D< T >::equation().
Referenced by lass::prim::Sphere3D< T >::distance(), and lass::prim::Sphere3D< T >::squaredDistance().
const bool lass::prim::Sphere3D< T >::contains | ( | const TPoint & | iPoint | ) | const [inline] |
returns if point is on inside or on surface
classify(iPoint) != sOutside
but may be faster Definition at line 189 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::equation(), and lass::num::NumTraits< C >::zero.
const Side lass::prim::Sphere3D< T >::classify | ( | const TPoint & | iPoint, | |
TParam | iRelativeTolerance | |||
) | const [inline] |
Classify a point and tell and what side of the sphere surface it is.
Definition at line 201 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::equation(), lass::prim::sInside, lass::prim::sOutside, lass::prim::sSurface, and lass::num::NumTraits< C >::zero.
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::equation | ( | const TPoint & | iPoint, | |
TParam | iRelativeTolerance | |||
) | const [inline] |
(P - C)² - r²
Definition at line 214 of file sphere_3d.inl.
References lass::num::almostEqual(), lass::prim::Sphere3D< T >::center_, lass::prim::Sphere3D< T >::radius_, sqr(), lass::prim::Vector3D< T >::squaredNorm(), and lass::num::NumTraits< C >::zero.
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::signedDistance | ( | const TPoint & | iPoint, | |
TParam | iRelativeTolerance | |||
) | const [inline] |
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 lass::prim::Sphere3D< T >::equation(), sqrt(), and lass::num::NumTraits< C >::zero.
const Sphere3D< T >::TValue lass::prim::Sphere3D< T >::squaredDistance | ( | const TPoint & | iPoint, | |
TParam | iRelativeTolerance | |||
) | const [inline] |
return squared distance of point to surface of sphere.
Definition at line 241 of file sphere_3d.inl.
References lass::num::abs(), and lass::prim::Sphere3D< T >::equation().
const bool lass::prim::Sphere3D< T >::contains | ( | const TPoint & | iPoint, | |
TParam | iRelativeTolerance | |||
) | const [inline] |
returns if point is on inside or on surface
classify(iPoint, iRelativeTolerance) != sOutside
but may be faster Definition at line 252 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::equation(), and lass::num::NumTraits< C >::zero.
const bool lass::prim::Sphere3D< T >::isValid | ( | ) | const [inline] |
return true if sphere has a non-negative radius
Definition at line 263 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::radius_, and lass::num::NumTraits< C >::zero.
Definition at line 59 of file aabb_3d_sphere_3d.h.
References lass::prim::Sphere3D< T >::center(), and lass::prim::Sphere3D< T >::radius().
const bool intersects | ( | const Sphere3D< T > & | sphere, | |
const Aabb3D< T, MMP > & | aabb | |||
) | [related] |
Definition at line 100 of file aabb_3d_sphere_3d.h.
References lass::prim::intersects().
const bool collides | ( | const Sphere3D< T > & | sphere, | |
const Aabb3D< T, MMP > & | aabb | |||
) | [related] |
Definition at line 125 of file aabb_3d_sphere_3d.h.
References lass::prim::collides().
const T squaredDistance | ( | const Sphere3D< T > & | sphere, | |
const Point3D< T > & | point | |||
) | [related] |
Definition at line 283 of file sphere_3d.inl.
References lass::prim::Sphere3D< T >::squaredDistance().
const T distance | ( | const Sphere3D< T > & | sphere, | |
const Point3D< T > & | point | |||
) | [related] |
Definition at line 293 of file sphere_3d.inl.
References sqrt(), and lass::prim::Sphere3D< T >::squaredDistance().
std::ostream & operator<< | ( | std::ostream & | ioOStream, | |
const Sphere3D< T > & | iSphere | |||
) | [related] |
io::XmlOStream & operator<< | ( | io::XmlOStream & | ioOStream, | |
const Sphere3D< T > & | iSphere | |||
) | [related] |
TPoint lass::prim::Sphere3D< T >::center_ [private] |
center of sphere
Definition at line 125 of file sphere_3d.h.
Referenced by lass::prim::Sphere3D< T >::center(), lass::prim::Sphere3D< T >::equation(), and lass::prim::Sphere3D< T >::Sphere3D().
TValue lass::prim::Sphere3D< T >::radius_ [private] |
radius of sphere
Definition at line 126 of file sphere_3d.h.
Referenced by lass::prim::Sphere3D< T >::area(), lass::prim::Sphere3D< T >::equation(), lass::prim::Sphere3D< T >::isValid(), lass::prim::Sphere3D< T >::radius(), and lass::prim::Sphere3D< T >::volume().
Generated on Mon Nov 10 14:22:14 2008 for Library of Assembled Shared Sources by 1.5.7.1 |